← SETTINGS
DEV · HANDOFF
Developer handoff.
Integration spec for shipping SplitRox to iOS via Capacitor, plus the watchOS companion contract. Import session control from @/lib/watchSession.
CAPACITOR · iOS BUILD
1. Install
bun add @capacitor/core @capacitor/cli @capacitor/ios @capacitor/haptics @capacitor/status-bar
2. Build web
bun run build (outputs dist/client)
3. Add iOS
npx cap add ios
4. Sync
npx cap sync ios
5. Ship
Open ios/App/App.xcworkspace on a Mac, OR push to Codemagic for cloud build → TestFlight.
PWA · WEB INSTALL
Manifest
/manifest.webmanifest — standalone, portrait, dark theme.
Icons
/icon-192.png, /icon-512.png, /apple-touch-icon.png.
iOS install
Safari → Share → Add to Home Screen. Launches full-screen, no browser chrome.
Offline
Live session state persists in sessionStorage; OfflineIndicator surfaces dropped connectivity. No service worker (intentional).
SESSION STATE
id
Active session ID.
kind
'race' | 'training'.
name
Session display name.
status
'not_started' | 'active' | 'paused' | 'completed'.
segIdx
Current segment index (0-based).
segCount
Total number of segments.
currentSegment
{ id, name, short, kind, distanceMeters?, reps?, calories? }.
nextSegment
Same shape as currentSegment, or undefined on final.
totalElapsedSec
Wall-clock elapsed minus paused time.
segmentElapsedSec
Elapsed within the current segment.
projectedFinishSec
Linear projection from average split pace.
goalSec
Target finish time (race mode).
splits
Array of completed Split records.
ACTIONS
startSession({kind, name, segments, goalSec?})
Begin a new live session.
pauseSession()
Pause the active session timer.
resumeSession()
Resume from pause; paused time excluded.
completeCurrentSegment()
Record split & advance to next segment.
moveToNextSegment()
Alias of completeCurrentSegment().
saveSplit()
Alias used by external bridges.
finishSession()
Force-complete the session (e.g. early stop).
getCurrentSessionState()
Returns a WatchSessionSnapshot or null.
subscribe(fn)
Push updates whenever state mutates.
triggerHapticEvent(event, payload?)
Dispatch a SessionEvent to bridges.
WATCH SCREENS
Start
Session name + large START button.
Live Segment
Current seg, total elapsed, current split, pace/target, next, NEXT.
Pause
RESUME and FINISH actions.
Complete
Total time + sync-to-phone confirmation.
HAPTIC EVENTS
session_started
Triple short tap on start.
segment_completed
Single firm tap when a split saves.
pace_warning
Double tap when pace falls outside target.
final_segment_started
Crescendo: four short + one long.
session_paused
Single short tap.
session_resumed
Single short tap.
session_completed
Long victory pattern.
TIER GATING
Watch features require tier ≥ wearable. Use hasWearable() from @/lib/subscription before exposing live control.