Skip to content

feat(tables): improve view and filter controls - #6725

Open
j15z wants to merge 2 commits into
feat/better-table-views-uxfrom
feat/table-view-controls
Open

feat(tables): improve view and filter controls#6725
j15z wants to merge 2 commits into
feat/better-table-views-uxfrom
feat/table-view-controls

Conversation

@j15z

@j15z j15z commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

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

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • Focused table-view control, view-state, service, and query-hook suite: 88 tests passed across 8 files.
  • bun run --cwd apps/sim type-check
  • Repository format and lint checks passed for the stack; the final review fix also passed scoped Biome checks.
  • Full app run: 25,462 tests passed. Eleven unrelated tests could not create sandboxed upload files or local listening sockets; the desktop suite could not download Electron in the restricted environment.
  • Review focus: debounce cancellation and flush behavior, single-default cache state, and menu selection without closing the Columns popup.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

Not included. DOM interaction tests cover the changed menus and live-filter behavior.

Post-Deploy Monitoring & Validation

  • For 24 hours, monitor table-view update errors and save-error toasts after filter, column, and default-view interactions.
  • Validate that selecting "Set as default" leaves exactly one default view and that the chosen view opens after returning to the table.
  • Validate that typed filters update after the short delay, remain AND-only, and persist after closing the panel or navigating away.
  • Treat increased table-view update failures, duplicate defaults, or lost filter state as rollback triggers.
  • Owner: Tables feature maintainers. This child PR can be rolled back independently if the new controls regress while the autosave foundation remains healthy.

Compound Engineering

@vercel

vercel Bot commented Aug 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 15, 2026 2:59am

Request Review

@cursor

cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes filter semantics (AND-only, debounced autosave) and default-view cache logic; mistakes could lose filter edits or show stale default state, but scope is table UI and view mutations.

Overview
Completes table view controls: default view is set via per-row pin actions (replacing the "Default" badge), with optimistic cache updates so only one view stays default. Columns and Sort menus now use shared dropdown styling and stay open while toggling options (preventDefault on menu select).

Filters autosave on a 250 ms debounced onChange, are AND-only (OR saved filters normalize on load), and drop explicit Apply/Clear. Closing the filter panel or switching views calls flush() on TableFilter so pending edits persist before navigation.

Reviewed by Cursor Bugbot for commit 5a1ffbd. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx
Comment thread apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx
@greptile-apps

greptile-apps Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR streamlines table view, column, and filter controls, adding a set-default action and debounced filter updates.

  • Migrates the columns picker to the standard dropdown menu.
  • Adds optimistic default-view reconciliation.
  • Replaces explicit filter application and OR controls with automatic AND-only filtering.

Confidence Score: 4/5

The 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

Important Files Changed

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
Loading

Reviews (1): Last reviewed commit: "feat(tables): improve view and filter co..." | Re-trigger Greptile

Comment on lines +66 to +69
const fromFilter = predicateToFilterRules(filter).map((rule) => ({
...rule,
logicalOperator: 'and' as const,
}))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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>
)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5a1ffbd. Configure here.

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