feat(tables): improve view and filter controls - #6725
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Filters move from Apply/Clear to Table page wires filter persistence to the active view, skips Tests cover the new filter, columns, views, sort, and hook behaviors. Reviewed by Cursor Bugbot for commit e4f0403. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThe PR streamlines table view, column, and filter controls, adding a set-default action and debounced filter updates.
Confidence Score: 4/5The PR should not merge until opening an existing OR filter stops silently rewriting and persisting it as AND. The new filter initialization changes supported saved predicate semantics, and the automatic debounce persists that change without user interaction. Files Needing Attention: apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-filter/table-filter.tsx, apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-filter/table-filter.tsx | Adds debounced automatic filtering but silently rewrites loaded OR predicates to AND and triggers persistence on mount. |
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx | Integrates filter flushing, set-default actions, and view persistence; its generic filter persistence makes the mount-time normalization destructive. |
| apps/sim/hooks/queries/tables.ts | Optimistically demotes the previous default when a promoted view response arrives, followed by authoritative invalidation. |
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/columns-menu/columns-menu.tsx | Migrates column visibility controls to the standard dropdown while retaining the existing toggle behavior. |
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/views-menu/views-menu.tsx | Adds an edit-gated set-default action for non-default views. |
Sequence Diagram
sequenceDiagram
participant User
participant Filter as TableFilter
participant Table
participant View as Saved view
User->>Filter: Open saved OR filter
Filter->>Filter: Convert every rule to AND
Filter->>Filter: Debounce 250 ms
Filter->>Table: onChange(AND predicate)
Table->>View: Persist filter config
Reviews (1): Last reviewed commit: "feat(tables): improve view and filter co..." | Re-trigger Greptile
| const fromFilter = predicateToFilterRules(filter).map((rule) => ({ | ||
| ...rule, | ||
| logicalOperator: 'and' as const, | ||
| })) |
There was a problem hiding this comment.
OR filters are silently overwritten
When a saved view contains an any predicate, initialization changes every rule boundary to and, and the mount effect then sends that changed predicate through onChange, causing the displayed rows and persisted view to switch from OR to AND without a user edit.
Knowledge Base Used: User Tables (apps/sim/lib/table)
…onses Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0d65580. Configure here.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Summary
This second PR builds on #6724 and completes the table-view control changes. Users can choose which saved view is a table's default via a pin in the Views menu, the Columns menu uses the same menu typography and icon sizing as Sort and stays open across toggles, and the filter builder applies edits as they are made — there are no Apply or Clear buttons. Dropdown and row changes apply immediately; typed text commits on Enter or when focus leaves the field, and every click-driven exit (closing the panel, switching views, navigating away) blurs the field first, so finishing-by-leaving saves the typed value.
Opening the filter panel never writes anything by itself: the save baseline seeds from the builder's own reading of the stored filter, so a stored filter the builder renders differently (deeply nested groups, wire-only operators, key order) is only rewritten once the user actually edits a rule.
Autosave hardening:
Type of Change
Testing
bun run --cwd apps/sim type-checkand scoped Biome checks.Checklist
Screenshots/Videos
Not included. DOM interaction tests cover the changed menus and filter-commit behavior.
Post-Deploy Monitoring & Validation