Skip to content

fix(dashboard): MultiStatusWidget dot clump on wide short panels#205

Merged
HanSur94 merged 1 commit into
mainfrom
fix/multistatus-dot-overlap
Jun 11, 2026
Merged

fix(dashboard): MultiStatusWidget dot clump on wide short panels#205
HanSur94 merged 1 commit into
mainfrom
fix/multistatus-dot-overlap

Conversation

@HanSur94

Copy link
Copy Markdown
Owner

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. The ceil(sqrt(n)) auto column count then packed a 3×2 grid into it.

Fix

  • Drop DataAspectRatio; the axes fills the panel and dots stay circular via per-pixel rx/ry scaling (same pattern as ChipBarWidget).
  • Aspect-aware auto column count: min(n, ceil(sqrt(n * pxW/pxH))) — one horizontal row on wide strips, identical grid on square panels.
  • Reserved ≤14 px label band below each dot so 8 pt labels stay readable at 2-row heights.

No public-interface changes; fast color-only refresh path untouched.

Verification

  • Programmatic: before 4 overlapping label pairs / 3%-width spread; after 0 overlaps / 80% spread.
  • New regression tests (fail on unfixed code): testShortWideWidgetSpreadsDotsHorizontally, testSquarePanelKeepsGridLayout.
  • TestMultiStatusWidget 5/5 · TestMultiStatusWidgetTag 7/7 · TestDashboardPreview 22/22 · TestDashboardPerformance 15/15 · MISS_HIT clean.

Note: tests/test_multistatus_widget_tag.m errors identically on unmodified main (references a deleted Threshold class) — pre-existing, tracked separately.

🤖 Generated with Claude Code

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

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
libs/Dashboard/MultiStatusWidget.m 96.15% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@HanSur94

Copy link
Copy Markdown
Owner Author

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

@HanSur94 HanSur94 merged commit 9fdc13d into main Jun 11, 2026
31 of 34 checks passed
@HanSur94 HanSur94 deleted the fix/multistatus-dot-overlap branch June 11, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant