Skip to content

Add FilterBuilder component - #4294

Draft
amcclain wants to merge 14 commits into
developfrom
filter-builder
Draft

Add FilterBuilder component#4294
amcclain wants to merge 14 commits into
developfrom
filter-builder

Conversation

@amcclain

@amcclain amcclain commented Mar 10, 2026

Copy link
Copy Markdown
Member

Summary

  • New FilterBuilder panel component for constructing filters of arbitrary complexity with nested AND/OR groups, NOT negation, type-appropriate value editors, favorites, and persistence.
  • Cross-platform FilterBuilderModel with mutable working tree, apply/cancel workflow, bi-directional Store binding, and favorites support.
  • CompoundFilter not support for negated filter groups (backwards-compatible).
  • Renamed BaseFilterFieldSpecFilterFieldSpec for cleaner class hierarchy.
  • New cmp/filter/README.md documenting both FilterChooser and FilterBuilder.

Companion PR

Test plan

  • Verify FilterBuilder renders with field/operator/value editors for all field types (string, number, date, bool)
  • Test nested AND/OR groups with NOT negation
  • Test apply/cancel workflow (commitOnChange=false) and live sync (commitOnChange=true)
  • Test favorites save/load/delete with localStorage persistence
  • Verify bi-directional sync between FilterBuilder and FilterChooser on same Store
  • Verify empty state placeholder with Add Rule button
  • Run yarn lint && npx tsc --noEmit

🤖 Generated with Claude Code

amcclain and others added 2 commits March 10, 2026 10:27
New panel-based component for constructing filters of arbitrary complexity. Provides a visual query builder UI with nested AND/OR groups, NOT negation, type-appropriate value editors, favorites, persistence, and full integration with Hoist's filter binding system.

Key additions:
- FilterBuilderModel (cross-platform) with mutable working tree, apply/cancel workflow, bi-directional binding, and favorites
- FilterBuilderFieldSpec extending renamed FilterFieldSpec (was BaseFilterFieldSpec)
- Desktop FilterBuilder component with recursive group cards, type-mapped value editors, and favorites menu
- CompoundFilter `not` support for negated filter groups
- cmp/filter/README.md documenting both FilterChooser and FilterBuilder
- CHANGELOG, doc index, doc registry, and roadmap updates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@amcclain

Copy link
Copy Markdown
Member Author
CleanShot 2026-03-10 at 15 23 21@2x

amcclain and others added 12 commits March 11, 2026 06:19
- Simplify `FilterGroupNode.isComplete` (redundant ternary)
- Simplify `fromFilter` op normalization
- Add `@computed` to `FilterRuleNode.isComplete` for proper MobX caching
- Use field spec display names in favorite descriptions, with safe fallback for stale favorites

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Conflict resolutions:
- data/filter/FilterFieldSpec.ts: kept the branch's FilterFieldSpec naming (dropping develop's reintroduced `Base` prefix) while adopting develop's new JSDoc on the config interface.
- CHANGELOG.md: combined both sides' New Features entries under the current 86.0.0-SNAPSHOT heading.
- docs/planning/docs-roadmap-log.md: merged both sides' dated log entries in ascending order.
The 86.0.0-SNAPSHOT entry had two separate `### 🎁 New Features` sections; merged the persistence (`pathPrefix` / `persistOptions()`) bullets into the single New Features section ahead of Bug Fixes, per the standard changelog section order.
Catches the branch up across 202 commits of develop (v86 release through
v87.0.0-SNAPSHOT), including the React 19 upgrade, the pnpm migration, and the
data-layer/column-chooser overhaul.

Conflict resolutions:

- `cmp/grid/filter/GridFilterFieldSpec.ts` - develop kept `BaseFilterFieldSpec`
  while this branch renamed it to `FilterFieldSpec` (planned step 0a). Took
  develop's newer content wholesale - the `GridFilterRenderer` /
  `GridFilterSortValueFn` types, the added `sortValue` config, and the blank
  `tags` filter fix - and re-applied it against the `FilterFieldSpec` name.
  Develop's other changes to the base spec (the `date` -> `localDate` default
  from #3338) came through git's rename detection already.

- `CHANGELOG.md` - moved the `FilterBuilder` and `CompoundFilter` `not` entries
  under the `87.0.0-SNAPSHOT` heading and dropped the stale duplicates this
  branch carried (`CheckboxButton`, `SegmentedControl`, Admin Metrics publish
  controls, `FileChooser`), which have since shipped and are filed under
  released versions on develop. Also converted em dashes in our own entries to
  " - " per docs/changelog-format.md.

Also updated the verification commands in the FilterBuilder PLAN.md from yarn to
pnpm to follow the repo's package-manager migration, and scrubbed a private
client name from a pre-existing docs-roadmap-log entry that the client-name
guard flagged.

Verified: pnpm lint, pnpm typecheck, pnpm lint:mcp, and pnpm audit --prod
--audit-level high all pass. Doc indexes and docs/doc-registry.json reconcile
clean against the merged tree.
Picks up 5 commits: the PatchableRecordSet consolidation into RecordSet, the
data package README rewrite, the new kit/blueprint README, and Inspector
pop-out window support.

Conflict resolutions:

- `data/README.md` - develop's README rewrite dropped our `/cmp/filter/`
  cross-link and added a `/svc/` entry. Kept both.

- `docs/planning/docs-roadmap-log.md` - develop scrubbed the same client name
  we did last merge, with the correct `JobSite` casing. Took develop's version.

Also tightened the `cmp/filter/README.md` keywords in `docs/doc-registry.json`
to follow develop's updated keyword rule in the xh-update-doc-links skill, which
now requires distinctive terms. Dropped `bind`, `commitOnChange`, `AND`, `OR`,
and `NOT` - all generic or owned by another package - in favor of exported
symbols such as `FilterBindTarget`, `FilterValueSource`, and `FilterGroupNode`.

Verified: pnpm lint, pnpm typecheck, and pnpm audit --prod --audit-level high
all pass. Doc registry and inter-doc links reconcile clean.
Picks up 3 commits: Inspector Cube/View tracking with a data-pipeline
Diagnostics panel, a fix for mobile inputs broken by the callback ref handed to
react-onsenui, and removal of the obsolete `PatchableRecordSet` references.

No conflicts. The `PatchableRecordSet` cleanup covers the stale doc-registry
keyword flagged after the last merge.

Verified: pnpm lint, pnpm typecheck, and pnpm audit --prod --audit-level high
all pass. Doc registry and inter-doc links reconcile clean.
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