Skip to content

feat: add TimelineAction support to TimelinePin - #40

Merged
matejdro merged 2 commits into
pebble-dev:mainfrom
skylord123:feature/timeline-actions
Aug 20, 2026
Merged

feat: add TimelineAction support to TimelinePin#40
matejdro merged 2 commits into
pebble-dev:mainfrom
skylord123:feature/timeline-actions

Conversation

@skylord123

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 7a2ddb9 — switched to UInt, which also let the runtime range check (and the detekt NullableToStringCall failure inside its message) go away entirely. Bundle round-trip stores it as a Long.

@matejdro

Copy link
Copy Markdown
Contributor

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

Compiler-enforced unsigned 32-bit range instead of a runtime require,
per review. Also fixes the detekt NullableToStringCall failure in the
removed require message. Bundle serialization stores it as a Long.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@skylord123

skylord123 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

@matejdro I believe I resolved the failing detekt build. Can you run it again?

@matejdro
matejdro merged commit 6c9ceb5 into pebble-dev:main Aug 20, 2026
1 check passed
@matejdro

Copy link
Copy Markdown
Contributor

thanks!

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