Commit cb0dce9e authored by Kourser's avatar Kourser
Browse files

feat(debug): -uiReviewPrompt opens the invitation on demand

The invitation waits for five finished episodes and three days since
install, so there was no way to look at it without editing UserDefaults
by hand. This joins -uiSeed / -uiScreen / -uiCapture as a DEBUG-only
launch argument, and deliberately writes nothing: a forced look leaves
the real gating state alone rather than burning the 120-day delay.

Verified by window count — the sheet appears at its 380pt macOS width.

Co-Authored-By: default avatarClaude Opus 5 <noreply@anthropic.com>
parent dac304f8
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -74,6 +74,19 @@ final class ReviewPrompter {
        isPresented = false
    }

    #if DEBUG
    /// Launch argument `-uiReviewPrompt`, alongside `-uiSeed` / `-uiScreen`:
    /// opens the invitation straight away so it can be looked at without
    /// waiting out the thresholds. Never compiled into Release.
    static var isForced: Bool { ProcessInfo.processInfo.arguments.contains("-uiReviewPrompt") }

    /// Bypasses every condition, and writes nothing: the real gating state is
    /// left untouched so a forced look does not consume the 120-day delay.
    func presentForced() {
        isPresented = true
    }
    #endif

    private func days(from: Date, to: Date) -> Int {
        Calendar.current.dateComponents([.day], from: from, to: to).day ?? 0
    }
+8 −0
Original line number Diff line number Diff line
@@ -180,6 +180,14 @@ struct RootView: View {
        }
        .task {
            await applyDemoScreen()
            #if DEBUG
            if ReviewPrompter.isForced {
                // Give the window its first layout pass, or the sheet has
                // nothing to attach to yet.
                try? await Task.sleep(for: .milliseconds(600))
                reviewPrompter.presentForced()
            }
            #endif
            #if os(macOS) && DEBUG
            if let capturePath = DemoCapture.path { await DemoCapture.run(to: capturePath) }
            #endif