f5eae24c87
ci / rust (push) Failing after 42s
apple / swift (push) Successful in 54s
ci / web (push) Successful in 29s
ci / docs-site (push) Successful in 32s
android / android (push) Successful in 1m47s
ci / bench (push) Successful in 1m35s
decky / build-publish (push) Successful in 11s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 4s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 5s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 4s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 4s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 4s
deb / build-publish (push) Successful in 2m21s
rpm / build-publish (bazzite, punktfunk-fedora-rpm) (push) Successful in 5m27s
rpm / build-publish (fedora-44, punktfunk-fedora44-rpm) (push) Successful in 5m28s
docker / deploy-docs (push) Successful in 20s
The macOS Settings window had outgrown one scrolling pane — split it into a tabbed preferences window (General / Display / Audio / Controllers / Advanced). Each settings group is now a shared @ViewBuilder section, so iOS keeps its single grouped Form and tvOS its pushed-picker layout, each defined once. No setting moved or dropped. New statistics-overlay controls (Settings → Display → Statistics): a show/hide toggle (DefaultsKey.hudEnabled) and a corner picker (HUDPlacement / DefaultsKey.hudPlacement) — the HUD moves to the chosen corner and aligns its text to that edge. A Scene-level "Stream" menu (StreamCommands) carries Show/Hide Statistics (⌘⇧S) and Disconnect (⌘D). Disconnect moved off the HUD button into the menu so it survives the overlay being hidden, wired via .focusedSceneValue. On iOS a material-backed exit chip appears when the HUD is hidden (touch users have no menu/⌘D); tvOS disconnect is unchanged (Siri-Remote Menu button). Builds on macOS/iOS/tvOS; swift test green. Adversarially reviewed (8 findings refuted, 2 minor — the iOS exit-chip contrast fix is included here). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
50 lines
1.7 KiB
Swift
50 lines
1.7 KiB
Swift
// The app's "Stream" menu (macOS menu bar + iPad hardware-keyboard shortcuts). These live at
|
|
// the Scene level so they keep working when the HUD overlay is hidden — in particular ⌘D
|
|
// disconnect, which used to be reachable only via the HUD's button. The toggle just flips the
|
|
// shared `hudEnabled` setting; ContentView reads the same @AppStorage and reacts.
|
|
//
|
|
// tvOS has no menu bar / hardware-keyboard command surface (disconnect there is the Siri
|
|
// Remote's Menu button, handled by ContentView's `.onExitCommand`), so this whole file is
|
|
// non-tvOS only.
|
|
|
|
#if !os(tvOS)
|
|
import PunktfunkKit
|
|
import SwiftUI
|
|
|
|
/// The live session's menu-reachable actions, published by ContentView via
|
|
/// `.focusedSceneValue` so the Scene-level commands can drive it.
|
|
struct SessionFocus {
|
|
var isStreaming: Bool
|
|
var disconnect: () -> Void
|
|
}
|
|
|
|
private struct SessionFocusKey: FocusedValueKey {
|
|
typealias Value = SessionFocus
|
|
}
|
|
|
|
extension FocusedValues {
|
|
var sessionFocus: SessionFocus? {
|
|
get { self[SessionFocusKey.self] }
|
|
set { self[SessionFocusKey.self] = newValue }
|
|
}
|
|
}
|
|
|
|
struct StreamCommands: Commands {
|
|
@FocusedValue(\.sessionFocus) private var session
|
|
@AppStorage(DefaultsKey.hudEnabled) private var hudEnabled = true
|
|
|
|
var body: some Commands {
|
|
CommandMenu("Stream") {
|
|
Button(hudEnabled ? "Hide Statistics" : "Show Statistics") {
|
|
hudEnabled.toggle()
|
|
}
|
|
.keyboardShortcut("s", modifiers: [.command, .shift])
|
|
Divider()
|
|
Button("Disconnect") { session?.disconnect() }
|
|
.keyboardShortcut("d", modifiers: .command)
|
|
.disabled(session?.isStreaming != true)
|
|
}
|
|
}
|
|
}
|
|
#endif
|