iPad: compact the header, fill portrait, fix palette scroll + sheet padding

- Header: the panel-toggle row and Tempo/Tuner move into the left column under
  the title (beside the scope + transport), filling the dead vertical space; the
  top strip is now just the board mixer + CPU meters.
- Portrait: the root fills the window and pins top-leading so content is no
  longer vertically centered with large blank margins.
- Add-Pedal sheet: content scrolls instead of resizing the detent
  (presentationContentInteraction), and a visible toolbar background stops the
  title drawing over the first rows.
- Rigs sheet: add top padding so the "Rigs" title isn't flush to the edge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-04 15:54:56 -07:00
parent 67744ec89d
commit f97ba90ea6
@@ -237,10 +237,14 @@ public struct ShoeGazeBuilderView: View {
rootContent rootContent
.padding(ShoeGazeBuilderView.outerPadding) .padding(ShoeGazeBuilderView.outerPadding)
// A large min width is a macOS window sizing hint; on iPad it would force content wider than // A large min width is a macOS window sizing hint; on iPad it would force content wider than
// the screen and clip it, so the sheet-based iPad layout imposes no minimum width. // the screen and clip it, so the sheet-based iPad layout imposes no minimum width. Fill the
// whole window and pin to the top-leading corner so portrait isn't vertically centered.
.frame( .frame(
minWidth: isCompact ? nil : ShoeGazeBuilderView.minWidth + ShoeGazeBuilderView.librarySidebarReserve, minWidth: isCompact ? nil : ShoeGazeBuilderView.minWidth + ShoeGazeBuilderView.librarySidebarReserve,
minHeight: isCompact ? nil : ShoeGazeBuilderView.minHeight maxWidth: isCompact ? .infinity : nil,
minHeight: isCompact ? nil : ShoeGazeBuilderView.minHeight,
maxHeight: isCompact ? .infinity : nil,
alignment: .topLeading
) )
.background( .background(
Color( Color(
@@ -356,6 +360,7 @@ public struct ShoeGazeBuilderView: View {
Color.clear Color.clear
.sheet(isPresented: $showRigsSheet) { .sheet(isPresented: $showRigsSheet) {
rigSidebar rigSidebar
.padding(.top, ShoeGazeBuilderView.outerPadding)
.presentationDetents([.large]) .presentationDetents([.large])
.preferredColorScheme(.dark) .preferredColorScheme(.dark)
} }
@@ -491,15 +496,30 @@ public struct ShoeGazeBuilderView: View {
/// horizontally scrollable row of panel toggles that open the composition sheets. /// horizontally scrollable row of panel toggles that open the composition sheets.
private var compactHeader: some View { private var compactHeader: some View {
_ = transportTick _ = transportTick
return VStack(alignment: .leading, spacing: ShoeGazeBuilderView.rowSpacing) { // Left column fills the vertical space under the title with the panel/toggle rows; the
HStack(alignment: .top, spacing: ShoeGazeBuilderView.rowSpacing) { // right column carries the scope + transport. Top-aligned so nothing floats mid-header.
return HStack(alignment: .top, spacing: ShoeGazeBuilderView.rowSpacing) {
VStack(alignment: .leading, spacing: ShoeGazeBuilderView.rowSpacing) {
HStack(spacing: ShoeGazeBuilderView.rowSpacing) {
VStack(alignment: .leading, spacing: 1) { VStack(alignment: .leading, spacing: 1) {
Text("ShoeGaze Builder").font(.headline).bold() Text("ShoeGaze Builder").font(.headline).bold()
.foregroundStyle(Color.white) .foregroundStyle(Color.white)
currentRigLabel currentRigLabel
} }
if shoeGaze.isRecording { recordingBadge } if shoeGaze.isRecording { recordingBadge }
Spacer() }
compactPanelRow
HStack(spacing: ShoeGazeBuilderView.rowSpacing) {
TempoView(shoeGaze: shoeGaze)
TunerView(shoeGaze: shoeGaze)
}
.environment(\.shoeGazeTempoEnabled, shoeGaze.tempoEnabled)
}
Spacer(minLength: ShoeGazeBuilderView.rowSpacing)
// A narrow scope sits left of the transport cluster to use the header's dead space. // A narrow scope sits left of the transport cluster to use the header's dead space.
ShoeGazeScopeView(shoeGaze: shoeGaze) ShoeGazeScopeView(shoeGaze: shoeGaze)
.frame( .frame(
@@ -519,7 +539,10 @@ public struct ShoeGazeBuilderView: View {
#endif #endif
} }
} }
}
/// The scrollable row of composition-sheet toggles + rig-wide controls.
private var compactPanelRow: some View {
ScrollView(.horizontal, showsIndicators: false) { ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: ShoeGazeBuilderView.rowSpacing) { HStack(spacing: ShoeGazeBuilderView.rowSpacing) {
compactPanelButton("Rigs", systemImage: "tray.full") { showRigsSheet = true } compactPanelButton("Rigs", systemImage: "tray.full") { showRigsSheet = true }
@@ -538,7 +561,6 @@ public struct ShoeGazeBuilderView: View {
} }
} }
} }
}
/// The recording indicator badge (extracted so both header variants can show it). /// The recording indicator badge (extracted so both header variants can show it).
private var recordingBadge: some View { private var recordingBadge: some View {
@@ -569,16 +591,7 @@ public struct ShoeGazeBuilderView: View {
/// Compact top strip: performance monitoring kept on screen — the board switch/mixer bar, the /// Compact top strip: performance monitoring kept on screen — the board switch/mixer bar, the
/// scope, and the CPU meters. Tempo / Tuner sit below so they don't crowd the transport row. /// scope, and the CPU meters. Tempo / Tuner sit below so they don't crowd the transport row.
private var compactTopSection: some View { private var compactTopSection: some View {
VStack(alignment: .leading, spacing: ShoeGazeBuilderView.sectionSpacing) { VStack(alignment: .leading, spacing: ShoeGazeBuilderView.rowSpacing) {
HStack(spacing: ShoeGazeBuilderView.rowSpacing) {
TempoView(shoeGaze: shoeGaze)
TunerView(shoeGaze: shoeGaze)
Spacer(minLength: 0)
}
.environment(\.shoeGazeTempoEnabled, shoeGaze.tempoEnabled)
Divider().overlay(Color.white.opacity(ShoeGazeBuilderView.dividerOpacity))
BoardBarView( BoardBarView(
shoeGaze: shoeGaze, shoeGaze: shoeGaze,
editingBoardIndex: $selectedBoardIndex, editingBoardIndex: $selectedBoardIndex,
@@ -589,7 +602,7 @@ public struct ShoeGazeBuilderView: View {
Divider().overlay(Color.white.opacity(ShoeGazeBuilderView.dividerOpacity)) Divider().overlay(Color.white.opacity(ShoeGazeBuilderView.dividerOpacity))
// Scope moved to the header (next to the transport); the CPU meters stay here. // Scope + Tempo/Tuner moved to the header; the CPU meters stay here.
LyrebirdStatusView(engine: shoeGaze.engine) LyrebirdStatusView(engine: shoeGaze.engine)
} }
} }
@@ -606,6 +619,7 @@ public struct ShoeGazeBuilderView: View {
.navigationTitle("Add Pedal") .navigationTitle("Add Pedal")
#if os(iOS) #if os(iOS)
.navigationBarTitleDisplayMode(.inline) .navigationBarTitleDisplayMode(.inline)
.toolbarBackground(.visible, for: .navigationBar)
#endif #endif
.toolbar { .toolbar {
ToolbarItem(placement: .confirmationAction) { ToolbarItem(placement: .confirmationAction) {
@@ -614,6 +628,8 @@ public struct ShoeGazeBuilderView: View {
} }
} }
.preferredColorScheme(.dark) .preferredColorScheme(.dark)
// Drag inside the list scrolls it instead of resizing the sheet detent.
.presentationContentInteraction(.scrolls)
} }
/// Engine configuration (sample rate, input/output channel counts, input source), presented as /// Engine configuration (sample rate, input/output channel counts, input source), presented as