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 autosave on a 250 ms debounced Reviewed by Cursor Bugbot for commit 5a1ffbd. 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)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5a1ffbd. Configure here.
| > | ||
| <Pin className={cn('size-3', defaultState.isDefault && 'fill-current')} /> | ||
| </button> | ||
| )} |
There was a problem hiding this comment.
Disabled pins swallow view selection
Low Severity
The always-on pin overlay sits above the row and stays hit-testable. For the current default and for read-only members the pin is disabled, so those clicks never reach PopoverItem. The old in-row Default label selected the view; the filled pin now no-ops instead.
Reviewed by Cursor Bugbot for commit 5a1ffbd. Configure here.


Summary
This second PR builds on #6724 and completes the table-view control changes. Users can choose which saved view is the default, Columns now uses the same menu typography and icon sizing as Sort, and filters update live after a 250 ms typing delay.
The filter builder is now AND-only and no longer shows Apply or Clear actions. Closing the filter panel or switching views flushes the latest pending edit so autosave does not lose it.
Type of Change
Testing
bun run --cwd apps/sim type-checkChecklist
Screenshots/Videos
Not included. DOM interaction tests cover the changed menus and live-filter behavior.
Post-Deploy Monitoring & Validation