feat(tables): saved views with filter, sort, and column presets - #5961
feat(tables): saved views with filter, sort, and column presets#5961TheodoreSpeaks wants to merge 15 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview The table detail UI gains a Views dropdown (create/rename/delete, URL Rollout is gated by the Reviewed by Cursor Bugbot for commit da8a17a. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR adds feature-flagged table saved views.
Confidence Score: 3/5The PR is not yet safe to merge because saved layouts can still be captured stale and undo or redo can persist layout into the wrong storage scope. A new view can copy lagging Files Needing Attention: apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx, apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx, apps/sim/hooks/use-table-undo.ts
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx | Coordinates saved-view state and persistence, but the prior layout-capture issue remains reachable while a layout patch is in flight. |
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx | Adds view-owned layout seeding and persistence routing, while the previously reported undo bypass remains unresolved. |
| apps/sim/hooks/use-table-undo.ts | Undo and redo continue to write layout fields through the shared table-metadata mutation. |
| apps/sim/lib/table/views/service.ts | Implements validated view persistence and server-side JSONB patch merging for independently owned config fields. |
| packages/db/migrations/0271_table_views.sql | Adds the table_views persistence table and supporting constraints and indexes. |
Sequence Diagram
sequenceDiagram
participant User
participant Table as Table UI
participant API as View API
participant DB as table_views
User->>Table: Select or edit saved view
Table->>API: Create or patch view config
API->>DB: Persist config
DB-->>API: Return saved view
API-->>Table: Refresh active view
Table-->>User: Apply filter, sort, visibility, and layout
Reviews (11): Last reviewed commit: "fix(tables): guard default demotion, use..." | Re-trigger Greptile
|
@cursor review |
|
@cursor review |
|
@cursor review |
|
@cursor review |
# Conflicts: # apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx # apps/sim/app/workspace/[workspaceId]/tables/[tableId]/page.tsx # apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx # apps/sim/lib/core/config/env.ts # apps/sim/lib/core/config/feature-flags.ts # packages/db/migrations/meta/0270_snapshot.json # packages/db/migrations/meta/_journal.json
|
@cursor review |
|
@cursor review |
|
@cursor review |
|
@cursor review |
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 da8a17a. Configure here.
| seededViewIdRef.current = null | ||
| setTableParams({ view: ALL_VIEW_PARAM }) | ||
| applyViewConfig(null) | ||
| return |
There was a problem hiding this comment.
Deleted view leaves filter stuck
High Severity
The view resolution effect has an early return condition (seededViewIdRef.current === activeViewId) meant for view creation. This condition also triggers when the active view is deleted externally, preventing cleanup. As a result, the filter, sort, and hidden column states from the deleted view remain applied, while the ViewsMenu incorrectly shows "All".
Reviewed by Cursor Bugbot for commit da8a17a. Configure here.


Summary
Columnsmenu to show/hide columns, with workflow outputs nested under their group (hiding all of a group's children drops its spanning header)table_viewstable; "All" is the absence of a view, so no backfill and the table is always reachable unfilteredtable-viewsfeature flag (UI only — routes and migration ship ungated so a view saved during rollout survives the flag being turned off)Type of Change
Testing
Tested manually.
bun run type-check,bun run lint, all 11 CI audits, andcheck:migrations origin/stagingpass. 29 unit tests across the views service, API contracts, and feature flags.Checklist