fix(dashboard): MultiStatusWidget dot clump on wide short panels#205
Conversation
MultiStatusWidget rendered all dots and labels in an overlapping clump at the centre of short, wide widgets (e.g. Position [1 1 24 2]): the axes forced DataAspectRatio=[1 1 1] over square [0 1]x[0 1] limits, so MATLAB letterboxed the drawable area into a square sized by the panel HEIGHT, and the auto column count ceil(sqrt(n)) stacked rows the strip could not fit. - Drop DataAspectRatio; keep dots circular by scaling rx/ry with the measured axes pixel aspect instead. - Make the auto column count aspect-aware (single row on wide strips; unchanged ceil(sqrt(n)) on square panels). - Reserve a pixel-sized label band under each dot with top-aligned labels so 8 pt text stays readable at 2-grid-row heights. - Add regression tests asserting pairwise non-overlapping label extents and >50%-width spread at 2-row height, plus the historic 3x2 grid on square panels. Public interface (constructor options, properties, toStruct/fromStruct round-trip) unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Reviewed: root cause confirmed (DataAspectRatio letterboxing collapses the drawable area to the panel's smaller dimension on wide strips); fix preserves square-panel layout byte-identically per the new regression test, dot circularity via per-pixel scaling matches the ChipBarWidget pattern. Local: TestMultiStatusWidget 5/5 (new test verified failing pre-fix), TestMultiStatusWidgetTag 7/7, TestDashboardPreview 22/22, TestDashboardPerformance 15/15; Octave local run clean. CI: Octave segfault on first run was a teardown flake in test_dashboard_multipage_render (touches only NumberWidget, crashed after all subtests passed; green on rerun + locally). Sole remaining red is the pre-existing testPreviewStillFull render-cache regression on main. 🤖 Generated with Claude Code |
Problem
MultiStatusWidget rendered all status dots + labels overlapping in a clump at top-center when the widget is wide and short (e.g.
Position [1 1 24 2]— a ~1500×90 px strip with 6 sensors). Showed up on envlog-style group status strips.Root cause
The axes was created with
DataAspectRatio [1 1 1]over square[0 1]×[0 1]limits — MATLAB letterboxes such an axes into a square sized by the panel's smaller dimension, collapsing the drawable area to ~75 px on a 2-row strip. Theceil(sqrt(n))auto column count then packed a 3×2 grid into it.Fix
DataAspectRatio; the axes fills the panel and dots stay circular via per-pixel rx/ry scaling (same pattern as ChipBarWidget).min(n, ceil(sqrt(n * pxW/pxH)))— one horizontal row on wide strips, identical grid on square panels.No public-interface changes; fast color-only refresh path untouched.
Verification
testShortWideWidgetSpreadsDotsHorizontally,testSquarePanelKeepsGridLayout.Note:
tests/test_multistatus_widget_tag.merrors identically on unmodified main (references a deletedThresholdclass) — pre-existing, tracked separately.🤖 Generated with Claude Code