fix: persist column widths in search results table#2327
Conversation
Column widths now survive page refresh. Scoped per saved search (db-search-saved-<id>) when one is loaded, else per source for ad-hoc searches (db-search-source-<id>). Stored in localStorage. The persistence machinery already existed in RawLogTable but was gated on a tableId prop that no caller in the search-page chain was passing, so columnSizing fell back to TanStack Table's in-memory state and reset on every mount. This wires tableId through DBSqlRowTable and DBSqlRowTableWithSideBar and derives a stable key in DBSearchPage. The "Reset Column Widths" header button and wrap-lines persistence (same root cause) now work in the search view too.
🦋 Changeset detectedLatest commit: 448d2cf The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
E2E Test Results✅ All tests passed • 179 passed • 3 skipped • 1243s
Tests ran across 4 shards in parallel. |
| context={rowTableContext} | ||
| config={dbSqlRowTableConfig} | ||
| sourceId={searchedConfig.source} | ||
| tableId={columnSizeTableId} |
There was a problem hiding this comment.
all the plumbing was already there, we just lacked the tableid
Deep Review✅ No critical issues found. 🟡 P2 -- recommended
🔵 P3 nitpicks (4)
Reviewers (6): correctness, testing, maintainability, project-standards, kieran-typescript, julik-frontend-races. Testing gaps:
|
Summary
Column widths in the search results table now survive page refresh and session restarts. Scoped per saved search (
db-search-saved-<id>) when one is loaded, otherwise per source (db-search-source-<id>) for ad-hoc searches; persisted inlocalStorage, no backend changes.The persistence machinery already existed in
RawLogTablebut was gated on atableIdprop that no caller in the search-page chain was passing, socolumnSizingfell back to TanStack Table's in-memory state and reset on every mount. This wirestableIdthroughDBSqlRowTableandDBSqlRowTableWithSideBarand derives a stable key inDBSearchPage. As a side benefit, the "Reset Column Widths" header button andwrap-linespersistence (same root cause) now work in the search view too.Screenshots or video
UI is unchanged at rest — the only newly-visible affordance is the existing "Reset Column Widths" button in the table header, which now appears once a column has been resized.
How to test on Vercel preview
Preview routes: /search
Steps:
/searchand wait for the results table to render.Timestampcolumn header to shrink it to roughly half its starting width.Timestampcolumn header retains the resized width (does not snap back to the default ~170px).References
Ref: HDX-4322