Skip to content

feat: add TimelineAction support to TimelinePin - #40

Open
skylord123 wants to merge 1 commit into
pebble-dev:mainfrom
skylord123:feature/timeline-actions
Open

feat: add TimelineAction support to TimelinePin#40
skylord123 wants to merge 1 commit into
pebble-dev:mainfrom
skylord123:feature/timeline-actions

Conversation

@skylord123

Copy link
Copy Markdown

Summary

Adds an optional actions list to TimelinePin so companion apps can put actions in a pin's action menu on the watch — most importantly OPEN_WATCH_APP, which launches the watchapp the pin is parented to and passes an optional uint32 launchCode through launch_get_args(), letting the pin deep-link to the content it represents (e.g. a calendar companion opening the exact event).

Mirrors how reminders landed in #14:

  • common-api: TimelineAction(title, type, launchCode) + TimelineActionType (OPEN_WATCH_APP, HTTP), new actions: List<TimelineAction> = emptyList() on TimelinePin, KDoc on all of it. launchCode is validated to the unsigned 32-bit range.
  • common: bundle round-trip (ACTIONS_COUNT / ACTION_n sub-bundles), with the same unknown-type fallback-and-log behavior as TimelineLayoutType.

Older Pebble app builds ignore the extra bundle keys, so pins from apps using this field degrade gracefully (pin inserts, actions dropped) — same compatibility story as reminders.

Host-side support to consume this is being wired into the mobile app's timeline emulator: coredevices/mobileapp#356 makes the emulator emit openWatchApp actions with the LaunchCode BlobDB attribute (firmware already handles the rest — timeline.c launches the pin's parent_id with APP_LAUNCH_TIMELINE_ACTION). A follow-up there will map this model into TimelinePinJson once this is released, the same sequence as #14 → the reminders forwarding PR.

Testing

  • :common-api:check and :common:check pass; :client:assembleRelease / :server:assembleRelease build.
  • Round-trip verified by inspection against the reminder serialization it mirrors.

🤖 Generated with Claude Code

Adds an optional actions list to TimelinePin so companion apps can put
actions in a pin's action menu on the watch. An OPEN_WATCH_APP action
launches the watchapp the pin is parented to, passing an optional uint32
launchCode via launch args so the app can deep-link to the pinned content.

Follows the TimelineReminder pattern from pebble-dev#14: model + KDoc in common-api,
bundle round-trip in common. launchCode is validated to the unsigned
32-bit range.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
public data class TimelineAction(
val title: String,
val type: TimelineActionType = TimelineActionType.OPEN_WATCH_APP,
val launchCode: Long? = null,

@matejdro matejdro Aug 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use UInt instead? That way integer size is enforced by the compiler.

@matejdro

Copy link
Copy Markdown
Contributor

Is looks like detekt build failed, can you check it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants