:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(search): mute the filter keys in the command k input (#113901)
Adam Leith8709ff552a4f
diff --git a/frontend/src/lib/components/CommandKSearch/COMMAND_K_SEARCH_UX.md b/frontend/src/lib/components/CommandKSearch/COMMAND_K_SEARCH_UX.mdindex 193a192dbbfa..667af51b6852 100644--- a/frontend/src/lib/components/CommandKSearch/COMMAND_K_SEARCH_UX.md+++ b/frontend/src/lib/components/CommandKSearch/COMMAND_K_SEARCH_UX.md@@ -17,7 +17,7 @@ When a change disagrees with this file, change this file in the same PR or don't- Styled only with quill tokens (`bg-card`, `bg-background`, `text-muted-foreground`, `border-input`, `ring-ring`, `fill-selected`) under a `data-quill` root, never LemonUI tokens such as `bg-surface-primary` or `text-tertiary`.- Built from quill primitives: `InputGroup` (with `InputGroupInput`, `InputGroupAddon`, `InputGroupButton`) for the field, `Button` rows, `MenuLabel` section headers, `Skeleton`, `Kbd`, `ScrollArea`. One combobox input, one listbox, grouped options, wired with `aria-activedescendant`.- Not on quill's `Autocomplete`: Base UI tracks the highlight by index and cannot hold it by item identity (stability rule 5), so the logic owns the highlight.-- Committed filters render inline as text, not as boxed chips: the key in the foreground color, the value in the brand color on a light tint (`is:` **Dashboard**). They still behave as chips (select, remove, edit). There is no × on a chip; ⌫ removes it.+- Committed filters render inline as text, not as boxed chips: the key in the muted color at normal weight, the value in the brand color on a light tint (`is:` **Dashboard**). They still behave as chips (select, remove, edit). There is no × on a chip; ⌫ removes it.- The field has a fixed height. Committing a chip never resizes it; chips that overflow scroll sideways.- One kea logic (`commandKSearchLogic`) owns state, highlight, and orchestration. Components only render and translate events. The rules live in pure modules with unit tests:- `commandKQuery.ts`: tokenizing, cursor context, `resolveQuery` (filters, free text, and the backend search string in one pass), and which edits commit a chip.diff --git a/frontend/src/lib/components/CommandKSearch/CommandKSearchInput.tsx b/frontend/src/lib/components/CommandKSearch/CommandKSearchInput.tsxindex 8adcb72a8bc2..f9a4b3120674 100644--- a/frontend/src/lib/components/CommandKSearch/CommandKSearchInput.tsx+++ b/frontend/src/lib/components/CommandKSearch/CommandKSearchInput.tsx@@ -67,7 +67,7 @@ export function CommandKSearchInput(): JSX.Element {><IconSearch className="size-4 shrink-0" />{chips.map((chip, index) => (- // Committed filters read as typed text: plain key, brand-tinted value.+ // Committed filters read as typed text: muted key, brand-tinted value.<buttonkey={chip.key}type="button"@@ -81,7 +81,7 @@ export function CommandKSearchInput(): JSX.Element {onMouseDown={(event: React.MouseEvent<HTMLButtonElement>) => event.preventDefault()}onClick={() => selectChip(index)}>- <span className="shrink-0">+ <span className="shrink-0 font-normal text-muted-foreground">{chip.negated ? '-' : ''}{chip.key}:</span>