Repository navigation
fix(mobile): keep the working rings turning on the OTA page - #25299
Conversation
Animated.loop starts a native loop whenever the timing asks for the native driver; the web has none, so the JS fallback ran one turn and froze at 360deg. Ask for the native driver only off the web. Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughAgentSpinner and AgentStateDot now use the shared useWorkingRingRotation hook for their working-state rotations. The hook enables the native animation driver except on web. Component tests check native-driver settings on iOS. A browser test conditionally builds and serves a probe app, then samples both rings in headless Chromium and checks for render faults and page errors. Priority: ➖ Normal Merge Risk: 🔵 Low · up to The animation change is mergeable with a bounded test concern: on a slow browser run, the probe may not get its intended 60-second wait. Correct the test options to make that check reliable. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a9f64e4e-e7ce-40d1-9d48-9c5476d88b90
📒 Files selected for processing (4)
config/scripts/mobile-web-app-working-spinner-render.test.mjsmobile/src/components/AgentSpinner.tsxmobile/src/components/AgentStateDot.tsxmobile/src/components/agent-monitoring-indicators.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
| () => | ||
| globalThis.__orcaWorkingSpinnerProbe !== undefined || | ||
| (globalThis.__orcaRenderCheckFaults ?? []).length > 0, | ||
| { timeout: 60_000, polling: 100 } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Pass the wait options as the third argument.
page.waitForFunction treats the second argument as input to the predicate, not as options. If the probe does not appear, this call does not apply the intended 60-second timeout or 100 ms polling interval. Pass undefined as the second argument so a failed render reports promptly. (playwright.dev)
Proposed fix
- { timeout: 60_000, polling: 100 }
+ undefined,
+ { timeout: 60_000, polling: 100 }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| { timeout: 60_000, polling: 100 } | |
| undefined, | |
| { timeout: 60_000, polling: 100 } |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Single-timing loops opt out of the native driver on web —
AgentSpinner.tsxandAgentStateDot.tsxnow passuseNativeDriver: Platform.OS !== 'web', so the rotation loops run on the JS path on the page instead of stalling after one turn. Native keeps the native driver. - Page regression test — a new Chromium render test (
mobile-web-app-working-spinner-render.test.mjs) mounts both rings on a probe route and asserts the sampled rotation transforms from 1.3 s on are all distinct, which fails on the buggy code. - Native driver pin —
agent-monitoring-indicators.test.tsadds aPlatform.OS: 'ios'mock and asserts the timing is created withuseNativeDriver: trueon native.
The root cause is accurate against react-native-web 0.21.3: Animated.loop branches on the raw useNativeDriver flag via _isUsingNativeDriver(), so a native-flagged single timing takes _startNativeLoop and never installs the JS restart recursion; on web the timing resolves to the JS thread and runs once. sequence/parallel report _isUsingNativeDriver() === false, so the three other Animated.loop sites in mobile/ (all sequences) are genuinely unaffected — the fix is complete for the affected class.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This re-review covers the single commit since the prior pullfrog approval at b1144bf.
- Rotated the shared spin effect into
useWorkingRingRotation—AgentSpinner.tsxandAgentStateDot.tsxnow call one hook that owns theAnimated.Value, the conditionalAnimated.loop(Animated.timing(...)), and the0deg→360deginterpolation;useNativeDriver: Platform.OS !== 'web'and its one-lineWhy:comment moved with it. - Consolidated the native-driver test —
agent-monitoring-indicators.test.tsnow renders both rings together and assertsAnimated.timingis called twice, both withuseNativeDriver: true, replacing the earlier single-component assertion. - Trimmed the render-test samples —
mobile-web-app-working-spinner-render.test.mjsdrops the two pre-1.3 s samples that were diagnostic only; the three post-1.3 s angles still must all differ, which is what catches the one-turn stall (all samples readrotate(360deg)on the buggy code).
I checked the extraction against the pre-refactor behavior: active captures exactly the old effect condition (status === 'working' && !monitoring), so the trigger set is unchanged; monitoring and non-working transitions still reset the value to 0; and the animation.stop() cleanup is preserved. The hook is invoked before both early returns so hook order stays stable, and the only AgentSpinner caller (WorktreeListRow.tsx:116) passes the same status/workingMode props.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This re-review covers the single commit since the prior pullfrog approval at b1144bf.
- Rotated the shared spin effect into
useWorkingRingRotation—AgentSpinner.tsxandAgentStateDot.tsxnow call one hook that owns theAnimated.Value, the conditionalAnimated.loop(Animated.timing(...)), and the0deg→360deginterpolation;useNativeDriver: Platform.OS !== 'web'and its one-lineWhy:comment moved with it. - Consolidated the native-driver test —
agent-monitoring-indicators.test.tsnow renders both rings together and assertsAnimated.timingis called twice, both withuseNativeDriver: true, replacing the earlier single-component assertion. - Trimmed the render-test samples —
mobile-web-app-working-spinner-render.test.mjsdrops the two pre-1.3 s samples that were diagnostic only; the three post-1.3 s angles still must all differ, which is what catches the one-turn stall (all samples readrotate(360deg)on the buggy code).
I checked the extraction against the pre-refactor behavior: active captures exactly the old effect condition (status === 'working' && !monitoring), so the trigger set is unchanged; monitoring and non-working transitions still reset the value to 0; and the animation.stop() cleanup is preserved. The hook is invoked before both early returns so hook order stays stable, and the only AgentSpinner caller (WorktreeListRow.tsx:116) passes the same status/workingMode props.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

What
On the OTA page the yellow "working" rings in the workspaces list (the workspace row's
AgentSpinnerand the agent line'sAgentStateDot) turned once and then sat still. Native animates.Cause. Both run
Animated.loop(Animated.timing(…, { useNativeDriver: true })). React Native's loop decides by the raw flag, not by whether a native driver exists: withtrueit hands the timing to the native loop. On the web there is no native animated module, so the timing falls back to JS and runs exactly once; the JS path never reads the loop's iteration count. Measured in the page render rig: 3°, 147°, thenrotate(360deg)at every sample from 1.3 s on. Loops of anAnimated.sequence(the chat's three dots, the tool-run pulse) take the JS loop path and were never affected.Fix. The two components ran the same fifteen-line spin effect; it now lives once in
useWorkingRingRotation, which setsuseNativeDriver: Platform.OS !== 'web'with a one-line why. Native keeps the native driver and is unchanged; the page takes the JS loop. Each component keeps its own status branches. No web sibling; the branch is net smaller than main.Cost on the page. The JS loop re-renders each ring per frame. Six spinners and a dot measured about 0.5 ms script per frame in headless desktop Chromium (CDP
Performance.getMetrics). A phone WebView is slower; a list with five to seven working rings should land around two to three milliseconds a frame. If real lists often show more than ten working rings, or page scroll drops under 60 fps with rings on screen, the follow-up is a CSS-keyframe web sibling that runs on the compositor.Tests (red first)
config/scripts/mobile-web-app-working-spinner-render.test.mjs(Chromium): mounts both rings on a probe route and samples the inline transform at 1.3, 1.8 and 2.4 s; the three angles must all differ. Red:ring 0 after 1.3 s: rotate(360deg), rotate(360deg), rotate(360deg): expected 1 to be 3, and the same for ring 1 with only the spinner fixed.agent-monitoring-indicators.test.tsgains a case rendering both rings under its iOS mock and asserting each timing is created withuseNativeDriver: true, so native cannot lose the driver by accident.Ships over the air; no shell change.