Skip to content

fix(app): isolate sync ring painting and Device live updates - #23018

Merged
Git-on-my-level merged 3 commits into
mainfrom
lane/home-lag
Oct 21, 2026
Merged

Git-on-my-level merged 3 commits into
mainfrom
lane/home-lag

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Problem and change

The sync ring introduced with episodes v1 repainted the surrounding Home header on every frame. RotationTransition rebuilt at 60 Hz without a repaint boundary. It did not notify a shared provider or rebuild the whole Home page at 60 Hz. Separately, Device settings subscribed to Capture, Sync, Conversation and Episode at its page root, so unrelated metrics/progress updates rebuilt every section and repeated the WAL/today-duration calculations.

The arc now uses CustomPainter(repaint: controller) inside its own RepaintBoundary, leaving its glyph/header unchanged. Its 1,400 ms rotation, faint track, arc, size and stroke stay the same. The controller stops while inactive, outside TickerMode, or under Reduce Motion. Device settings selects its visible capture state and badge and subscribes to stats, Right now and diagnostics within those sections. Existing narrow Home provider selectors remain in place. Battery/charging fields are read only when a connected device’s stats are shown.

No frame-rate timer was found in these paths: the ring already used an AnimationController; Capture metrics sample every 5 seconds, episode polling/row ticks every 30 seconds, device discovery every 10 seconds and health hourly. The defect was escaping paint/rebuild work, rather than an INV-PERF-1 fast-timer violation.

Before and after

Same m5-mbp, Flutter 3.44.5, synthetic providers, 800×600 viewport, 60 explicit frame pumps at 16,667 µs after warmup. Home means the production BatteryInfoWidget in an AppBar; Device is the production DeviceSettings page. This is a scoped reproduction, not a full connected-phone profile.

Counter per 60-frame / one simulated second window Before After
Home idle: header subtree builds / surrounding paints 0 / 0 0 / 0
Home syncing: rotation widget builds / surrounding header paints 60 / 60 0 / 0
Device idle: whole-page builds for 10 Capture+Sync notification pairs 10 0
Device syncing: whole-page builds for the same notification workload 10 0

The notification rate is an injected repeatable stress workload, not a claim about the production rate. The metrics values change; the Device page's other visible inputs remain unchanged. The regression test failed on the original code for both Device cases and the active Home ring, then passed with the fix. Positive controls verify the arc actually paints, the static glyph stays unpainted, pause/sync amounts still update, and the ticker stops and resumes.

Live binding (framePolicy=onlyPumps) host build/layout/paint p95 in the measured windows: Home idle 0.769 → 0.797 ms, Home syncing 2.443 → 0.733 ms, Device idle 21.143 → 1.958 ms, Device syncing 20.789 → 1.210 ms. Host scheduling is noisy; timings are diagnostic and no device FPS or GPU-raster improvement is claimed. The deterministic build/paint counts are the regression gate.

Rerun from app/:

flutter test --no-pub test/perf/sync_indicator_isolation_test.dart
flutter test --no-pub -d flutter-tester integration_test/perf/sync_indicator_perf.dart

Store source and release

The defects are present in 76fee8d44c67112ee6fa7e159e7d628bc4d20cf1, the supplied source of 1.0.569. Its ring blob is 7e06a08d8be0128edb057f7a85e534d6655a776e and Device settings blob is b0dae8b47a94fdd2db1b5f53c5f87b9ff5519481, both identical to the measured pre-fix base 33d7596f4be5. Recommend replacing the review build if the store release must avoid this regression. This PR includes the mobile unreleased changelog so the fix can join the next TestFlight build after normal merge/release approval. No merge, deploy or release dispatch was performed.

Validation and UI evidence

  • 42 focused widget tests passed (isolation, Device controls/Forget Device, semantics inventory and episodes UI).
  • All 23 hermetic mobile journey assertions passed, 0 failed / 0 skipped.
  • Live host performance scenarios passed after the fix; the matching pre-fix isolation cases failed as expected.
  • Mobile UX and UI-isolate ratchets passed.
  • Synthetic still-frame screenshots are pixel-identical before/after for both surfaces. The live synthetic preview was also checked through agent-flutter, including navigation to Device, with no runtime exceptions.
  • Final targeted analysis and both repository preflight commands passed.
  • Device stats and Right now share one inventory pass per unchanged sync-progress notification in the stress workload; capture metrics perform zero inventory scans (asserted).
  • No physical phone is attached. These checks do not establish phone raster performance or physical-device acceptance. No GCP identity/tier was used.

Product invariants affected

INV-PERF-1: keep animation work in the painting leaf and notifications scoped to changed visible inputs. INV-UI-3: retain the existing shared activity-ring primitive and visual design.

Failure-Class: new

Adds FC-mobile-live-indicator-work-escapes-leaf with the reusable rebuild/paint regression suite as its prevention artifact.

UI-Evidence: synthetic host renders (Android theme, Reduce Motion); not phone screenshots. Both before/after pairs are pixel-identical.

001-mobile-android-home-still-before

002-mobile-android-home-still-after

003-mobile-android-device-still-before

004-mobile-android-device-still-after

Measurement metadata

View guided diff Turn on auto-fix

🤖 Generated with Claude Code

Git-on-my-level and others added 2 commits October 21, 2026 16:44
Keep animation frames inside the ring painter and select visible Device page state at the dependent section. Add rebuild, paint, lifecycle and visible-state regression coverage.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Assert one inventory pass per sync update and zero scans for capture metrics. Preserve both surfaces pixel for pixel in still-frame renders.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-21T10:22:06.006165Z 4169cc9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Read battery and charging fields only when a connected device has visible stats, preserving the existing disconnected-page contract.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit b859b78 into main Oct 21, 2026
48 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/home-lag branch October 21, 2026 11:44
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