Skip to content

feat(site/src): redesign the workspace filter menu with flyouts and inline options - #29426

Merged
tracyjohnsonux merged 96 commits into
mainfrom
fix/filter-combobox-mouse-interactions
Sep 28, 2026
Merged

tracyjohnsonux merged 96 commits into
mainfrom
fix/filter-combobox-mouse-interactions

Conversation

@tracyjohnsonux

@tracyjohnsonux tracyjohnsonux commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

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).

Implementation notes
  • 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).

Generated by Coder Agents.

tracyjohnsonux and others added 22 commits September 8, 2026 17:17
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.
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.
@jakehwll

Copy link
Copy Markdown
Collaborator
image

This feels odd..

@jakehwll

Copy link
Copy Markdown
Collaborator
image

Icons from attributes aren't there anymore? Seems like we're maintaining two copies of this?

@jakehwll

Copy link
Copy Markdown
Collaborator
image

Using the up arrows I moved away from owner and down to Status is... but this persisted the secondary select menu.

Comment on lines +55 to +56
const CATEGORY_HOVER_DELAY_MS = 300;
const MOBILE_SEARCH_TOP = 80;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An agent needs to attack this harder.. this is ugly and JS should not be defining animations in this way 🙁

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 50134d0. The scrollBy + requestAnimationFrame/setTimeout retries and the visualViewport listeners are gone. While the menu is open on mobile the input group gets fixed inset-x-6 top-20 (below the 72px navbar) and the root reserves the field's height, so the dropdown always has the viewport below the field; Radix keeps anchoring the popper to the fixed field. No JS positioning remains.

Caveat: verified in Chrome device emulation, not on a physical phone with a software keyboard.

Posted by Coder Agents on behalf of @tracyjohnsonux.

…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.
@tracyjohnsonux

Copy link
Copy Markdown
Collaborator Author

Addressed the review findings in 50134d0:

  • Duplicate status: / attribute: panels: inline categories (Status, Workspace attributes) can no longer enter category mode. Typing their prefix narrows the inline group in the main panel to that category (status:runn shows only "Status is… Running") and the prefix is never sent as workspace search text. The second panel, and with it the icon mismatch on the attribute rows, is gone.
  • Owner flyout persisting under keyboard navigation: the pointer flyout now follows the cmdk highlight. Moving the highlight into the inline groups closes it; moving to another category switches it (with the same hover-forgiveness delay).
  • Duplicate rendering paths: the browsing and category-mode main panels were two near-identical components; they are now one MainPanel.
  • Mobile positioning: replaced the timer-driven scrolling with CSS (see inline reply).

Posted by Coder Agents on behalf of @tracyjohnsonux.

…er flyout and hand off only a load row's highlight
@tracyjohnsonux

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR redesigns the workspace filter menu with pointer flyouts, inline Status and Workspace attribute options, and a mobile drill-in. This round finds 2 P3, 4 P4, and 1 Nit in 7fb6d30.

7fb6d30 fixes the five open findings: the flyout search resets per flyout and never reaches another flyout's loader, the highlight handoff reads the previous value instead of a copy, whether a flyout is shown has one source, the flyout's empty result is announced, and the two DOM-presence assertions are gone. Both P3 findings are in the new flyout search code: the debounce compares object identity, and the empty announcement fires while the search is still running.

Out of scope (needs a ticket or explicit acceptance by a human):
site/src/components/Filter/FilterCombobox/useFilterCombobox.ts:208: the category view announces "No matches" for a category with no options and no search while its panel shows "No options" (same at base 08ac54f), so a screen reader user hears that a search found nothing when none was typed.

🤖 This review was automatically generated with Coder Agents.

@tracyjohnsonux

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR redesigns the workspace filter menu with pointer flyouts, inline Status and Workspace attribute options, and a mobile drill-in. This round finds 1 P2 and 6 P4.

9959e75 fixes the seven open findings: the flyout search debounces a trimmed string, a pending flyout search is announced as loading, both panels share one loading, failed, empty order with periods and a no-options text, the menu clears a load-row highlight where it closes, and the doc, helper, and test-time requests are done. The new tests fail against 7fb6d30's code and pass here. The category view's empty announcement noted as out of scope last round is fixed too.

The P2 is in code from earlier commits of this PR, not 9959e75.

Out of scope (needs a ticket or explicit acceptance by a human):

  • site/src/components/Filter/FilterCombobox/useFilterCombobox.ts:433: the category view keys its search on the untrimmed input (same code at base 08ac54f), so a trailing space after zed restarts the search, announces "Loading Owner options." for 300 ms, and then shows a spinner in place of the zed row while it sends a second getOptions("zed "). The flyout trims since 9959e75.

🤖 This review was automatically generated with Coder Agents.

…ptions out while a search is pending

Category rows, loading, empty text, and Enter now derive from the same shown
options, so a previous query's option is never applied. The flyout returns
its own status message and both panels share the empty wording.
@tracyjohnsonux

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR redesigns the workspace filter menu with pointer flyouts, inline Status and Workspace attribute options, and a mobile drill-in. This round finds 1 P3, 5 P4, and 1 Nit.

a46a961 fixes the seven open findings: the category view no longer shows or applies the previous search's rows during the debounce, the flyout returns its own status message, both panels share optionsEmptyText, the optionsStatusMessage doc is corrected, the searched cases have tests, the trailing-space assertion now fails on the regression, and the loader-call assertion runs on a manual clock. The new Enter test fails against 9959e75's code. The category search text is also trimmed now, which fixes last round's out-of-scope item.

The P3 comes from this commit: at 9959e75 a pending search still blocked Enter after a failed one.

Out of scope (needs a ticket or explicit acceptance by a human):

  • site/src/components/Filter/FilterCombobox/useFilterCombobox.ts:1104: in the category view, Enter on typed text such as carol while its search is pending and no loaded option matches does nothing, so the user has to press Enter again after the results arrive; base 08ac54f had the same !activeOptionsLoading guard.

🤖 This review was automatically generated with Coder Agents.

…ch failure only for the settled text

A failed search no longer blocks or skews Enter after the text is edited.
shownOptions takes the failure and only current results, so the flyout,
category view, and typeahead share one rule, and the hook returns the
category view's empty text.
@tracyjohnsonux

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR redesigns the workspace filter menu with pointer flyouts, inline Status and Workspace attribute options, and a mobile drill-in. This round finds 6 P4 and 2 Nit.

772c11c fixes the seven open findings: a failed category search no longer counts while the next search is pending (the new Enter test fails on a46a961's code), shownOptions takes failed and only current results, the category view gets its empty text from the hook, the typeahead rows come from shownOptions, the activeOptionsError comment matches the Enter behavior, the flyout's searchSettled and the category trim each fail a test when removed, and the two getByText assertions are gone.

🤖 This review was automatically generated with Coder Agents.

… hide rows for a failed load

Also covers both empty texts with stories, moves the category loading
check to a manual-clock test, and shares the manual-clock flyout opening.
@tracyjohnsonux

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR redesigns the workspace filter menu with pointer flyouts, inline Status and Workspace attribute options, and a mobile drill-in. This round finds 4 P4.

1e9641c fixes seven of the eight open findings: shownOptions now hides rows for a failed load for all three callers, the story no longer asserts and a manual-clock test checks the category view's loading announcement, the shownOptions doc and flyout comment match the code, the manual-clock flyout opening is shared, the typeahead failed-search test fails when the rule is removed, and HoverFlyoutEmpty shows the flyout's "No options". The new CategorySearchNoMatches story does not reach the category view's searched empty text; see the inline comment.

🤖 This review was automatically generated with Coder Agents.

…ries reach their text and group timer helpers
@tracyjohnsonux

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR redesigns the workspace filter menu with pointer flyouts, inline Status and Workspace attribute options, and a mobile drill-in. This round finds nothing new.

bd10913 fixes the four open findings: SearchableHoverFlyout's loader filters by its query, so CategorySearchNoMatches and SearchableHoverFlyoutNoMatches settle on "No matching options"; HoverFlyoutEmpty spreads CategoryEmptyState; flushTimers sits beside settleTypedText with a comment that matches it, and the clock rule is on the fakeTimers option. No findings from this review remain open.

Twelve out-of-scope items listed in earlier review bodies have no linked ticket; each needs a ticket or explicit acceptance by a human.

🤖 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
Base automatically changed from refactor/filter-combobox-remove-workspace-previews to main September 28, 2026 21:28
tracyjohnsonux added a commit that referenced this pull request Sep 28, 2026
…box (#29874)

## Summary

Removes the "Jump to workspace" previews from the Workspaces filter.
Typing free text no longer lists up to five matching workspaces in the
dropdown that you can click to open.

Typed text still searches workspaces by name: it is committed to the
filter query and narrows the workspace table as before. The dropdown now
only offers filters (categories and matching values), so it stays about
filtering rather than mixing in navigation. It still opens on focus and
while typing. For a name that matches no filter, the dropdown now shows
"No filters found." in place of workspace rows, and the table is still
filtered by the name.

Removes the generic search-result support from `FilterCombobox` as well,
since Workspaces was its only caller: the `getSearchResults`,
`onSearchResultSelect`, and `searchResultsLabel` props, the
`SearchResult` type, the search-results query with its loading and error
handling, and the related stories. Category row previews
(`categoryPreviews`) are unchanged here.

Split out of #29426 so this product change can be reviewed on its own.

Why remove rather than keep: the workspace rows added noise to a
dropdown that should be about filters, and the component has only been
dogfooded internally and has not shipped in a release, so no users lose
a feature they rely on.

---

Generated with Coder Agents on behalf of @tracyjohnsonux.
…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
@tracyjohnsonux
tracyjohnsonux merged commit c1bcd07 into main Sep 28, 2026
27 checks passed
@tracyjohnsonux
tracyjohnsonux deleted the fix/filter-combobox-mouse-interactions branch September 28, 2026 22:37
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants