Lay out the Data Graph label and reading as one wrapping row - #603
Conversation
The two were separate Chart.js plugin blocks pulled onto one line by a negative padding, so neither knew the other's width and Chart.js clips no title text: they drew straight through each other on any widget too narrow for both. A vertical graph is three or four columns wide, so it always was. The header moves into the template as a flex row that wraps. Both fit and the arrangement is unchanged; they do not and the reading takes its own row, still right-aligned; the label alone does not and it ellipsizes. The window suffix now rides with the label, so Show Label off no longer leaves a bare "(30 s)". Closes #602
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe data graph now renders its label and reading in a responsive header outside the Chart.js canvas. The component uses reactive signals for header state, while CSS wrapping prevents overlap and tests validate label, reading, unit, and fallback behavior. ChangesData graph header
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This localized graph-header layout change has no actionable merge-blocking risk remaining and is merge-ready after normal checks and review. Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Reported over Discord against vertical graphs. It is a width problem that vertical tiles hit every time: a wide horizontal tile with a long label collided too.
The label and the reading were two independent Chart.js plugin blocks — a 32 px
titleatalign: 'end'and a 22 pxsubtitleatalign: 'start', forced onto one row bypadding.top: -35. Neither block can see the other's width and Chart.js never clips or ellipsizes title text, so the two drew through each other whenever label + window + reading exceeded the tile. A vertical graph is normally three or four grid columns wide.The header moves out of the canvas into the template as a flex row with
flex-wrap: wrap, the label atmin-width: 0and the reading atmargin-left: auto. That gives the three behaviors in order, from CSS rather than from measurement code:The window suffix now rides with the label, so Show Label off leaves no bare "(30 s)" behind — the second half of the report. The reading became a signal the template renders, which also drops a
chart.options.plugins.title.textwrite and achart.updatefrom the emission path.Verified against a production build on the mock Signal K server, measuring in the browser rather than by eye: on a 265 px header the label measures 250 px and the reading 44 px, so it wraps; on the same header a 105 px label stays on one row; a 400 px label in a 114 px box ellipsizes (
scrollWidth400 vsclientWidth114). All four cases rendered and checked. Specs move from asserting plugin state to asserting the rendered header, plus one new case pinning that the two are siblings and both plugins are off.npm run cigreen: lint, snc, 2115 tests, MCP schema.widget-windtrends-graphuses the same overlay trick with a fixed three-character subtitle and is left alone.VERSIONstays 1.5.0 — the cycle is already open at minor level and this is a fix.Closes #602
🤖 Generated with Claude Code