Keep the dashboard temperature tooltip inside the chart - #1039
Open
kaysond wants to merge 1 commit into
Open
Conversation
The chart runs in sparkline mode, which hides the legend, so the shared tooltip is the only way to tell the lines apart. It grows a row per device, and apexcharts only keeps the top half of it inside the chart, so the rest was clipped by the card's overflow-hidden. With 7 drives 119px of a 266px tooltip was cut off. Pin the tooltip to the top left corner so it is laid out from a known point, and stop the card clipping it, which matters once there are more drives than fit in the chart's height. Closes #950
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.
Closes #950
What was happening
The dashboard temperature chart runs in
sparklinemode, which forceslegend.show = false, so theonly way to tell which line is which drive is the shared tooltip. That tooltip grows one row per
device, and two things then conspire against it:
Position.moveTooltip()clamps with
if (tooltipRect.ttHeight / 2 + y > gridHeight), so the bottom of the tooltip cansit up to
ttHeight / 2below the chart.rounded overflow-hidden, so whatever hangs below gets clipped.Measured on a 1280×900 viewport with 7 drives, hovering the series the way the reporter's screenshot
shows: the tooltip is 266px tall and 119px of it is cut off.
The fix
tooltip.fixed = { enabled: true, position: 'topLeft' }. That skipsmoveTooltip()entirely (if (!ttCtx.fixedTooltip) this.moveTooltip(...)) and anchors the tooltipto the top-left of the chart, so it is laid out downwards from a known point instead of around the
cursor.
overflow-hiddenfrom the chart card. For a large number of drives the tooltip is simplytaller than the chart, and clipping it is what made it unreadable. The temperature card is the last
block on the dashboard, so a tall tooltip just extends into empty page space.
Both are needed:
fixedalone still clips from 8 drives up, because the tooltip becomes taller thanthe 275px chart.
Measurements
Driven with headless Chromium against a production
ng serve, hovering the chart and measuring thetooltip against the clipping ancestor. "clipped" is how many pixels of the tooltip were cut off:
fixedonlyAlso checked at a 414×896 viewport (7 drives): tooltip fits, nothing clipped.
Not fixed here
The palette in
_prepareChartData()has only 6 colours, and ApexCharts recycles them, so from 7drives up two lines share a colour. That is a separate (and more debatable) change — the tooltip
markers have the same problem, and fixing it properly probably means generating colours rather than
listing them.
AI disclosure
Per AI_POLICY.md: this change was written by Claude Code (Opus 5). It reproduced
the bug, produced the numbers above, and made the change. Everything ran in a
node:24-trixiecontainer driving headless Chromium via puppeteer against
ng serve --configuration production, withthe API responses stubbed at the network layer so the drive count could be varied; nothing was
installed on the host.
Automated verification performed:
and at a phone-sized viewport
npm run build:prodandnpx ng test --watch=false --browsers=ChromeHeadless --code-coverage(87/87)
No unit test was added: the change is chart configuration, and a test asserting the option is set
would only restate the diff. The behaviour that matters is geometric and was checked in a browser.
That is the extent of the verification behind this PR as opened.