Skip to content

feat(push): one Live Activity for every linked environment - #907

Merged
trancong12102 merged 1 commit into
mainfrom
feat/push-one-live-activity
Dec 1, 2026
Merged

trancong12102 merged 1 commit into
mainfrom
feat/push-one-live-activity

Conversation

@trancong12102

@trancong12102 trancong12102 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

A phone showed one Live Activity (or Android ongoing notification) per environment, so linking a second machine meant a second card on the Lock Screen. The gateway keeps no state and the app cannot merge cards from the background, so the merge has to happen in an environment.

How it works

  • The phone names one environment for its card (activityHub in the device preferences). Settings → Notifications gets a "Show every environment on one card" choice when more than one environment is saved; the first one added is the default, and "One card per environment" keeps the old behaviour.
  • Every other environment sends its threads to the chosen one over the existing peer link (new POST /api/peer-link/push-activity, admitted only for a link's own session with Linked environments on, like client pairing). The chosen environment answers which devices it now covers. The sender then ends its own card for those devices.
  • The chosen environment merges the threads into its card (title "mac-mini · MacBook Pro"; rows keep their own environment's deep link). A sender resends every 4 minutes while it shows anything; its threads leave the card after 10 minutes of silence, as when a laptop sleeps.
  • A sender that cannot reach the chosen environment, or one too old (linkPushActivity capability), shows its own card. Before the first answer it holds its card instead of starting one it would end again.
  • Alerts stay per environment: only the environment that owns a thread knows when it was seen.

Verification

  • PushNotifications.test.ts: a sender hands its threads over, holds then ends its own card, ignores steps of unchanged work, falls back to its own card when the chosen one is unreachable, and keeps its alerts. The chosen environment merges a linked environment's threads only for devices that chose it, and drops them after the lease.
  • PushActivityRelay.test.ts: report through a real link to a served peer; refused when the peer's Linked environments is off; no request to a peer without the capability.
  • pushRegistration.test.ts: hub choice resolution.
  • vp run check:changed passes.
  • Settings on the iOS simulator with two dev environments (this simulator has eight saved dev environments, all with the same host name):
Settings → Notifications with the one-card choice

Before this change, the section does not exist.

🤖 Generated with Claude Code

Claude Opus 5.5 in Claude Code.

Base automatically changed from fix/push-multi-environment to main December 1, 2026 09:35
A phone showed one Live Activity (or ongoing notification) per environment, so a
second machine meant a second card. The phone now names one environment for its
card (Settings → Notifications, the first one added by default). Every other
environment linked to it hands its threads over the link, and ends its own card
for that phone while the chosen one shows them. A linked environment that goes
quiet, such as a laptop asleep, leaves the card after ten minutes, and one that
cannot reach the chosen environment shows its own card. Alerts stay per
environment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trancong12102
trancong12102 force-pushed the feat/push-one-live-activity branch from 5feb3e7 to 72059d6 Compare December 1, 2026 09:36
@trancong12102
trancong12102 enabled auto-merge (squash) December 1, 2026 09:36
@trancong12102
trancong12102 merged commit 93554c0 into main Dec 1, 2026
20 checks passed
@trancong12102
trancong12102 deleted the feat/push-one-live-activity branch December 1, 2026 09:45
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.

1 participant