Repository navigation
feat(site/src/components/Filter/FilterCombobox): add a Clear all button once three chips are applied - #29876
Conversation
Design review fixes for the unified workspace search and filter: - Show a dotted filter icon on the toggle while any chip is applied. - Render chips as a muted `key:` prefix with a prominent value. - Present Attributes chips as `attribute:<key>` and rename the category key to `attribute` (with `attributes` as an alias) so chips, the draft prefix, and typed prefixes all use the same pattern. - Dropdown rows: 34px tall, 8px horizontal padding, 24px icon slot with 18px lucide icons and 24px avatars, 13px regular text, group headers with 16px above (8px list padding only for the first header). - Use `BuildingIcon` for Organization and `TagIcon` for Attributes. - Result rows inherit the row colour so text and icons highlight together; drop the workspace result subtitle. - Size the chip-row input to its content so an empty input never forces a second row, and match its height to a chip so the box does not change height when the first chip is added. - Prefix the pagination summary with "Filtered:" while a query is set and use "No workspaces match your search." for empty filtered results, with a "Clear all" button in the empty state.
Owner, Status, Attributes, Template, Organization.
Keep Building2Icon for Organization to match the rest of the app, and render the dotted active filter icon at 20px so it reads the same size as the plain 18px icon.
…er/coder into fix/filter-combobox-feedback
Each category row in the filter dropdown now ends with either the labels of its applied chips plus a check mark, or a short sample of its options (templates and organizations are pulled from the deployment). Categories can provide a hint shown while options load.
Clicking the filter toggle, or pressing Backspace on an empty input, while a category is open returns to the category list instead of closing the menu.
…ate and drop mobile scroll timers Inline categories such as Status and Workspace attributes no longer enter category mode when their prefix is typed; the prefix narrows the inline group in place, so no duplicate flyout renders. The pointer flyout now follows the cmdk highlight, closing or switching when keyboard navigation moves on. The browsing and category main panels share one renderer. On mobile the open field pins below the navbar with CSS instead of timer-driven scrolling.
… highlighted after leaving it Returning from a category with ArrowLeft or by picking an option left cmdk pointing at an unmounted option row, so nothing in the menu looked focused. The highlighted row is now controlled state owned by the hook and is set back to the parent category on return. This also replaces the highlight reset counter with the controlled value and drops memoization around cheap derived lists.
…eedback # Conflicts: # site/src/pages/WorkspacesPage/filter/WorkspacesFilter.stories.tsx # site/src/pages/WorkspacesPage/filter/WorkspacesFilter.tsx
…mouse-interactions # Conflicts: # site/src/components/Filter/FilterCombobox/primitives.tsx # site/src/pages/WorkspacesPage/WorkspacesPage.stories.tsx # site/src/pages/WorkspacesPage/WorkspacesPage.tsx # site/src/pages/WorkspacesPage/filter/WorkspacesFilter.stories.tsx # site/src/pages/WorkspacesPage/filter/WorkspacesFilter.tsx
Replaces the separate User category with a switch in the Owner list footer. While on, picking a user commits user:<name>, which also matches workspaces shared with them, and the chip reads owner: <name> +shared. Flipping the switch rewrites an applied Owner chip in place. The Shared attribute option is removed in favor of the toggle. Clicking the already focused input reopens a dismissed menu, and a dismissed flyout no longer reappears on reopen.
The toggle is on by default. While on, the search field shows a removable include shared pill instead of a chip suffix, and removing it narrows the applied Owner chip. Applied chips always render in lowercase regardless of the option label shown in the menu.
…ries reach their text and group timer helpers
…r-combobox-hide-single-option # Conflicts: # site/src/components/Filter/FilterCombobox/FilterCombobox.test.tsx
|
/coder-agents-review |
There was a problem hiding this comment.
This round covers the base merge at 110ff08; there is no PR commit since the previous review, and the PR's changed lines are unchanged. Findings: 1 Nit, from the merged base's new test helper.
The PR's tests pass against the merged base: all 134 tests in FilterCombobox.test.tsx pass at 110ff08, and the Clear all lookup test still fails when clearAll keeps the typed-text lookup.
🤖 This review was automatically generated with Coder Agents.
…he Clear all test
|
/coder-agents-review |
There was a problem hiding this comment.
This round covers 219e83e, which uses flushTimers() in the Clear all lookup test. No new findings.
The fix is in place: flushTimers at line 74 is the same act(() => vi.advanceTimersByTimeAsync(0)) call, it is now the only copy in the file, and the lookup test still fails when clearAll keeps the typed-text lookup. All 134 tests in FilterCombobox.test.tsx pass at 219e83e. Every inline finding from earlier rounds is addressed.
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
There was a problem hiding this comment.
No commits since the previous review; this round re-reviews 219e83e. No new findings.
All 134 tests in FilterCombobox.test.tsx pass at 219e83e, tsc --noEmit and biome check are clean, and CI now passes. Every inline finding from earlier rounds is addressed.
🤖 This review was automatically generated with Coder Agents.
|
/coder-agents-review |
There was a problem hiding this comment.
No commits since the previous review; this round re-reviews 219e83e. No new findings.
All 134 tests in FilterCombobox.test.tsx pass at 219e83e, tsc --noEmit and biome check are clean, and CI passes. Every inline finding from earlier rounds is addressed.
🤖 This review was automatically generated with Coder Agents.
…box-remove-workspace-previews # Conflicts: # site/src/components/Filter/FilterCombobox/FilterCombobox.tsx # site/src/components/Filter/FilterCombobox/types.ts # site/src/pages/WorkspacesPage/filter/WorkspacesFilter.tsx
…workspace-previews' into fix/filter-combobox-mouse-interactions # Conflicts: # site/src/components/Filter/FilterCombobox/FilterCombobox.tsx # site/src/components/Filter/FilterCombobox/primitives.tsx # site/src/components/Filter/FilterCombobox/useFilterCombobox.ts
…r-combobox-hide-single-option
…-option' into feat/filter-combobox-clear-all # Conflicts: # site/src/components/Filter/FilterCombobox/primitives.tsx
…ouse-interactions # Conflicts: # site/src/components/Filter/FilterCombobox/FilterCombobox.stories.tsx # site/src/components/Filter/FilterCombobox/FilterCombobox.tsx # site/src/components/Filter/FilterCombobox/queries.ts # site/src/components/Filter/FilterCombobox/types.ts # site/src/components/Filter/FilterCombobox/useFilterCombobox.ts
…ptions as buttons
…nline options (#29426) ## Summary Improves mouse and touch interactions for the workspace FilterCombobox while preserving its keyboard navigation. The filter control (icon only) now opens a compact main menu with inline status and workspace-state options, pointer flyouts for Owner, User, Template, and Organizations, and a single-panel mobile flow. Applied chips always render lowercase. Selected workspace attributes remain single-select to match the existing workspace filtering UI. Stacked on #29874 (removes the workspace result previews). Follows #29111, which has merged. Split out and stacked on this PR: #29875 (hide single-option categories), #29876 (Clear all), and #29872 (Owner shared workspaces toggle). <details> <summary>Implementation notes</summary> - Keeps Up/Down, ArrowRight, ArrowLeft, Backspace, Escape, and Tab keyboard behavior. Free-typed text no longer highlights the first row: Enter applies it as a search and closes the menu, while arrow keys, Home/End, cmdk's Ctrl+N/J/P/K, or the pointer pick a filter row. Tab still completes the top row, and a typed `key:` prefix, the category view, and the all-filters list keep the first match highlighted. - Enter activates any focused button in the combobox (Filters, flyout options, Retry, chip remove) through one `FilterComboboxRoot` handler. - The menu's height is bounded only by the viewport, so it scrolls only when it cannot fit. - Uses right-opening pointer flyouts with hover forgiveness and searchable, scrollable long lists. The flyout follows the cmdk highlight, so keyboard navigation closes or switches it, and it resets whenever the menu opens or closes. - Inline categories (Status, Workspace attributes) never enter category mode; a typed `status:` prefix narrows the inline group in place and is withheld from the workspace search query. A failed inline load shows its error and Retry under the category heading, since inline categories have no flyout. - Browsing and category mode share one main-panel renderer. - Uses a persistent full-width mobile panel with touch scrolling. While open on mobile the field pins below the navbar with CSS (`fixed`), with no JS scroll positioning. Verified in Chrome device emulation, not yet on a physical device with a software keyboard. - Keeps free-text workspace searches separate from matching filter-option text, including text typed before a `status:` prefix. Typed text that could still match a filter (a category name, a loaded option, or an option the category's search returns) is held back from the workspace search, so results do not empty out mid-word. It is applied when no lookup finds a match (a failed lookup counts as no match, and the wait stops after 1s), on Enter, or when the menu is dismissed or switched to all filters. The menu shows no separate cue for held-back text; the author (@tracyjohnsonux) decided this, and also rejected a `Search workspaces for "..."` row. That is why Enter-search is built by suppressing cmdk's automatic first-row highlight (`userNavigatingRef` and the `""`/`" "` reset in `FilterComboboxRoot`) rather than by rendering a search row. Chip tokens in the typed text become chips when it is applied. - While typed text is debounced, loaded options are filtered locally so matching rows stay visible until the loader's results arrive. - Enter or Tab on an applied option that typed text located keeps it and clears the text. Clicking a checked row removes it. - Enter commits a typed inline value that is not a suggestion, such as `status:starting`. - Flyout searches go through the category loader, so owners beyond the first page are found. The search field stays mounted while results load, shrink, or are empty. - Clicking a category row narrowed by typed text enters the category, and focus returns to the input after picking a flyout option. - Keeps selected options visible with Coder-standard checkmarks and styling. - `FilterCategory.chipLabelOnly` marks categories whose chips show only the option label (Workspace attributes). Inline options load up front so those chips are labelled before the menu is first opened. - Pointer flyouts and category lists share one `OptionsPanel` shell (search header, list, empty state). </details> Generated by Coder Agents. --------- Co-authored-by: Jake Howell <jacob@coder.com> Co-authored-by: Jake Howell <jake@hwll.me>
…hide-single-option # Conflicts: # site/src/components/Filter/FilterCombobox/FilterCombobox.stories.tsx # site/src/components/Filter/FilterCombobox/FilterCombobox.test.tsx # site/src/components/Filter/FilterCombobox/FilterCombobox.tsx # site/src/components/Filter/FilterCombobox/primitives.tsx # site/src/components/Filter/FilterCombobox/types.ts # site/src/components/Filter/FilterCombobox/useFilterCombobox.ts
…clear-all # Conflicts: # site/src/components/Filter/FilterCombobox/FilterCombobox.stories.tsx # site/src/components/Filter/FilterCombobox/FilterCombobox.tsx # site/src/components/Filter/FilterCombobox/useFilterCombobox.ts
Summary
Adds a Clear all button to the chip row once three or more chips are applied. It sits after the search input, wraps with the chips, and shares their height through
chipRowItemHeightClassName, so the two cannot drift apart.Clear all empties the whole query, chips and search text alike, so
owner:alice status:running outdated:true devbecomes empty. It matches the Workspaces empty state's Clear all, and it also removes the defaultowner:me. It is a real button. While the menu is open, Tab from the search input completes the highlighted row, so keyboard users reach Clear all with Escape and then Tab. Enter works through theFilterComboboxRoothandler that turns Enter into a click for any focused button in the combobox. Activating Clear all while it has focus, by keyboard or mouse, moves focus to the search input; a mouse click without focus leaves focus where it was, except that on wider viewports it moves focus to the search input while a category is open, because Clear all closes the category's search field.Any emitted query that drops the highlighted category row from the menu, such as Clear all or removing the chip that kept a single-option Template listed (remove button or Backspace), moves the highlight to the first row that stays, so Enter after reopening the menu still opens a category. A
valuechange from the caller that drops the highlighted row, such as the Workspaces empty state's Clear all, is repaired when the input gains focus or Filters opens the menu.Stacked on #29875, split out of #29426 so it can be reviewed on its own.
Generated with Coder Agents on behalf of @tracyjohnsonux.