mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-11 17:53:56 +01:00
Pure-Dart TCX codec pinned to the PC's RunnerUp parser by a shared golden fixture (Dart byte-compare + pytest through the real verifier), GPS filters and moving-time maths mirroring the PC walk rule, runs / run_points tables (schema v9), PositionSource seam over geolocator, location permissions and foreground service type, map/cache deps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzxdWZ9CKZsNxtD5Jr9bYD
1.7 KiB
1.7 KiB
Workout App Context
Current Task
Implementing design_v2.md improvements.
Key Decisions
- Active session persisted to SQLite on every tap so force-kill is safe
- Back button: PopScope is still present and pins the route in lock mode (workout_screen.dart) — the older "PopScope removed" note here was wrong
- Auto-resume: HomeScreen auto-navigates to workout on first load if session exists
- Break timing is wall-clock (
BreakClock), never a tick counter: Android throttles and Doze suspends timers in a backgrounded isolate - A
flutter_foreground_taskservice owns the deadline for the whole workout and shows the status-bar notification; notification presses go through a durable prefs queue, never straight into sqflite (the CRDT sync layer owns that database's ordering)
GPS runs (foundation, 2026-11-10)
- The app records runs/walks itself and uploads a TCX the PC credits unchanged.
Contract = the PC parser, pinned by
screen_locker/tests/fixtures/run_tcx/(Darttest/services/tcx_golden_fixture_test.dart<-> pytestscreen_locker/tests/test_run_tcx_golden.py). Regenerate after a deliberate codec change:UPDATE_GOLDEN=1 flutter test test/services/tcx_golden_fixture_test.dart. - File name
RunnerUp_YYYY-MM-DD-HH-MM-SS_<Running|Walking>.tcx, stamp in LOCAL time;<Id>/<Time>UTCZ; source tagkuhy workout_appinAuthor/Name+Creator/Name. - Trackpoints must be <= 30 s apart with cumulative
DistanceMeters, or the PC credits no walking time (lib/services/run_math.dartmirrors that rule). - Thresholds that decide credit (3.5 km / 25 min) live on the PC only.
- GPS sits behind
PositionSource(position_source*.dart); imported RunnerUp runs are stored withupload_state='never'(table CHECK).