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 <noreply@anthropic.com>
This commit is contained in:
2026-06-23 17:14:04 -07:00
parent c0605d295d
commit b4b2f58762
2 changed files with 34 additions and 25 deletions
+31 -25
View File
@@ -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()
@@ -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)