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:
@@ -66,6 +66,13 @@ public struct SessionView: View {
|
|||||||
overlayChrome(controller: controller)
|
overlayChrome(controller: controller)
|
||||||
.transition(.opacity.combined(with: .move(edge: .top)))
|
.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 {
|
} else {
|
||||||
ProgressView("Preparing session…")
|
ProgressView("Preparing session…")
|
||||||
.tint(.white)
|
.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
|
@ViewBuilder
|
||||||
private func overlayChrome(controller: SessionController) -> some View {
|
private func overlayChrome(controller: SessionController) -> some View {
|
||||||
VStack(spacing: 8) {
|
VStack(spacing: 8) {
|
||||||
|
|||||||
Reference in New Issue
Block a user