Skip to content

fix(web): collapse empty metrics-slide wrapper (dashboard spacing)#10

Merged
dylanroscover merged 1 commit into
mainfrom
dev
May 26, 2026
Merged

fix(web): collapse empty metrics-slide wrapper (dashboard spacing)#10
dylanroscover merged 1 commit into
mainfrom
dev

Conversation

@dylanroscover
Copy link
Copy Markdown
Member

Promotes the single fix on dev since today's release (PR #9) to production.

What

Fixes the recurring dashboard "machines pushed down" gap. The metrics-slide wrapper's resting height was seeded by a useLayoutEffect([]) that fires on the component's first commit — but both callers render the wrapper behind a loading/mounted gate, so it isn't in the DOM yet. The one-shot effect no-ops and never re-runs, leaving the wrapper at height: auto; its inner pb-6 padding showed as a ~24px phantom gap (measured 54px above "machines" vs 30px below).

Seeds the height via a callback ref instead, which fires whenever the node actually attaches regardless of gated renders. This is the true root cause behind the regression that prior fixes (which patched the detailPanel memo) kept missing.

Verification

  • Playwright (local): resting 0px, open→489px→auto, close→0px; gap above "machines" == gap below == 30px.
  • Preflight: lint 0 errors, tsc clean, 2457 unit tests pass, full e2e suite green.

🤖 Generated with Claude Code

The slide wrapper's resting height was seeded by a useLayoutEffect([])
that fires on the component's FIRST commit — but both callers render the
wrapper behind a loading/mounted gate, so it isn't in the DOM yet. The
one-shot effect no-ops against the missing node and (with [] deps) never
re-runs, leaving the wrapper at height:auto; its inner pb-6 padding then
shows as a ~24px phantom gap that pushes the machines list below the
header (measured: 54px above "machines" vs 30px below = 1.8x).

Seed the resting height via a callback ref instead, which fires whenever
the node actually attaches regardless of how many gated renders precede
it, and read heldRef (always current) so the stable callback can't go
stale. This is the real root cause behind the recurring "empty slide
gap" regression — prior fixes patched the detailPanel memo (a red
herring) while JS never actually collapsed the wrapper.

Verified via Playwright: resting 0px, open->489px->auto, close->0px;
gap above "machines" == gap below == 30px (was 54 vs 30).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
owlette Ignored Ignored May 26, 2026 4:19am

@dylanroscover dylanroscover merged commit 670722f into main May 26, 2026
6 of 7 checks passed
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