Skip to content

spike(filter-rail): per-option result counts — TailorDB feasibility - #605

Draft
itsprade wants to merge 8 commits into
mainfrom
feat/filter-rail-counts
Draft

itsprade wants to merge 8 commits into
mainfrom
feat/filter-rail-counts

Conversation

@itsprade

Copy link
Copy Markdown
Contributor

Draft / spike, not for merge. Split out of #585, where counts were removed by team agreement (2026-10-13).

Goal: find out whether FilterRail can show "how many rows would this option return" on real TailorDB data.

Questions to answer:

  • Can TailorDB return distinct values for a field (e.g. all colours) without scanning every row?
  • Can it return grouped counts per value, with filters applied?
  • Faceted counts need one aggregate per filtered section, each excluding that section's own filter. Is that query count acceptable, or do we need CDC-maintained cache tables?

What's here: the client-side prototype from #585: counts prop, useFilterRailCounts (in-memory faceting), zero-count disabling, the empty-result hint, and count-based sort.

Outcome: a recommendation (feasible as-is / needs cache tables / not worth it) before counts come back to FilterRail as an optional prop.

🤖 Generated with Claude Code

itsprade and others added 8 commits October 8, 2026 11:22
Promotes the `demo/filter-rail` prototype into packages/core as a public
component. It writes the same CollectionControl a DataTable reads, so there
is no second filter engine.

- Config sections (checkbox, radio, boolean, text, numberRange, date,
  dateRange, custom) + optional compound parts: Root, Header, ClearAll,
  Settings, SavedViews, Sections, Trigger, Sheet.
- Hooks: useFilterRailCounts, useFilterRailLayout, useSavedViews,
  useFilterRailCompact.
- Showcase page /showcase/filter-rail with three variants, docs outline,
  decision record and changeset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ponent-da0c71

# Conflicts:
#	docs-manifest.json
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…veView)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ects

- Narrow screens follow the Sidebar pattern: below lg the rail turns itself
  into a left sheet behind a "Filters" button. New FilterRail.Provider lets
  FilterRail.Trigger sit anywhere (e.g. a table toolbar); with no Trigger,
  Root renders a fallback button. Removes FilterRail.Sheet and the public
  useFilterRailCompact hook (breakpoint check is internal, like useIsMobile).
- Move saved views out to a follow-up (branch feat/filter-rail-saved-views).
- Fix CodeQL prototype pollution: null-prototype count maps, and countOf()
  reads only own keys so an option value like "constructor" counts as 0.
- Replace useEffect prop mirroring in the text and number-range controls with
  render-time reconciliation; debounce text in the change handler, keeping
  keys typed after the input's own commit.
- Number range ignores invalid input and swaps ends typed the wrong way round.
- Value search appears whenever a checkbox list is long enough to truncate.
- Layout hook re-hydrates on key change during render, not in an effect.
- Add type tests for field typing and Root/Provider config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`<Layout fill>` bounded its rows at every width, so below the breakpoint
where columns stack (lg for two, xl for three) every column but the last got
zero height and the next column painted over it. The fill docs already say a
stacked layout scrolls as usual; this makes the code match.

The fill bound now applies only from the breakpoint where columns sit side by
side, and `data-layout-fill` carries that breakpoint (always | lg | xl) so the
AppShell content area clips only while the page is actually bounded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ponent-da0c71

# Conflicts:
#	docs-manifest.json
#	examples/vite-app/src/App.tsx
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