improvement(tables): make Cmd+F search as you type and clear on close - #6733
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview The find bar now treats Enter / Shift+Enter as match navigation when results match the submitted term; while the typed term is stale or still loading, Enter commits or does nothing instead of stepping through the previous term’s hits. The counter stays mounted with stable width, shows 1 of N (or N+ when truncated), keeps the prior count while loading, and shows a spinner until No results is definitive. All matching cells get a
Reviewed by Cursor Bugbot for commit 4b884db. Configure here. |
Greptile SummaryThe PR makes table find search debounced as users type, highlights all matches, improves counter and navigation states, and clears search state when closed.
Confidence Score: 4/5The PR is not yet safe to merge because a match removed during the final deferred-reveal window can still be selected as a current result. The reply states that the removed-match issue was fixed, but the current code validates the target only before queueing it; a row invalidation can remove it before the later effect selects it without another membership check. Files Needing Attention: apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx | Implements live-search state, navigation, highlighting data, and cursor reconciliation, but deferred reveal still has a post-validation race when its target disappears. |
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-find.tsx | Adds accessible live-search controls, stale-result navigation gating, loading/count states, and clear behavior. |
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/data-row.tsx | Renders per-cell find-match overlays while preserving selection and pinned-cell layering. |
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-find.test.tsx | Covers the find bar's counter, keyboard, clear, and disabled-navigation behavior. |
| apps/sim/hooks/queries/tables.ts | Retains prior results between term keys and reduces garbage-collection time for live-search cache entries. |
Comments Outside Diff (1)
-
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx, line 1300-1302 (link)Deferred reveal accepts removed match
When a same-term row update removes the target after
goToMatchvalidates it but before this deferred effect runs, the effect selects the now-nonmatching cell and marks the cursor as on a result, causing the next navigation to skip the replacement match.Knowledge Base Used: User Tables (
apps/sim/lib/table)
Reviews (12): Last reviewed commit: "fix(tables): skip the reveal when the ta..." | Re-trigger Greptile
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit b5b2a88. Configure here.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a4a71ac. Configure here.
|
Fixed the remaining in-flight-jump issue in 0153cd4: a dedicated effect keyed on the submitted term now bumps the jump sequence, nulls the pending match and drops |
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
1 issue from previous review remains unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 95f578d. Configure here.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7599a53. Configure here.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 62a2297. Configure here.
|
@cursor review |
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4b884db. Configure here.

Summary
Cmd+F in a table had two problems: nothing told you the search only ran on Enter, and closing the bar left the search behind. Reworked it to match what Chrome and Sheets do.
--highlight-match-bgtoken, the same one the knowledge-base search highlight paints with.3 of 12once there are hits, a spinner while the next result set lands,No resultsonly once the search has settled. It holds the previous count mid-typing rather than blanking, and reserves its width so the bar doesn't resize on the first keystroke.Also fixes a pre-existing bug found on the way: closing the bar left the previous term's matches cached as
keepPreviousData, so reopening and pressing Enter on an empty box navigated the old search's hits.Type of Change
Testing
bun run lint:check,bun run check:audits(26 audits), and 1291 table tests pass.Notes for review
Live search makes a few things newly hot; each is handled deliberately:
ensureRowsLoadedUpTopages sequentially, so a selective term whose first hit is 50k rows down would otherwise fire ~50 serial round trips per typing pause. Highlights and the count still cover the whole table; only the viewport jump waits for a deliberate Enter/next-click.Mapso rows without a hit keep a stableundefinedprop and don't re-render;TableFindis memoized.gcTimeadded to the find query, since each typing pause now mints its own cache entry.Checklist