Skip to content

Today: debounce the pull-to-sync vessel so per-chunk backfill can't flicker it (#587 follow-up) - #608

Merged
ryanbr merged 1 commit into
mainfrom
fix/pull-to-sync-debounce-per-chunk-flicker
Jul 19, 2026
Merged

ryanbr merged 1 commit into
mainfrom
fix/pull-to-sync-debounce-per-chunk-flicker

Conversation

@ryanbr

@ryanbr ryanbr commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Follow-up to #590 (which fixed #587 — the pull-to-sync vessel vanishing mid-sync). #590 tied the vessel + "Syncing…" label to live.backfilling, which surfaced a flicker the review flagged.

The flicker

state.backfilling toggles false→true between every offload chunk: exitBackfilling() sets it false at each HISTORY_END, then the auto-continue re-kick calls beginBackfill() which sets it true again for the next chunk — with a real BLE round-trip gap in between. So binding the vessel straight to refreshing || live.backfilling strobes it in/out (64 pt height animation + label blink) on every chunk boundary. This is the exact per-chunk toggle the MenuBar header already pins a constant height against (MenuBarContent.syncLine), and it's amplified by #594 (auto-continue cap raised 6→24), which makes a deep backlog drain in up to ~24 chunks in one connection — so up to ~24 flicker cycles.

The fix

Debounce the visibility. A new @State private var syncing drives the body: it goes true instantly when syncingRaw (refreshing || live.backfilling) becomes true, but goes false only after a 3 s quiet window with no new chunk — cancelled the moment the next chunk arrives. So the vessel stays steady through a multi-chunk drain and only drops when the sync is genuinely finished (3 s is comfortably longer than an inter-chunk gap). No visible change for a single-chunk sync or the pull-in-progress/idle states.

Scope

iOS/macOS shared (Strand/Liquid/LiquidTodayView.swift), one file, LiquidRefreshIndicator only. No BLE/protocol change — same live.backfilling read, just debounced. Uses the existing onChangeCompat helper (iOS 17 / macOS 14 split).

Verification

swiftc -parse clean; i18n_audit.py --ci main exit 0 (reuses the existing "Syncing…" key — no new literal). App-target compile confirmed via an on-demand app-build run (see checks).

Note — the other review item is deliberately NOT here

#590's || live.backfilling also makes the vessel appear for BACKGROUND syncs (periodic/on-connect/auto-continue), not just the user's pull. That's a behavior decision (accept "show syncing whenever syncing" vs. gate to pull-initiated), separate from this flicker fix — happy to follow up if you want it gated.

…licker it (#587 follow-up)

Follow-up to #590. That change tied the pull-to-sync vessel + "Syncing…" label to
`live.backfilling`, but that flag toggles false→true between EVERY offload chunk
(exitBackfilling at each HISTORY_END → auto-continue re-kick → beginBackfill), with
a real BLE gap in between. A deep backlog is now up to ~24 chunks in one connection
(#594 raised the auto-continue cap 6→24), so the vessel strobed in/out on every
chunk boundary — the exact per-chunk toggle the MenuBar header already pins a
constant height against.

Debounce the visibility: a new @State `syncing` goes true instantly on syncingRaw,
but goes false only after riding out a 3s quiet window with no new chunk (cancelled
the moment the next chunk arrives). So the vessel stays steady through a multi-chunk
drain and only drops when the sync is genuinely done.

iOS/macOS shared (LiquidTodayView), one file. swiftc -parse clean; i18n audit
exit 0 (reuses the existing "Syncing…" key). App-target compile to be confirmed by
app-build.
@ryanbr
ryanbr merged commit 92eb129 into main Jul 19, 2026
4 checks passed
@ryanbr
ryanbr deleted the fix/pull-to-sync-debounce-per-chunk-flicker branch July 19, 2026 05:36
DX23876 pushed a commit to DX23876/noop that referenced this pull request Jul 22, 2026
…licker it (ryanbr#587 follow-up) (ryanbr#608)

Follow-up to ryanbr#590. That change tied the pull-to-sync vessel + "Syncing…" label to
`live.backfilling`, but that flag toggles false→true between EVERY offload chunk
(exitBackfilling at each HISTORY_END → auto-continue re-kick → beginBackfill), with
a real BLE gap in between. A deep backlog is now up to ~24 chunks in one connection
(ryanbr#594 raised the auto-continue cap 6→24), so the vessel strobed in/out on every
chunk boundary — the exact per-chunk toggle the MenuBar header already pins a
constant height against.

Debounce the visibility: a new @State `syncing` goes true instantly on syncingRaw,
but goes false only after riding out a 3s quiet window with no new chunk (cancelled
the moment the next chunk arrives). So the vessel stays steady through a multi-chunk
drain and only drops when the sync is genuinely done.

iOS/macOS shared (LiquidTodayView), one file. swiftc -parse clean; i18n audit
exit 0 (reuses the existing "Syncing…" key). App-target compile to be confirmed by
app-build.
simoncad7 pushed a commit to simoncad7/noop that referenced this pull request Aug 17, 2026
…licker it (ryanbr#587 follow-up) (ryanbr#608)

Follow-up to ryanbr#590. That change tied the pull-to-sync vessel + "Syncing…" label to
`live.backfilling`, but that flag toggles false→true between EVERY offload chunk
(exitBackfilling at each HISTORY_END → auto-continue re-kick → beginBackfill), with
a real BLE gap in between. A deep backlog is now up to ~24 chunks in one connection
(ryanbr#594 raised the auto-continue cap 6→24), so the vessel strobed in/out on every
chunk boundary — the exact per-chunk toggle the MenuBar header already pins a
constant height against.

Debounce the visibility: a new @State `syncing` goes true instantly on syncingRaw,
but goes false only after riding out a 3s quiet window with no new chunk (cancelled
the moment the next chunk arrives). So the vessel stays steady through a multi-chunk
drain and only drops when the sync is genuinely done.

iOS/macOS shared (LiquidTodayView), one file. swiftc -parse clean; i18n audit
exit 0 (reuses the existing "Syncing…" key). App-target compile to be confirmed by
app-build.
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.

Today pull-to-sync: release shows only a silent liquid animation, no "Syncing…" text, and it ends before the real sync does

1 participant