From b4b2f5876288c852e7fd2ae4ba479c14fe4657d6 Mon Sep 17 00:00:00 2001 From: Joshua Parmenter Date: Tue, 23 Jun 2026 17:14:04 -0700 Subject: [PATCH] Compact board mixer bar; align scope/CPU to palette width Shrink BoardBarView to a fixed-height single horizontal scroll group with a tighter two-row control column, so it wraps its elements and frees vertical canvas for the pedals. Constrain the scope and CPU-meter views to the pedal palette width, left-aligned, so they sit under the palette column. Co-Authored-By: Claude Opus 4.8 --- Sources/LyrebirdShoeGazeUI/BoardBarView.swift | 56 ++++++++++--------- .../ShoeGazeBuilderView.swift | 3 + 2 files changed, 34 insertions(+), 25 deletions(-) diff --git a/Sources/LyrebirdShoeGazeUI/BoardBarView.swift b/Sources/LyrebirdShoeGazeUI/BoardBarView.swift index c0191fb..f2c72d9 100644 --- a/Sources/LyrebirdShoeGazeUI/BoardBarView.swift +++ b/Sources/LyrebirdShoeGazeUI/BoardBarView.swift @@ -40,13 +40,16 @@ public struct BoardBarView: View { // MARK: - Layout constants - private static let barSpacing: CGFloat = 12 + private static let barSpacing: CGFloat = 10 + private static let barHeight: CGFloat = 92 private static let cellSpacing: CGFloat = 8 - private static let cellWidth: CGFloat = 116 - private static let cellInnerSpacing: CGFloat = 6 - private static let cellPadding: CGFloat = 8 + private static let cellWidth: CGFloat = 104 + private static let cellInnerSpacing: CGFloat = 5 + private static let cellPadding: CGFloat = 7 private static let cellCornerRadius: CGFloat = 8 - private static let controlColumnWidth: CGFloat = 150 + private static let controlColumnWidth: CGFloat = 188 + private static let modePickerWidth: CGFloat = 104 + private static let crossfadeSliderMinWidth: CGFloat = 64 private static let ledDiameter: CGFloat = 12 private static let ledGlowRadius: CGFloat = 6 private static let ledGlowOpacity: Double = 0.75 @@ -96,50 +99,53 @@ public struct BoardBarView: View { // MARK: - Body public var body: some View { - HStack(alignment: .center, spacing: BoardBarView.barSpacing) { - controlColumn - Divider().overlay(Color.white.opacity(BoardBarView.idleBorderOpacity)) - ScrollView(.horizontal, showsIndicators: false) { - HStack(spacing: BoardBarView.cellSpacing) { - ForEach(Array(shoeGaze.boards.enumerated()), id: \.offset) { pair in - boardCell(index: pair.offset, board: pair.element) - } - addButton + // One horizontal scroll group so the whole bar hugs its content and stays a short, + // fixed-height band — leaving the canvas below for the pedals. + ScrollView(.horizontal, showsIndicators: false) { + HStack(alignment: .center, spacing: BoardBarView.barSpacing) { + controlColumn + Divider().overlay(Color.white.opacity(BoardBarView.idleBorderOpacity)) + ForEach(Array(shoeGaze.boards.enumerated()), id: \.offset) { pair in + boardCell(index: pair.offset, board: pair.element) } + addButton } + .frame(height: BoardBarView.barHeight) } + .frame(height: BoardBarView.barHeight) } // MARK: - Control column private var controlColumn: some View { VStack(alignment: .leading, spacing: BoardBarView.cellInnerSpacing) { - Picker("Mode", selection: $mode) { - Text("Solo").tag(PlayMode.solo) - Text("Blend").tag(PlayMode.blend) - } - .pickerStyle(.segmented) - .labelsHidden() - HStack(spacing: BoardBarView.cellInnerSpacing) { + Picker("Mode", selection: $mode) { + Text("Solo").tag(PlayMode.solo) + Text("Blend").tag(PlayMode.blend) + } + .pickerStyle(.segmented) + .labelsHidden() + .frame(width: BoardBarView.modePickerWidth) + Button("All") { shoeGaze.selectAllBoards(crossfadeSeconds: clampedCrossfade) } .buttonStyle(.bordered) .tint(.orange) .help("Play all boards (summed)") - - Text("XFade") - .font(.caption2) - .foregroundStyle(Color.white.opacity(BoardBarView.labelOpacity)) } HStack(spacing: BoardBarView.cellInnerSpacing) { + Text("XFade") + .font(.caption2) + .foregroundStyle(Color.white.opacity(BoardBarView.labelOpacity)) Slider( value: $crossfadeSeconds, in: 0 ... BoardBarView.maxCrossfadeSeconds, step: BoardBarView.crossfadeStep ) + .frame(minWidth: BoardBarView.crossfadeSliderMinWidth) Text(String(format: "%.1fs", clampedCrossfade)) .font(.caption2) .monospacedDigit() diff --git a/Sources/LyrebirdShoeGazeUI/ShoeGazeBuilderView.swift b/Sources/LyrebirdShoeGazeUI/ShoeGazeBuilderView.swift index 8152b7c..1509606 100644 --- a/Sources/LyrebirdShoeGazeUI/ShoeGazeBuilderView.swift +++ b/Sources/LyrebirdShoeGazeUI/ShoeGazeBuilderView.swift @@ -118,8 +118,11 @@ public struct ShoeGazeBuilderView: View { boardArea } .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading) + // Scope + CPU meters sit under the pedal palette, matching its width. ShoeGazeScopeView(shoeGaze: shoeGaze) + .frame(width: ShoeGazeBuilderView.sidebarWidth, alignment: .leading) LyrebirdStatusView(engine: shoeGaze.engine) + .frame(width: ShoeGazeBuilderView.sidebarWidth, alignment: .leading) } .padding(ShoeGazeBuilderView.outerPadding) .frame(minWidth: ShoeGazeBuilderView.minWidth, minHeight: ShoeGazeBuilderView.minHeight)