Skip to content

fix(ui): align section dB scale with bar zone (#12)#13

Merged
sha1n merged 1 commit into
masterfrom
fix/meter-scale-alignment
May 9, 2026
Merged

fix(ui): align section dB scale with bar zone (#12)#13
sha1n merged 1 commit into
masterfrom
fix/meter-scale-alignment

Conversation

@sha1n
Copy link
Copy Markdown
Owner

@sha1n sha1n commented May 9, 2026

Summary

  • Fixes Meter dB scale is misaligned with the bar zone in SOURCE and DESTINATION sections #12. The expanded MeterPanel's SectionScale padded its DbScale canvas by capBandHeight (10 pt) top + bottom while the bar zone in MixerStripColumn is offset by 40 pt at the top (header + +12 cap + outer padding + VStack spacings) and 66 pt at the bottom (action + readout + −∞ cap + outer padding + spacings). The "0 / -3 / … / -60" tick marks therefore did not line up with the bar fill or the peak-hold tick on either the SOURCE or DESTINATION section. The dB → fraction math (MeterLevel.fractionFor) was always correct; the bug was purely positional.
  • Extract bandStackInnerSpacing (4 pt) and bandStackOuterPadding (6 pt) into MixerPanelLayout; derive barZoneTopOffset (= 40) and barZoneBottomOffset (= 66) from those + the existing band heights. SectionScale now uses .padding(.top: barZoneTopOffset, .bottom: barZoneBottomOffset) so its canvas spans exactly the bar zone. MixerStripColumn's VStack spacing + outer vertical padding flow through the same constants, so a future band-height edit cascades into the offsets automatically.
  • New regression tests in MixerLayoutTests pin the offset formulas (header / +12 cap / 2× spacing / outer padding above; action / readout / −∞ cap / 3× spacing / outer padding below) and the concrete values (40 / 66) so a band-stack composition change can't silently re-introduce the misalignment.

Test plan

  • make verify green — Swift suite, 340 C++ cases / 673,885 assertions, RT-safety scan, TSan
  • make app builds + ad-hoc-signs Jbox.app (Hardened Runtime + audio-input entitlement preserved)
  • New MixerLayoutTests cases:
    • bandStack inner spacing and outer padding are positive non-zero
    • barZoneTopOffset = outer pad + header + +12 cap + 2× inner spacing (asserts both formula and concrete == 40)
    • barZoneBottomOffset = outer pad + action + readout + −∞ cap + 3× inner spacing (asserts both formula and concrete == 66)
  • Visual confirmation by project owner — open the app, expand a route, eyeball that the "0 / -3 / -6 / -12 / -18 / -24 / -36 / -48 / -60" ticks line up with the bar fill on both SOURCE and DESTINATION

Docs

  • docs/spec.md § 4.5 — added a sentence describing the alignment contract that barZoneTopOffset / barZoneBottomOffset enforce.
  • docs/plan.md — Phase 7.7 deviations gained an entry summarising the regression + fix.

🤖 Generated with Claude Code

The expanded `MeterPanel`'s `SectionScale` only padded its `DbScale`
canvas by `capBandHeight` (10 pt) top + bottom, but the bar zone in
`MixerStripColumn` is offset by 40 pt at the top (header + +12 cap +
outer pad + VStack spacings) and 66 pt at the bottom (action + readout
+ −∞ cap + outer pad + spacings). The "0 / -3 / -6 / … / -60" ticks
therefore didn't line up with the bar fill or the peak-hold tick on
either SOURCE or DESTINATION sections.

Extract the band-stack spacing + outer padding into `MixerPanelLayout`
and derive `barZoneTopOffset` / `barZoneBottomOffset` from the existing
band heights. `SectionScale` pads by the new offsets so its canvas
spans exactly the bar zone; `MixerStripColumn` consumes the same
spacing + outer-padding constants so a future band-height edit
cascades into both views together. `MixerLayoutTests` pins the offset
formulas and the concrete values (40 / 66) so a band-stack composition
change can't silently re-introduce the misalignment.

Test coverage: 3 new cases in `MixerLayoutTests` (positive constants,
top-offset formula, bottom-offset formula). `make verify` green —
Swift suite, 340 C++ cases, RT-safety scan, TSan all pass. Visual
confirmation by user pass.

Fixes #12

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

github-actions Bot commented May 9, 2026

Test report

      3 files  ±  0        3 suites  ±0   17s ⏱️ -6s
    661 tests +  3      661 ✅ +  3  0 💤 ±0  0 ❌ ±0 
672 860 runs   - 709  672 860 ✅  - 709  0 💤 ±0  0 ❌ ±0 

Results for commit 446b837. ± Comparison against base commit 501dfcd.

@sha1n sha1n merged commit 4902da7 into master May 9, 2026
2 checks passed
@sha1n sha1n deleted the fix/meter-scale-alignment branch May 9, 2026 17:54
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.

Meter dB scale is misaligned with the bar zone in SOURCE and DESTINATION sections

1 participant