Page carousel navigation with long-press jumps (#60) #85
No reviewers
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
robert/PedalPebble!85
Loading…
Reference in a new issue
No description provided.
Delete branch "area/page-carousel"
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?
Closes #60.
Replaces page_view.c's issue #8 placeholder with the real button model from docs/DESIGN.md section 5, wired on top of #58's page descriptors (PR #81) and #11's ride state machine (PR #84).
What changed
page_has_live_field(), #58's primitive built for exactly this) — unless none of the three default pages has data yet (cold boot, before the phone has sent anything), in which case every page counts as visible rather than leaving a blank ring. Only the landing page is ever rendered — a run of skipped pages never flickers past on screen.APP_LOGline and a comment at the call site, not a fake fallback to page 1 (which would make long Up and long Down indistinguishable) and not a silent, unexplained nothing.ride_link_start_pause()); long Select begins a stop confirmation (ride_link_stop_request()); Back leaves the app, confirmed first only if a ride is running or paused. Both confirmations share one on-screen prompt and the same Select/Back roles reversing between "confirm" and "cancel". The stop confirmation readsride_state_stop_pending()directly as its single source of truth (per state.h's own documented expectation that a stray Select during confirmation must route to confirm/cancel, not resume); the exit confirmation is a localcarousel.cflag, since state.h has no "leave the app" primitive and doesn't need one.window_single_click_subscribe()'s own doc says that when a long-click handler is also registered on a button, the single-click handler is held back until the system knows the press wasn't a long one — that's what gives "long-press doesn't also fire the short-press action" for free, no hand-rolled debounce needed.window_long_click_subscribe()'s doc says the back button cannot take a long-click handler at all ("a long press will always terminate the app"), which is why there's no long-Back handling here — and DESIGN.md's own button table has no long-Back row either, so this isn't a gap.PERSIST_KEY_ACTIVE_PAGE_INDEX(added to page.h's key registry,persist_read_int()/persist_write_int()), alongside #58's existingPERSIST_KEY_PAGE_DESCRIPTORS.What's honestly still absent, and why
page_has_live_field()); the carousel has nothing to source "disabled" from until #61 lands.page_view.c vs. carousel.c
Renamed page_view.c/.h to carousel.c/.h in place (git history preserved via
git mv) rather than adding a new carousel.c alongside them. page_view.c's own header comment already said "issue #60 replaces this handler wholesale" — keeping both would just be two files owning one Window and one job. ride_link.h and state.h's comments describing page_view.c as the still-current placeholder are updated to point at carousel.c instead, so nothing in the tree keeps citing stale facts.Verification
pebble buildclean on emery, gabbro and basalt (all threetargetPlatforms).pebble emu-button(click and long-click, both buttons) withpebble logsandpebble screenshotas ground truth:ride_link.c's own logging).Still allocated <0B>, i.e. no leak on exit.heap_bytes_free()logged identical before/after on every single transition throughout the whole run (107512 -> 107512 the entire time on emery).https://claude.ai/code/session_01DAoXbRmJUf2uxNYBfdAXPt