From 997eb144d2be455c7e2a1e0dec15586c6c9db68b Mon Sep 17 00:00:00 2001 From: Valdemar Lorenzen Date: Mon, 19 Oct 2026 12:05:38 +0200 Subject: [PATCH] fix: disambiguate SwiftUI State with macOS 27 SDK Use a file-private ViewState alias for all twelve state properties, including start-screen hover and playback queue state, on current main@origin. Document the standalone Command Line Tools workaround. Verified: make release; release check-runtime; release CLI --help; dlopen of the release player library and terebi_app_main symbol lookup. --- README.md | 2 ++ Sources/App/TerebiApp.swift | 27 +++++++++++++++------------ TODO.md | 1 + 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 4f6a97f..d27c887 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ make run The first build downloads pinned dependencies. Build natively on Apple Silicon or Intel; cross-architecture and Rosetta builds are not supported. +With the macOS 27 SDK, the player uses a private `ViewState` alias for the `SwiftUI.State` property wrapper to avoid selecting the same-named macro, whose `SwiftUIMacros` plugin is absent from standalone Command Line Tools. Full Xcode or an older SDK is not required. + The resulting `.build/terebi.app` is self-contained: copy the whole app to a compatible Mac of the same architecture. No separate FFmpeg, Python, or yt-dlp installation is needed to run it. ### Install diff --git a/Sources/App/TerebiApp.swift b/Sources/App/TerebiApp.swift index 6e0a0e0..67fe62b 100644 --- a/Sources/App/TerebiApp.swift +++ b/Sources/App/TerebiApp.swift @@ -2068,9 +2068,12 @@ struct PlaybackSurface: NSViewRepresentable { } } +// Select the property wrapper, not the macOS 27 macro missing from Command Line Tools. +private typealias ViewState = SwiftUI.State + private struct StartScreenButtonStyle: ButtonStyle { var prominent = false - @State private var hovered = false + @ViewState private var hovered = false func makeBody(configuration: Configuration) -> some View { configuration.label @@ -2089,19 +2092,19 @@ private struct StartScreenButtonStyle: ButtonStyle { private struct PlayerContent: View { @ObservedObject var model: PlayerModel @Environment(\.accessibilityReduceMotion) private var reduceMotion - @State private var showsRemainingTime = false - @State private var dropTargeted = false - @State private var showsYouTubeInput = false - @State private var youTubeURL = "" + @ViewState private var showsRemainingTime = false + @ViewState private var dropTargeted = false + @ViewState private var showsYouTubeInput = false + @ViewState private var youTubeURL = "" @FocusState private var youTubeInputFocused: Bool - @State private var controlSize = CGSize(width: 440, height: 68) - @State private var queueFrames: [UUID: CGRect] = [:] - @State private var queueDrag: PlaybackQueueDrag? + @ViewState private var controlSize = CGSize(width: 440, height: 68) + @ViewState private var queueFrames: [UUID: CGRect] = [:] + @ViewState private var queueDrag: PlaybackQueueDrag? @GestureState private var queueDragging = false - @State private var queueScroll = ScrollPosition(y: 0) - @State private var queueScrollOffset: CGFloat = 0 - @State private var queueViewportHeight: CGFloat = 0 - @State private var queueContentHeight: CGFloat = 0 + @ViewState private var queueScroll = ScrollPosition(y: 0) + @ViewState private var queueScrollOffset: CGFloat = 0 + @ViewState private var queueViewportHeight: CGFloat = 0 + @ViewState private var queueContentHeight: CGFloat = 0 private func compactTitleLabel(progress: String?, constrained: Bool) -> some View { HStack(spacing: 0) { diff --git a/TODO.md b/TODO.md index 6a82841..bc18c80 100644 --- a/TODO.md +++ b/TODO.md @@ -10,5 +10,6 @@ - local seek preroll skips disposable non-reference pictures without sacrificing exact target frames; measured 1080p/10-second-GOP paused seek improved from 541 ms to 400 ms and playing seek from 682 ms to 488 ms; timestamp/pixel checks passed across six decoder formats; long-GOP reference decoding remains necessary, and the originally affected files still need manual verification - [x] make the sidebar expand/collapse with a nice transition - synchronized 250 ms sidebar/window reveal, reversible mid-transition, with immediate Reduce Motion changes; top-right controls stay anchored to the moving window corner; native checks passed for rendered controls during transitions, stable video size, reversals, screen-edge fitting, fullscreen and compact restoration; animation feel and Reduce Motion still need manual verification +- [ ] make the window draggable (in all cases/view states) so long as a button/clickable element is not hovered. - [ ] in the "choose what to play" screen, we should change the youtube button to general streaming - we can figure out the stream and how to handle it from the url (i.e. if youtube url, handle as youtube stream; if miruro url, handle accordingly) \ No newline at end of file