Lap function #46
Labels
No labels
area:companion
area:docs
area:shared
area:tooling
area:watchapp
blocker
kind:chore
kind:feature
kind:spike
kind:test
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Depends on
#11 Ride state machine: idle / running / paused / stopped
robert/PedalPebble
#58 Field value store and page descriptor model
robert/PedalPebble
Reference
robert/PedalPebble#46
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Mark segments during a ride.
Acceptance criteria
Files
watchapp/src/c/state.ccompanion/.../ride/Closed by PR #115 (
area/lap-function), built as a genuinely cross-platform split: Vela did the watch side, then handed the phone side to a Kestrel sub-agent on the same branch — a good pattern, kept for future cross-cutting issues.All five acceptance criteria addressed:
window_multi_click_subscribe, 300ms window) — chosen after auditing every existing click binding incarousel.c(#60) and finding double-click the one gesture type unclaimed.ride_state_lap_mark()has exactly one observable side effect (queuingRIDE_CMD_LAPon #11's existing dropout-survival queue) and touches none ofRideStateSnapshot's four persisted fields orcheckpoint_dirty— verified both by a real emulator double-click test and by 7 new host C tests (test_state.c, all passing, including no-op cases for idle/paused/stopped/stop-pending and the queue-full drop-newest contract).LapSplitCalculator(phone-side, host-tested) slices the same cumulative moving-distance/time figuresDISTANCE_M/ELAPSED_Salready report ride-wide — a genuinely new average-speed formula since none existed anywhere in this codebase to reuse (checked and stated plainly, not silently claimed as a reuse).FIELD_LAP_*ids #7 already reserved), dismissible early by any button press, skipped (not queued) if a confirmation prompt happens to be showing.LAP_NUMBER/LAP_DISTANCE_M/LAP_TIME_S/LAP_AVG_SPEED_MMSalready existed from #7's original codegen (verified directly inproto.h/Proto.kt/message_keys.json/PROTOCOL.md§2.3 before merging — nothing needed regenerating). GPX representation is a point-level<pp:lap>extension (own reserved-per-RFC-2606.invalidnamespace), not a new<trkseg>— keeps segment boundaries meaning only pause/resume. Honest, tested deviation from D65's literal "closest point" wording:GpxWriter's incremental-flush design means a marker can only attach to the next point written, not retroactively to one already on disk — documented inGpxRecorder's KDoc with a dedicated test.lapsRoom table (RideHistoryDatabase1→2, realMIGRATION_1_2, schema JSON hand-diffed against the SQL), expandable per-ride inRideHistoryScreen.DECISIONS.md D65 records the four real design choices (gesture, split-computation split between watch/phone, summary-as-overlay-not-page, GPX-marker-not-segment) plus the known #4 (real PebbleKit transport) scope gap — nothing calls
RideService.recordLap()or a real inboundCMD=LAPhandler yet, stated openly rather than faked.Real verification, not hand-review:
./gradlew :companion:core:test :companion:pebble:testDebugUnitTest :companion:ride:assembleDebug :companion:assembleDebug --rerun-tasks— full genuine rebuild, all green (LapSplitCalculatorTest 8/8, LapHistoryTest 5/5, GpxWriterTest 20/20, GpxRecorderTest 11/11, LapWireEncodingTest 12/12).pebble buildclean on gabbro/emery/basalt after a fullpebble clean. Host Ctest_state.chand-compiled (no cmake in this sandbox) and run directly: 55/55 passing including all 7 new lap tests,-Wall -Wextra -Werrorclean. Plus a real emulator double-click verification during design (see D65).40 issues closed.