Skip to content

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

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

feat(tables): improve view and filter controls#6725
j15z wants to merge 6 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 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:

  • An autosave response settling no longer remounts an open filter panel (wiping keystrokes and focus); reapplying a view config with identical content is skipped.
  • "Filter by cell value" saves the narrowed filter to the view; previously the gesture applied it to the grid without persisting it.
  • A stale update-view response can no longer demote the current default in the cache; the demotion shares the promoted row's updatedAt staleness guard.
  • isNull/isNotNull filter conditions round-trip through the builder instead of being dropped on the next save.

Type of Change

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

Testing

  • Focused suites for the changed surfaces: 44 tests across the filter panel, views menu, columns menu, sort dropdown, and view-mutation hooks — covering commit-on-Enter/blur, opening a saved filter writing nothing (including OR and isNull shapes), stale promotion responses leaving the default untouched, and the disabled default pin staying inert.
  • bun run --cwd apps/sim type-check and scoped Biome checks.
  • Review focus: field-commit semantics, autosave reapply behavior while the panel is open, single-default cache state, and menu selection without closing the menus.

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 filter-commit 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 apply on Enter or when focus leaves the field, persist after closing the panel or navigating away, and that opening a saved view's filter panel writes nothing on its own.
  • 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
Claude Code

@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 17, 2026 7:14pm

Request Review

@cursor

cursor Bot commented Aug 15, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes touch live filter persistence, view default promotion, and filter round-trip edge cases—user-visible data and view state can regress if signature or cache logic is wrong, but scope is limited to table UI and view mutations.

Overview
Table view controls get pin-as-default in the views menu (filled/outline pin icons, menu stays open), Columns switched from popover to dropdown with Sort-aligned styling, and Sort dropdown items that no longer close on clear or direction change.

Filters move from Apply/Clear to onChange autosave: value fields buffer locally and commit on Enter/blur; rule changes apply via a signature guard so opening the panel does not rewrite saved OR/isNull trees until the user edits. Apply/Clear UI is removed; removing the last rule clears the filter immediately.

Table page wires filter persistence to the active view, skips replaceFilter when the incoming predicate matches the current one (avoids remount/focus loss on autosave echo), and explicitly persists filter by cell value. View mutation cache optimistically demotes the previous default and ignores stale promotion responses that would leave no default.

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.

Comment thread apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx
Comment thread apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx Outdated
@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)

j15z and others added 3 commits August 15, 2026 19:47
…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>

@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.

There are 2 total unresolved issues (including 1 from previous review).

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 0d65580. Configure here.

Comment thread apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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