Skip to content

feat(site/src): use the unified filter combobox on the users page - #29809

Merged
aqandrew merged 70 commits into
mainfrom
tracy/users-filter-combobox
Nov 9, 2026
Merged

aqandrew merged 70 commits into
mainfrom
tracy/users-filter-combobox

Conversation

@tracyjohnsonux

@tracyjohnsonux tracyjohnsonux commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Replaces the users page filter with the unified FilterCombobox search (merged in #29426), with a separate date picker for last seen.

  • Search: Status (Active, Dormant, Suspended), Role, and User type (a single Service account option; unselected matches everyone). Free text still searches name, username, and email.
  • Last seen: a separate DateTimeRangePicker with All time (default, so every user is listed), last 24 hours, last 7 days, over 30 days, and over 90 days, plus a custom range. The "Over" presets send a range from the Unix epoch to N days ago, so users who have never signed in (zero last seen time) are excluded. Presets are stored in filter as relative values (for example last_seen_after:-7d), so reloads keep the label and shared links stay relative. The query key keeps the relative values and each fetch resolves them to timestamps, since the API only accepts RFC 3339. Custom ranges are stored as timestamps. The trigger shows "Last seen" as secondary placeholder text until a timeframe is picked, and its accessible name keeps that context afterwards ("Last seen: Last 7 days").
  • The range shares the filter query string with the search but is split out and merged back on every change, so neither the range nor the free-text search is dropped when the other changes. This follows the pattern from feat(site): use the unified filter combobox on the AI sessions page #29120.
  • DateTimeRangePicker gains optional placeholder (preset, shown in content-secondary while no range is applied) and label props. Existing callers are unchanged.
  • useStatusFilterMenu is removed from the shared UsersFilter; the users page was its only consumer. Groups and organization members pages still use UsersFilter unchanged.

Frontend only. The existing users search already supports status, role, service_account, last_seen_after, and last_seen_before.

Decision log
  • Last seen, not created: confirmed as the timestamp the picker represents.
  • All time as a preset: the picker has no empty state, so All time is a preset whose range is display-only; picking it removes both last_seen_* keys instead of sending a range.
  • User type chips are label only: the category uses chipLabelOnly, so the applied chip reads service account.
  • One User type option: only "Service account" is offered; unselected means all users. A separate "Users" option was dropped for simplicity.
  • Relative values in filter, not a separate last_seen param: keeps paginatedUsers unchanged and the URL filter as the single source of the users query (review feedback from @jeremyruppel and @DanielleMaywood). Resolving in queryFn rather than queryPayload keeps the query key stable without a now anchor.
  • Backend check: verified searchquery.Users parses a combined query with quoted RFC3339 last_seen_* values, status, and free text.

Verification: pnpm lint:types, pnpm check, pnpm lint; Vitest for the users, groups, organization members, and AI Gateway pages and the date picker; Storybook tests for the users page, date picker, and AI sessions list (new FilteredByStatusRoleAndType and LastSeenRange stories).


Generated by Coder Agents on behalf of @tracyjohnsonux.

tracyjohnsonux and others added 30 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.
…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.
@aqandrew
aqandrew marked this pull request as ready for review October 13, 2026 04:51
@github-actions github-actions Bot added the stale This issue is like stale bread. label Oct 26, 2026
@aqandrew
aqandrew requested a review from jeremyruppel October 31, 2026 00:40
@github-actions github-actions Bot removed the stale This issue is like stale bread. label Nov 1, 2026
@tracyjohnsonux

Copy link
Copy Markdown
Collaborator Author

How goes this one? @aqandrew @jeremyruppel the pr shaming bot is t happy with me 😂

@jeremyruppel jeremyruppel left a comment

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.

only nits left, please don't block merge. checked this out in storybook, Works As Intended™ 👍

@aqandrew
aqandrew temporarily deployed to main November 9, 2026 19:38 — with GitHub Actions Inactive
@aqandrew
aqandrew temporarily deployed to main November 9, 2026 19:45 — with GitHub Actions Inactive
…mbobox

# Conflicts:
#	site/src/pages/WorkspacesPage/filter/categoryOptions.tsx
@aqandrew
aqandrew temporarily deployed to main November 9, 2026 19:51 — with GitHub Actions Inactive
@aqandrew
aqandrew merged commit f776c02 into main Nov 9, 2026
27 of 28 checks passed
@aqandrew
aqandrew deleted the tracy/users-filter-combobox branch November 9, 2026 20:05
@aqandrew
aqandrew temporarily deployed to main November 9, 2026 20:05 — with GitHub Actions Inactive
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 9, 2026

This branch was previously deployed

1 inactive deployment
main — 9d845b12 Deployed Nov 9, 2026 by aqandrew via cla #252749
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.

5 participants