initial commit: Proximity iOS app proposal, full Swift code scaffold, reference backend, testing docs, generated Xcode project
This commit is contained in:
48
Proximity/Views/DebugMenu.swift
Normal file
48
Proximity/Views/DebugMenu.swift
Normal file
@@ -0,0 +1,48 @@
|
||||
import SwiftUI
|
||||
|
||||
/// Developer debug menu, available only in DEBUG builds.
|
||||
///
|
||||
/// This is the primary tool for testing the **interaction loop** without any
|
||||
/// hardware. It drives a `SimulatedAdapter` inside `PresenceEngine`, letting
|
||||
/// you simulate encounters, waves, and even a crowd — exactly as if real
|
||||
/// users were walking by. In the simulator, you can fully exercise silhouette
|
||||
/// → wave → reveal → chat with zero physical devices.
|
||||
///
|
||||
/// Enabled via the `#if DEBUG` guard so it never ships to production.
|
||||
struct DebugMenu: View {
|
||||
@EnvironmentObject private var appState: AppState
|
||||
|
||||
var body: some View {
|
||||
#if DEBUG
|
||||
NavigationStack {
|
||||
Form {
|
||||
Section("Simulation") {
|
||||
Button("Simulate someone walking by") {
|
||||
appState.simulateEncounter()
|
||||
}
|
||||
Button("Simulate a crowd (20 people)") {
|
||||
appState.simulateCrowd()
|
||||
}
|
||||
Toggle("Auto-broadcast nearby users", isOn: $appState.autoBroadcast)
|
||||
}
|
||||
|
||||
Section("Backend") {
|
||||
Label("Local server (localhost:8080)", systemImage: "network")
|
||||
.foregroundColor(.secondary)
|
||||
Button("Reconnect socket") {
|
||||
appState.restartRealtime()
|
||||
}
|
||||
}
|
||||
|
||||
Section("Info") {
|
||||
Label("Simulator mode — no hardware", systemImage: "iphone.simulator")
|
||||
.foregroundColor(.secondary)
|
||||
}
|
||||
}
|
||||
.navigationTitle("Debug")
|
||||
}
|
||||
#else
|
||||
EmptyView()
|
||||
#endif
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user