From 311118f0faffa332e6643d375151801546846e60 Mon Sep 17 00:00:00 2001 From: FuelBoard Contributor Date: Wed, 14 Oct 2026 12:25:16 +0100 Subject: [PATCH] Add a DEBUG screen-marker hook so Simulator taps can be verified `-qaScreenMarker` paints the screen flat magenta, which lets a macOS capture locate the device-screen rectangle exactly and map simulator-screenshot pixels to click coordinates. `simctl` cannot drive taps and the project has no UI-test target, so this is the only way to test real touch behaviour on the sheet. Guarded by #if DEBUG, exactly like the existing -qaCopyPostcode hook. --- FuelBoard/FuelBoardApp.swift | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/FuelBoard/FuelBoardApp.swift b/FuelBoard/FuelBoardApp.swift index b71d702..04d36f5 100644 --- a/FuelBoard/FuelBoardApp.swift +++ b/FuelBoard/FuelBoardApp.swift @@ -21,7 +21,7 @@ struct FuelBoardApp: App { var body: some Scene { WindowGroup { - ContentView() + rootView .onOpenURL(perform: handleOpenURL) .onReceive(NotificationCenter.default.publisher(for: .fuelBoardWatchRefreshRequested)) { _ in WatchSyncManager.shared.pushSnapshot() @@ -32,6 +32,24 @@ struct FuelBoardApp: App { } } + /// QA hook (Debug builds only): `-qaScreenMarker` paints the whole screen a + /// flat magenta. A macOS capture of the Simulator window can then locate the + /// device-screen rectangle exactly, which yields a pixel-accurate mapping + /// from simulator screenshots to click coordinates. That is the only way to + /// drive REAL taps into the Simulator: `simctl` cannot, and this project has + /// no UI-test target. Everything else renders ContentView as normal. + @ViewBuilder private var rootView: some View { + #if DEBUG + if ProcessInfo.processInfo.arguments.contains("-qaScreenMarker") { + Color(red: 1, green: 0, blue: 1).ignoresSafeArea() + } else { + ContentView() + } + #else + ContentView() + #endif + } + #if DEBUG private func startQALiveActivity(fuel: FuelType) { let state = FuelBoardLiveActivityAttributes.ContentState(