Watchapp skeleton: app lifecycle, AppMessage inbox, placeholder page transitions (#8) #83
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!83
Loading…
Reference in a new issue
No description provided.
Delete branch "area/watchapp-skeleton"
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 #8, scoped per the issue's 2026-08-31 "view stack becomes a page carousel" update, which supersedes the original body (three-window stack,
view_ride.c/view_nav.c/view_map.c, Up/Down cycling, Back confirmation). That original design is dead; button handling and the real carousel are #60's job, not this one's.What this issue keeps, and what it lands
watchapp/src/c/main.c:init/deinitandapp_event_loop(). This is the watchapp's first real entry point; #75 only scaffolded the toolchain with an essentially-empty placeholder window (watchapp.c), which this replaces.app_message_open(app_message_inbox_size_maximum(), app_message_outbox_size_maximum()), exactly the call the Pebble AppMessage docs themselves recommend. A minimal inbox-received handler is registered before that call, because the docs are explicit that an app with no handler registered gets every inbound message NACK'ed without ever seeing it. That handler currently just logs receipt — decoding tuples into the field store is separate work, out of scope here.heap_bytes_free()logged at page transitions — viapage_view.c/page_view.h, a deliberately minimal placeholder: Select cycles throughpage_default_descriptor()'s three default pages (page.h/page.cfrom #58/PR #81) and renders the active page's name plus its emphasised-slot field viafield_format(). It is not #59's template renderer and not #60's carousel — no skip-a-sourceless-page rule, no Up/Down, no long-press jumps to page 1/the map, no Back confirmation. All of that is docs/DESIGN.md section 5, implemented in #60.basalt(144×168) degradation — same TextLayer-based placeholder, centred, legible. See screenshots below.Files — deviates from the issue's stale list
The issue names
view_ride.c/view_nav.c/view_map.c, which is the pre-carousel design the 2026-08-31 update replaced. Actual files, matching the page-carousel shape #58 already built:watchapp/src/c/main.c(new)watchapp/src/c/page_view.c/page_view.h(new)watchapp/src/c/watchapp.c(deleted — the placeholder window #75 scaffolded)Heap cost of AppMessage — measured, not assumed
Bracketed
heap_bytes_free()around theapp_message_open()call only (not around window/layer setup), on all three emulator targets:emerygabbrobasalt16500 = 8200 (inbox) + 8200 (outbox) + ~100 bytes of AppMessage bookkeeping, and it's identical across all three platforms in this SDK build — the "maximum" buffer size is not actually platform-scaled here, contrary to what I'd have guessed going in. On
basalt's ~61.8 KB total heap that's roughly 73% of the entire heap gone to AppMessage alone before a single window or field buffer exists.emery/gabbrohave ~127 KB total, so the same 16.5 KB is a much smaller bite there. Worth keeping in mind for anything else that wants heap onbasalt.One more thing this surfaced: my first version logged the cost in a single
APP_LOGcall and it silently truncated mid-sentence on the emery emulator (cut off right after(cost) — Pebble'sAPP_LOGhas a buffer limit and the combined message ran past it. Fixed by splitting into twoAPP_LOGcalls (seemain.c); flagging it here since it's exactly the kind of "looks fine until you actually run it" thing D34 exists for.Build / run confirmation
pebble buildis clean foremery,gabbro, andbasalt(all three intargetPlatforms) — no warnings from any new/changed source file.pebble install --emulator <target>).emery's Select button was exercised live in the emulator (pebble emu-button --emulator emery click select) to confirm the placeholder page transition and its heap log both fire correctly: Heap is flat across placeholder transitions (no per-press growth), as expected since nothing allocates there.--correctly shows for the emphasised field since nothing has populated the field store yet (no AppMessage decoding in this issue).Not in this PR (by design)