Session: add a persistent chrome-toggle handle at top center

Three-finger tap still works as a power-user shortcut, but now there's a
small glass chevron pill at the top center that flips between chevron.up
(hide toolbar) and chevron.down (show toolbar) based on chrome state.
Discoverable and reachable from one hand.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Trey T
2026-04-17 14:14:51 -05:00
parent 8177be94a5
commit 4ff3e4b030

View File

@@ -66,6 +66,13 @@ public struct SessionView: View {
overlayChrome(controller: controller)
.transition(.opacity.combined(with: .move(edge: .top)))
}
// Persistent pull-tab so the chrome is always reachable
// (three-finger tap is the power-user shortcut).
VStack {
chromeToggleHandle
Spacer()
}
} else {
ProgressView("Preparing session…")
.tint(.white)
@@ -95,6 +102,24 @@ public struct SessionView: View {
}
}
private var chromeToggleHandle: some View {
Button {
withAnimation(.snappy(duration: 0.22)) {
chromeVisible.toggle()
}
} label: {
Image(systemName: chromeVisible ? "chevron.up" : "chevron.down")
.font(.caption.weight(.bold))
.foregroundStyle(.white)
.frame(width: 44, height: 20)
.contentShape(Rectangle())
}
.buttonStyle(.plain)
.glassSurface(in: Capsule())
.accessibilityLabel(chromeVisible ? "Hide toolbar" : "Show toolbar")
.padding(.top, chromeVisible ? 4 : 2)
}
@ViewBuilder
private func overlayChrome(controller: SessionController) -> some View {
VStack(spacing: 8) {