Skip to content

feat(data-table): redesign Filters — menu-driven add flow + segmented chips#385

Draft
itsprade wants to merge 1 commit into
mainfrom
feat/data-table-filter-redesign
Draft

feat(data-table): redesign Filters — menu-driven add flow + segmented chips#385
itsprade wants to merge 1 commit into
mainfrom
feat/data-table-filter-redesign

Conversation

@itsprade

@itsprade itsprade commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Redesigns DataTable.Filters for a faster, more direct filtering experience. The old flow — an "Add filter" popover with nested Selects, plus single-button chips that opened a popover with an operator select + Apply — is replaced with a menu-driven add flow and segmented filter chips.

Closes #1509.

CleanShot 2026-07-15 at 18 02 25@2x

What changed

Add-filter menu

  • Replaces the popover + nested selects with a Menu flyout. Every filterable field is visible the moment you open it; hovering a field reveals a type-specific editor as a submenu — no more dropdown-inside-a-dropdown.
  • Fields where the operator matters get a condition stepfield ▸ condition ▸ value (three nested popups) — so you can choose greater than / between / before while adding. Other fields go straight to the value with a sensible default operator.
  • The menu stays open until you click outside (add several filters in a row), and its position is pinned so adding a chip doesn't make it jump.

Segmented filter chips

  • Each active filter now renders as field │ operator │ value │ ✕.
  • The operator segment opens a searchable dropdown to switch the condition on the fly.
  • The value segment opens the type-specific editor (with an Apply button; between shows a min/max range).

New API — FilterConfig.chooseOperator?: boolean

  • Opts a field in/out of the add-flow condition step.
  • Defaults: true for number / date / datetime / time; false for string / enum / boolean / uuid. Additive and backward-compatible.
  • The chip always lets you change the operator afterward, regardless of this flag.

Polish & consistency

  • Friendlier operator labels: is, is not, is between, is any of, is none of; date-specific exact date / after / before.
  • Multi-select enum values summarized as "N items" (e.g. "2 statuses") instead of a long comma list; compact date ranges (e.g. "15 Jul 2026 – 17 Jul 2026").
  • Extracted shared FilterCheckbox + EnumOptionList so the primary-colored checkbox is identical across the add menu, the chip value editor, and the case-sensitive toggle.
  • Menu.Content gains position.trackAnchor (via the shared PositionProps) to pin a menu when opening it shifts the trigger.

Testing & quality

  • pnpm type-check — clean
  • pnpm lint — 0 warnings / 0 errors
  • pnpm test1325 passed (72 files); toolbar.test.tsx rewritten for the new segmented-chip + menu structure with equivalent coverage (Apply/Enter commits, clear→remove, case-sensitivity, live enum toggle, boolean, numeric/temporal single + between, date operator relabeling, legacy-operator preservation, remove button) plus new coverage for the enum count summary and date-range display.
  • pnpm build — clean (incl. .d.ts generation)
  • Changeset added (minor).
  • Manually verified in the Vite example preview: menu add flow, condition step, segmented chips, searchable operator dropdown, and consistent checkboxes.

Follow-ups (intentionally out of scope)

  • Stage 2 — field & option icons/avatars: rendering field glyphs, status dots, and assignee avatars (like Linear) needs additive public-API fields (Column.icon, SelectOption.icon/avatar) and is deferred to a separate PR.
  • A tighter same-month date-range collapse ("Jul 15 – 17, 2026") was dropped for now because partial Intl date parts render inconsistently across locales; current output shows both full dates.

🤖 Generated with Claude Code

… chips

- Replace the add-filter popover (nested selects) with a Menu flyout: all
  filterable fields visible on open; number/date/time fields get a condition
  step (field ▸ condition ▸ value), others go straight to value.
- Segmented filter chips: field │ operator │ value │ ✕, with a searchable
  operator dropdown on the operator segment.
- Add `FilterConfig.chooseOperator` (defaults true for number/date/datetime/time,
  false otherwise) to opt a field in/out of the condition step.
- Friendlier operator labels (is / is not / is between / is any of …),
  enum multi-select summarized as "N items", compact date ranges.
- Extract shared `FilterCheckbox` + `EnumOptionList` for a consistent
  primary-colored checkbox across all filter surfaces.
- `Menu.Content` gains `position.trackAnchor` to pin the menu when opening it
  shifts the trigger.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant