Repository navigation
feat(sync): show sync progress as a share, a frontier time and time remaining - #2751
Open
matthiasthomas wants to merge 1 commit into
Open
matthiasthomas wants to merge 1 commit into
matthiasthomas wants to merge 1 commit into
Conversation
…emaining
The strap does not report how many chunks a history sync will take, so the
Devices card and the Today sync ring could only count chunks ("Syncing…
2,247 chunks", "2,229" in the ring), which says the drain is moving but not
how far it has to go.
The decoded samples carry their own times, though. The Backfiller now
reports each chunk's earliest and latest sample time; LiveState keeps the
session's first sample time, its newest (the frontier) and the session's
start. SyncProgress turns those into a share of the catch-up, the time the
sync has reached, and a time-remaining estimate that accounts for the strap
still recording while it drains (the target moves forward one second per
second, so only the drain's excess speed closes the gap).
- Devices card: "Syncing… 62% · synced up to 1:34 AM · about 12 min left"
plus a progress tube; "finishing up" within the 5-minute caught-up slack.
- Today ring: the percentage replaces the chunk tally in the centre. The
centre readout is now held inside the ring (one line, scales to fit), so a
four-digit value no longer runs into the arc and "100%" no longer
truncates to "10…".
- Spoken labels carry the same summary.
- Falls back to the chunk count until the first chunk decodes.
- Eight new strings, translated into all nine catalogue locales.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Shows how far a history sync has got, not just that it is moving. The Devices card and the Today sync ring could only count chunks ("Syncing… 2,247 chunks", and "2,229" in the ring), because the strap never says how many chunks a sync will take. During a long catch-up there was no way to tell whether it would take two minutes or an hour.
The decoded samples carry their own times, so progress can be measured in time instead of chunks:
Backfillerreports each decoded chunk's earliest and latest sample time through a newonChunkDataRangecallback (defaultnil).LiveStatekeeps the session's first sample time, its newest sample time (the frontier), and when the session started. All three reset withsyncChunksThisSessioninbeginBackfill.SyncProgress(pure, unit-tested) turns those into:LiveState.syncChunksThisSession's comment says a count was used because "total pending is unknowable from the protocol". That is still true in chunks. This measures in seconds of data instead, which the protocol does give.What changes on screen:
LiquidTubeprogress bar. It shows the chunk count until the first chunk decodes.ChargeSyncIndicator): the percentage replaces the chunk tally in the centre. The centre readout is now held inside the ring: one line, scaling to fit. A four-digit value no longer runs into the arc, and "100%" no longer truncates to "10…".This screenshot was taken before the last tweak: at 100% the card now says "finishing up" rather than "less than a minute left".
Today ring during a catch-up, with the percentage held inside the arc (previously a four-digit chunk tally ran into the ring, and "100%" truncated to "10…"):
Not changed:
SyncActivityCopystill uses the chunk count.Type of change
How it was tested
SyncProgressTests(6 tests) cover:StrandTests(macOS): 2,285 tests ran on this branch. Two failures are timezone-dependent and unrelated to this change:SkinTempAbsoluteDisplayTestsandSleepCarriedStampTestsfail in America/New_York and pass withTEST_RUNNER_TZ=UTC.StrandDesignpackage:swift testruns 134 tests with 0 failures.Tools/i18n_audit.py --ci upstream/mainpasses. There are 8 new strings, translated into de, es, fr, it, pl, pt-PT, ru, zh-Hans and zh-Hant. The minute and hour wordings use invariant abbreviations ("мин", "godz."), so no plural variants are needed.Tools/doc_comment_lint.pyreports no new detached doc comments.python3 -m unittest discoverinTools/has 4 failures intest_check_source_references. They fail identically on an untouchedupstream/maincheckout on this machine.NOOPiOSscheme embeds.LiquidTodayView,DevicesViewand the StrandDesign change are shared, soapp-build.ymlis the check there.Checklist
swift testinPackages/StrandDesign)android/: n/a,android/not touchedStrandDesigntokens — no hardcoded colors, fonts, or spacing (new ring constants live inSyncRing, next to the existing ones)docs/CONTRIBUTING.mdStrand.xcodeproj/) or any secrets/keystoresRelated issues
None found.
🤖 Generated with Claude Code