Repository navigation
feat(app): double-click a column's resize handle to fit it in table charts - #3885
alex-fedotyev wants to merge 4 commits into
Conversation
Double-clicking a column's resize handle on a dashboard table tile, or on the chart explorer's table, fits the column to its content as in search results. The fitted width stays in the table's own state, like a dragged one. The last data column already fills the tile and has no handle. Both tables now share fitColumn, which measures, caps and sets the width. The measuring copies set their styles as important: tile cells that link somewhere carry Bootstrap's w-100 (width: 100% !important), which beat the copy's inline width and made a fit measure the whole table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: fb0d118 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 |
🔵 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
|
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
PR Review✅ No issues found. |
The column fit e2e asserted on a value read with getAttribute(), which the playwright/prefer-web-first-assertions rule rejects in CI lint. It now waits on toHaveAttribute() before reading the id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
E2E Test Results❌ 1 test failed • 488 passed • 1 skipped • 1108s
Tests ran across 4 shards in parallel. |
Deep Review✅ No critical issues found. This is a tightly scoped, well-tested UI change. Correctness review traced the 🔵 P3 nitpicks (5)
Reviewers (7): correctness, testing, maintainability, project-standards, kieran-typescript, julik-frontend-races, previous-comments. Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
A unit test now fails if the measuring copy's styles stop being important, which the jsdom layout mock couldn't catch before. The tile fit test also checks that the fitted width isn't saved, and the tile's fit notes why it has no last-column case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review findings, in e325c88:
|
Summary
The double-click that fits a search results column to its content now works in table charts too: the Table view in Chart Explorer, and Table tiles on dashboards.
Double-click the handle at the right edge of a column header, and the column shrinks or grows to fit its widest value on screen, the same as in search results.
The group-by column is the last column by default, so to fit a text column like ServiceName, turn on Display Group By Columns on Left in Display Settings.
Screenshots or video
Chart Explorer, a count grouped by ServiceName with the group-by column on the left, after double-clicking the handle on the ServiceName header. On
mainnothing changes and the column stays 385px wide. On this branch it fits the longest name, "artillery-loadgen", at 141px.main)How to reproduce
Starting point: the Vercel preview on this PR, or
yarn app:dev:local→ onboarding → "Connect to Demo Server".On
main:ServiceName.On this branch:
How to test on Vercel preview
Preview routes: /chart
Steps:
data-testid="chart-type-input").ServiceNameinto the Group By editor, then click the run button (data-testid="chart-run-query-button").data-testid="column-resize-handle") at the right edge of the "count()" column header.How it works
Table charts are drawn by
HDXMultiSeriesTableChart, which already used the search table's column header and resize handle. This connects the handle's double-click tofitColumn, a helper the search table now shares, which measures the column, caps the width and sets it the way a drag does.It also fixes a measuring bug that only table charts hit. Rows with a click action render their cells as links with Bootstrap's
w-100, which iswidth: 100% !important. That overrode the width of the copy used for measuring, so a fit measured the whole table and jumped to the cap. The copy's styles are now!importantas well, and an inline!importantwins over a stylesheet one.Test plan
yarn lint,yarn tsc --noEmitinpackages/app, andyarn knipcolumnFit.test.tscoversfitColumnand the!importantstyles, each failing with its fix reverted.chart-explorer.spec.tsnarrows a column wider than its values and widens it back after a squeeze. It fails without the double-click wired, and it caught thew-100bug.column-fit.spec.ts) still passes with the search table on the shared helper.References
[ui-states: allow] Only column widths change. The table's empty, loading and error states are unchanged.
Note
Low Risk
UI-only column sizing shared with existing search behavior; no auth, data, or API changes.
Overview
Brings search-style “fit column to content” to table charts: Chart Explorer table results and dashboard table tiles (
HDXMultiSeriesTableChart). Double-clicking a column’s resize handle measures visible cells and sets width like a drag (not persisted); the trailing column still has no handle.Search tables now call a shared
fitColumnhelper incolumnFit.tsinstead of duplicating measure/set logic.measureColumnContentWidthapplies!importanton measurement probes so Bootstrapw-100on linked row cells no longer inflates fits in chart tables. Chart bodies getdata-column-idon cells for measurement.Coverage: unit tests for
fitColumn/!important, component tests onHDXMultiSeriesTableChart, and a Chart Explorer e2e for double-click fit.Reviewed by Cursor Bugbot for commit fb0d118. Bugbot is set up for automated code reviews on this repo. Configure here.