fix(ui): align section dB scale with bar zone (#12)#13
Merged
Conversation
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>
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.
Summary
MeterPanel'sSectionScalepadded itsDbScalecanvas bycapBandHeight(10 pt) top + bottom while the bar zone inMixerStripColumnis 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.bandStackInnerSpacing(4 pt) andbandStackOuterPadding(6 pt) intoMixerPanelLayout; derivebarZoneTopOffset(= 40) andbarZoneBottomOffset(= 66) from those + the existing band heights.SectionScalenow 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.MixerLayoutTestspin 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 verifygreen — Swift suite, 340 C++ cases / 673,885 assertions, RT-safety scan, TSanmake appbuilds + ad-hoc-signsJbox.app(Hardened Runtime + audio-input entitlement preserved)MixerLayoutTestscases:bandStack inner spacing and outer padding are positive non-zerobarZoneTopOffset = 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)Docs
docs/spec.md § 4.5— added a sentence describing the alignment contract thatbarZoneTopOffset/barZoneBottomOffsetenforce.docs/plan.md— Phase 7.7 deviations gained an entry summarising the regression + fix.🤖 Generated with Claude Code