Share race & session results#26
Merged
Merged
Conversation
Adds Phase 5 "share results": a Share button on the finished-race view and on a History session detail, each handing a clean text recap to the OS share sheet (Messages, Notes, AirDrop, etc.). - New pure apps/mobile/src/share/summary.ts (+13 tests): raceShareText (total time, best/avg/worst splits, lap-by-lap with the fastest lap flagged) and sessionShareText (date, pass count, duration, best, fastest passes). Speeds run through the same speed/format converter as every readout, so shared numbers honor the user's unit + calibration; lap times mirror race.tsx. - race.tsx Results: "Share result" button (RN Share API), resolving the car's garage nickname; honors the haptics setting. - history/[id].tsx: header "Share" action (shown once a session has passes), passing the current speed display + car nickname map. - Uses React Native's built-in Share — no new native module. Also refreshed stale ROADMAP Phase 5 checkboxes (Achievements #23, speed units #25, this as #26). 178 vitest pass; tsc --noEmit clean; iOS export clean. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Phase 5 "share results." Race nights are social — this lets you fling a clean recap to Messages / Notes / AirDrop straight from the app. A Share button now lives on:
race.tsx) — a celebratory recap with splits + lap-by-lap, andhistory/[id].tsx) — a session summary with the fastest passes.Both hand plain text to the OS share sheet via React Native's built-in
ShareAPI — no new native module, so nothing to miss in a dev build (unlike the ExpoSQLite gotcha).How
apps/mobile/src/share/summary.ts(+13 tests):raceShareText(result, { carName })—🏁 player finished N laps in T, best/avg/worst splits, and a numbered lap list with the fastest lap flagged ⚡.sessionShareText(session, passes, { display, carNames, topN })— date, pass count, duration, best, and the top-N fastest passes.formatLapTimemirrorsrace.tsx's on-screen clock; speeds run through the samespeed/formatconverter as every readout, so a shared number honors the user's unit + calibration exactly.Example race share:
Tests / gates
tsc --noEmitclean ·expo export --platform iosclean.Notes
Share.share({ message })call (no device needed to compile/typecheck) — safe to land unverified and try on-device whenever.Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>