Repository navigation
refactor(grid): break the results grid into pieces that fit in a head (#406) - #634
Merged
Merged
Conversation
ResultsGrid held the column order, the filters, the row count, the row key, the selection, the copy formats, the export handlers, the keyboard shortcuts, the context menu, the save handler, the column definitions, four placeholder states and two render paths — 1452 lines by the time the results backlog was through with it (#406). It is now 472 lines of orchestration. What came out: useColumnLayout column order, persistence, display order useColumnFilters filter state, and the shape TanStack wants useRowCount the free estimate and the exact count useRowSelection click, Ctrl, Shift, Ctrl+A useGridShortcuts undo, redo, set NULL useGridColumns one TanStack column def per result column useGridContextMenu what right-clicking a row offers useGridExport clipboard and file useGridSave pending edits to statements to one transaction GridHeaderRow every header, for both layouts GridRows the rows, for both layouts GridFooter where you are, what is narrowing, how to get out GridBanners truncation and server warnings GridPlaceholder running, failed, count-only, nothing yet The header and the rows are the point. Each existed twice — once for the virtualized path above 5000 rows, once for the plain table below it — and the copies had drifted, so anything added to one silently went missing in the other, in the half nobody looks at. Splitting found a real bug. `useColumnLayout` keyed its effect on the columns array, so a caller building that list inline would reset the order, re-render, and do it again forever. ResultsGrid passes a stable array and never hit it; the first test that did hung the worker for eighty seconds. It now keys on the names, which compare by value. Behaviour is unchanged: 2425 unit and 340 browser tests pass throughout, and the new hooks bring 16 of their own — none of which need the grid rendered. Co-Authored-By: Claude Opus 5 <[email protected]>
EVWorth
force-pushed
the
refactor/results-grid-split
branch
from
September 11, 2026 05:37
647ba07 to
e72f4de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #633.
ResultsGridheld the column order, the filters, the row count, the row key, the selection, the copy formats, the export handlers, the keyboard shortcuts, the context menu, the save handler, the column definitions, four placeholder states and two render paths — 1452 lines by the time the results backlog was through with it.It's now 472 lines of orchestration.
useColumnLayoutuseColumnFiltersuseRowCountuseRowSelectionuseGridShortcutsuseGridColumnsuseGridContextMenuuseGridExportuseGridSaveGridHeaderRowGridRowsGridFooterGridBannersGridPlaceholderThe header and the rows are the point. Each existed twice — once for the virtualized path above 5000 rows, once for the plain table below it — and the copies had drifted, so anything added to one silently went missing in the other, in the half nobody looks at.
Splitting found a real bug
useColumnLayoutkeyed its effect on the columns array, so a caller building that list inline would reset the order, re-render, and do it again forever.ResultsGridpasses a stable array and never hit it; the first test that did hung the worker for eighty seconds. It now keys on the names, which compare by value — with a regression test.On the acceptance criterion
The issue asks for ≤250 LOC. This lands at 472. What's left is the hook wiring and the table skeleton itself; pushing further would mean a
useEverythinghook or components taking twenty props, which trades a long file for indirection without making anything easier to follow. Happy to go further if you disagree.Behaviour is unchanged: 2425 unit and 340 browser tests pass throughout, and the new hooks bring 16 of their own — none of which need the grid rendered.
Closes #406
🤖 Generated with Claude Code