Skip to content

feat(ios): measure the Live Activity's progress over the stretch it is shown for - #175

Merged
ififi2017 merged 1 commit into
mainfrom
feat/ios-activity-progress-window
Sep 10, 2026
Merged

feat(ios): measure the Live Activity's progress over the stretch it is shown for#175
ififi2017 merged 1 commit into
mainfrom
feat/ios-activity-progress-window

Conversation

@ififi2017

Copy link
Copy Markdown
Owner

This is a29ec01, which was pushed to #174's branch 45 minutes after #174 had already merged, so it never reached main. Same commit, cherry-picked onto current main. Reported from a device: adding overtime still showed a whole-shift bar, with the lunch pause in it.

What changes

The work countdown is published only for the last 5, 15 or 30 minutes of a shift. Measured against the whole day, its bar arrives ~97% full and crawls three points before clock-off — it looks broken, and it spends the card's only bar restating what the digits above it already say better.

Both meters — the lock-screen bar and the minimal island's ring — now span the activity's own life: from the instant it was scheduled to appear to the end it is counting to. The payload carries that instant as displayStartAtMs, because the extension does not know which lead time the user picked.

  • The segments are the same effective ones, only clipped, so lunch still does not count. With a 15-minute window there is normally no lunch inside it at all, which is what the device report was really about.
  • Overtime needs no special case: the rules bundle already extends the last segment when it is added, so the window grows with it instead of sitting full for the extra time.
  • The percentage in the expanded island moves with the bar. A meter and a number side by side that disagree are worse than either alone.

projectedProgress is untouched for payloads with no window — focus legs, and activities written by an older build. Its habit of taking the shift's own progress as a floor is precisely why the window needed its own function: 96.9% as a floor pins a fifteen-minute bar full from the first frame.

Checks

  • AppTests/LiveActivityWindowTests — 6 tests, -parallel-testing-enabled NO, all passing, re-run on this rebase because it is the first time this change and fix(ios): show whole minutes, not "8:--", on the dimmed lock screen #173 have been built together. They pin the clip, a lunch gap inside a window, overtime, the missing floor, and both fallbacks.
  • npm run check:ios passes.

Two runs before that one reported The test runner hung before establishing connection. — a stale manually-installed app on the simulator, not a source failure. Uninstalling it and rebooting the simulator cleared it.

Note for merging

An activity that is already running when the app updates keeps its old payload and therefore its old whole-shift bar until the next reschedule. Testing this wants a fresh shift rather than the one on screen.

🤖 Generated with Claude Code

…s shown for

The work countdown is published only for the last 5, 15 or 30 minutes of
a shift. Measured against the whole day, its bar arrives about 97% full
and crawls the last three points before clock-off: it looks broken, and
it spends the card's only bar restating what the digits above it already
say better.

Both meters now span the activity's own life — from the moment it was
scheduled to appear to the end it is counting to. The payload carries
that instant as `displayStartAtMs`, because the extension has no idea
what lead time the user picked. The segments are the same effective ones,
only clipped, so lunch still does not count and the bar still holds still
across it. Overtime needs no special case: the rules bundle already
extends the last segment when it is added, so the window grows with it
instead of sitting full for the extra time.

The percentage in the expanded island moves with the bar, because a
meter and a number side by side that disagree are worse than either
alone. `projectedProgress` stays as it is for payloads with no window —
focus legs, and activities written by an older build — and its habit of
taking the shift's own progress as a floor is exactly why the window
needed its own function: 96.9% as a floor pins a fifteen-minute bar full
from the first frame.

`AppTests/LiveActivityWindowTests` pins all of it: the clip, the lunch
gap inside a window, overtime, the missing floor, and the fallbacks.
Six tests, run serially, all passing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
off-work-30 Ready Ready Preview Sep 10, 2026 1:56pm UTC

@github-actions github-actions Bot added the enhancement New feature or request label Sep 10, 2026
@ififi2017
ififi2017 merged commit 9502f1f into main Sep 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant