Skip to content

refactor(mobile): extract settings, diagnostics and editor-document screens from their routes - #19675

Merged
Jinwoo-H merged 11 commits into
mainfrom
pr3-screen-extraction
Sep 10, 2026
Merged

Jinwoo-H merged 11 commits into
mainfrom
pr3-screen-extraction

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​276 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​276
Prod 45 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2682 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2187 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​495

Summary

Moves the body of each listed mobile route out of mobile/app/*.tsx into a props-driven screen component under mobile/src/, leaving the route as a thin mount. A later PR mounts the same components from a second route tree; route files cannot be imported across trees, components can.

The happy path is identical: tap through these eight screens with a healthy connection and nothing looks or behaves differently. There are deliberate behavior changes on the error paths, plus accessibility metadata — all listed below.

Rebased onto main. This was PR 3 of the split of #13386 and was previously stacked on #19669 (pr1-native-adapters); it no longer depends on it.

Routes extracted

Route Before After
settings.tsx 321 16
about.tsx 167 28
notifications.tsx 178 12
native-chat-settings.tsx 126 1
browser-settings.tsx 163 1
voice-settings.tsx 411 25
troubleshoot.tsx 276 18
connection-log.tsx 407 120

Seven are a single mount. connection-log.tsx keeps its native host-selection bindings and mounts one screen with the host picker as a prop.

Also: the workspace creation modal takes onOpenExternalUrl as a prop instead of importing Linking, and the rich markdown editor's document builder is split from its WebView presentation. The split is done from main's own bytes; a test pins the rendered document to main's sha256 and byte length (a checked-in HTML capture would be rewritten by the formatter).

Deliberately not carried from the branch

  • Terminal settings and the session screen (terminal stays native; no extraction needed).
  • The branch's polling diagnostics screen and its rewritten report builder. Main's live useSyncExternalStore wiring and report content are kept.
  • The HTML-preview sanitizer and Mermaid frame CSP. Those are security changes, not extractions; candidates for their own PR along with d2d825b670 (https images in frames), 9e2da765fa (drawer keyboard-lift into an effect) and 328617b8e8 (browser-settings navigability).
  • All .web.tsx variants and *-presentation.tsx splits.

Behavior changes over base

Nothing on the happy path changes. These do, and each is pinned by a test that fails if the behavior is removed:

  1. Errors surface instead of vanishing. A rejected external link on About, or a failed preference read on notifications and browser settings, now renders an error line. On main these were unhandled promise rejections and the user saw nothing.
  2. Voice's first paint is a spinner. Main's loading flag started false, so the screen flashed "Failed to load voice settings." for one frame before the first read landed.
  3. A poll that races a toggle no longer clobbers it. A request-epoch fence drops a dictation read that resolves after you flip the switch. On main that stale read flipped the switch back to the server's old value — visibly, on a slow desktop.
  4. Notifications reflects the persisted value. Toggling now sets the switch from what storage returned rather than from what was requested, so a write that silently fails no longer leaves the switch showing a state that was never saved.
  5. No "Copied!" without a host. connection-log's copied check was copiedHostId === selectedId, which is null === null when no host is selected. It is now explicitly guarded.
  6. Accessibility metadata. Roles, labels and test IDs on the extracted controls — base had six such attributes across these files, this has about forty. This changes what VoiceOver and TalkBack announce.

Everything else the branch's screens had added over base (a disabled-until-loaded notifications switch, a non-optimistic browser-settings write, a remount key on the voice route, a double-tap guard) was found in review and removed.

Found and fixed in review

Extracting Voice dropped base's setLoading(true)-when-setup === null Effect in favour of a one-shot initial flag, so after a failed read the flag stayed false and re-entering the screen left the stale error card up while the retry was already on the wire. Base re-showed the spinner. Fixed by setting the flag from the read that clears it (DictationSetupPollController serialises reads, so no in-flight read can clear a newer one's flag) rather than by restoring the derived-state Effect.

Removed in review

Six capability props on the extracted screens — scope, available and loadLinkMode on browser settings, scope on chat settings, availability on the settings menu, and linksAvailable on About — were extension points for the future route tree that no caller passed. Their defaults made every branch behind them unreachable, including two that would have rendered different copy. Stripped in d6b84f7541; the rendered tree is unchanged except for a disabled={false} that base never set at all.

Rebase note

The rebase onto main dropped one commit, b06d2b5623, which registered the voice adapter in mobile/src/transport/screen-rpc-ratchet.test.ts. That file exists only on pr1-native-adapters; main has no equivalent ratchet, so the commit had nothing to apply to. Nothing else from that branch is carried here.

Verification

  • pnpm --dir mobile typecheck, oxlint, oxfmt --check clean
  • pnpm --dir mobile test: 523 files, 4267 passed, 3 skipped
  • pnpm tc clean; check:code-quality:changed and check:react-doctor:changed: 0 findings across 48 files
  • Neither screen parity digest needed re-freezing
  • Each numbered behavior change above was mutation-tested: removing it turns the suite red

…om their routes

Peel the settings menu, about, notifications, chat-UI and browser-settings
bodies out of their expo-router route files into props-driven components under
mobile/src/settings, leaving each route as a thin mount. No visual change.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Move the voice-settings body onto a VoiceSettingsOperations prop, lift the
troubleshoot diagnostic run into a hook behind a presentational view, and put
the network-diagnostics body behind a device-operations prop. The routes keep
the native bindings (host client acquisition, log store subscription) and mount
the screens. No visual change.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…tions prop

Take the direct Linking.openURL out of SmartWorkspaceSourceField and thread an
openExternalUrl prop from the modal controller, so a second route tree can mount
the create sheet with its own opener. No visual change.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
… presentation

Split the editor document into a body module and a standalone script module so a
host that is not this WebView can serve the same program, and move the message
handling into a controller hook behind a transport. MobileRichMarkdownEditor
stays the only presentation and supplies the injectJavaScript transport. A
snapshot of main's document pins the built HTML byte for byte.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The extracted screen waited for the desktop to confirm before the enable
switch moved and greyed it while saving. Flip the value on tap, reconcile
with the confirmed reply, and refresh on rejection, matching main. The
switch, the dictation-mode segments and the model list carry no
save-time disabled state, also matching main.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
Review found four screens gained state base never had. Notifications no
longer gates its switch on a load flag or a save flag, so the control is
live from first paint and survives a failed read, and its re-entrancy
guard is gone to match base and the voice fix. Browser settings applies
the tapped mode optimistically, starts unbusy and carries no disabled
row. The voice route drops a remount key that wiped screen state when a
second host's null client matched the find. Network diagnostics gates on
the host object again, not on its name or endpoint being non-empty. The
About link failure keeps its message but reads as an error, not a second
version line.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…ture

The checked-in HTML capture failed the repo formatter, and reformatting it
would defeat the byte-identity check. A sha256 plus byte length pins the
same bytes without a file the formatter wants to rewrite.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one minor accessibility nit inline, plus a scope note below.

Reviewed changes

  • Screen extraction — the bodies of settings, about, notifications, native-chat-settings, browser-settings, voice-settings, and troubleshoot moved into props-driven components under mobile/src/, leaving each mobile/app/*.tsx route as a thin mount.
  • Connection diagnostics — the network-diagnostics route keeps its native host-selection wiring and delegates to ConnectionDiagnosticsScreen, backed by a new DiagnosticsDeviceOperations abstraction (native-diagnostics-operations.ts).
  • Rich markdown editor split — the editor document's script is separated from its WebView presentation via a useMobileRichMarkdownEditorController hook, pinned byte-for-byte by a sha256 digest test.
  • Workspace creation — NewWorktreeModal/NewWorktreeFormSheet/SmartWorkspaceSourceField now take onOpenExternalUrl as a prop instead of importing Linking.
  • Accessibility & error surfacing — the extracted controls gain accessibilityRole/accessibilityLabel/testID attributes, and rejected external-link/storage reads now surface an error line instead of being unhandled rejections.

I traced each extracted screen against its removed base implementation and the wiring is faithful — the notification toggle flow (save(value && granted)), the diagnostic copy/send semantics, the voice optimistic flip with the request-epoch fence, and the host picker ordering all match. No behavioral regressions found.

ℹ️ Extracted screens still depend on expo-router

The stated motivation for this refactor is that these components get mounted from a second route tree, but a few of them still reach into router context directly: notification-settings-screen.tsx and pending-credential-cleanup-card.tsx call useFocusEffect unconditionally, and browser-settings-screen.tsx / native-chat-settings-screen.tsx / mobile-settings-menu.tsx fall back to useRouter(). The useRouter sites already have an onBack prop escape hatch, but the two useFocusEffect sites have no equivalent. Worth confirming the second tree supplies a navigation context there, or threading focus/callback props through now rather than after the second tree lands.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

<Pressable
key={mode.value}
accessibilityRole="radio"
aria-checked={active}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use accessibilityState={{ checked: active }} instead of aria-checked here: every other radio/checkbox control in mobile/ conveys selected state via accessibilityState (e.g. PRCommentsSection, MobileNativeChatSessionOptionRows), and aria-checked appears nowhere else in the codebase. It also reads inconsistently next to the sibling accessibilityRole="radio".

…inner

Both were disclosed additions over base with no test that failed when they
were removed: dropping the fence check, dropping the epoch increments, or
starting the loading flag at false all left the suite green.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
scope, available, loadLinkMode, availability and linksAvailable were
extension points for a future route tree that no caller passes, and their
defaults made every branch behind them unreachable. Removing them leaves
the rendered tree unchanged except for a disabled={false} that base never
set at all.

children stays: app/settings.tsx passes the pending-credential-cleanup
card through it.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
…d load

The extraction replaced base's setLoading(true)-on-setup-null Effect with a
one-shot initial flag, so once a read failed the flag stayed false and a
re-entry left the stale error card up while the retry was already on the
wire. Base showed the spinner again.

Set the flag from the read that clears it rather than resurrecting base's
derived-state Effect. DictationSetupPollController serialises reads, so no
in-flight read can clear a newer one's flag.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
The spinner fix sets the flag from refresh, which masked the initial-value
mutation in the sibling test: by the time it asserts, a read has already
raised the flag. Mounting unfocused runs no read, so only useState(true)
decides that paint — which is the frame base flashed the error card in.

Claude-Session: https://claude.ai/code/session_01JNnE9qzUZMMnqpZWCqM3nb
@Jinwoo-H
Jinwoo-H force-pushed the pr3-screen-extraction branch from dc42394 to 2e13465 Compare September 10, 2026 21:53
@Jinwoo-H
Jinwoo-H changed the base branch from pr1-native-adapters to main September 10, 2026 21:53
@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

📝 Walkthrough

Walkthrough

The change extracts mobile settings, troubleshooting, diagnostics, and editor logic into shared components and hooks. Settings routes now provide native navigation and operation adapters. Diagnostics screens support report generation, copying, submission, and cancellable checks. The rich Markdown editor uses shared contracts, a controller hook, and composed WebView script fragments. External URL callbacks now flow from host overlays through worktree modal components. Tests cover generated editor HTML and settings state behavior.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 2e134

This refactor moves several mobile settings and diagnostics screens into shared components without changing the intended behavior. Two edge cases remain where a screen can briefly display a setting value that disagrees with what was saved, and some new diagnostics controls do not announce their role or expanded/disabled state to screen readers. These are small, contained issues that can be fixed quickly or followed up after merge.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the scope, behavior changes, exclusions, and verification results. It does not follow the required template because it omits the ELI5, What Changed, Why, Linked Issue, Visual … Update the description to include all required template sections. Add an ELI5 summary, explicit What Changed and Why sections, a Linked Issue entry with Fixes #..., Visual Proof with screenshots/videos or N/A and a reason, Testing check…
Docstring Coverage ⚠️ Warning Docstring coverage is 5.41% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 37 functions across 48 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: extracting mobile settings, diagnostics, and editor-document logic from route files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the scope, behavior changes, exclusions, and verification results. It does not follow the required template because it omits the ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, AI Disclosure, Review, boundary, Notes, and Checklist sections.

Resolution

Update the description to include all required template sections. Add an ELI5 summary, explicit What Changed and Why sections, a Linked Issue entry with Fixes #..., Visual Proof with screenshots/videos or N/A and a reason, Testing checklist results, AI Disclosure details or the applicable exemption, Review status, Agent skill upstream boundary status, Notes covering the listed compatibility areas, and the required Checklist items.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
mobile/src/diagnostics/troubleshoot-view.tsx (1)

136-139: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add accessibility metadata to the accordion headers.

The accordion header is a disclosure control. It exposes no role and no expanded state to screen readers, so assistive technology announces only the title text. Add accessibilityRole="button" and accessibilityState={{ expanded: expandedId === section.id }}.

The connection-log Pressable at Lines 100-105 has the same gap for accessibilityRole. The back button at Lines 60-64 already sets both attributes, so this keeps the new component internally consistent.

Keep the label text in English. Based on learnings, mobile accessibility labels stay in English until a shared i18n layer exists.

♿ Proposed accessibility metadata
               <Pressable
+                accessibilityRole="button"
+                accessibilityState={{ expanded: expandedId === section.id }}
                 style={({ pressed }) => [styles.accordionHeader, pressed && styles.rowPressed]}
                 onPress={() => toggleSection(section.id)}
               >

Source: Learnings

mobile/src/diagnostics/connection-diagnostics-view.tsx (1)

62-62: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add accessibility metadata to the copy and send controls.

The back control declares accessibilityRole and accessibilityLabel at Lines 44-45. The copy control at Line 62 and the send control at Lines 82-86 declare neither. The send control also sets disabled without accessibilityState, so assistive technology does not announce the disabled state while a submission is in flight.

♿ Proposed fix for the action controls
-            <Pressable style={styles.copyButton} onPress={() => void copyDiagnostics()}>
+            <Pressable
+              accessibilityRole="button"
+              accessibilityLabel="Copy report"
+              style={styles.copyButton}
+              onPress={() => void copyDiagnostics()}
+            >
                   <Pressable
+                    accessibilityRole="button"
+                    accessibilityLabel="Send diagnostics to Orca"
+                    accessibilityState={{ disabled: submissionState === 'sending' }}
                     style={styles.sendButton}
                     onPress={() => void sendDiagnostics()}
                     disabled={submissionState === 'sending'}
                   >

Also applies to: 82-86


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 2f597292-f641-479d-972c-98b346ef0f9e

📥 Commits

Reviewing files that changed from the base of the PR and between 2626e2e and 2e13465.

📒 Files selected for processing (48)
  • mobile/app/about.tsx
  • mobile/app/browser-settings.tsx
  • mobile/app/connection-log.tsx
  • mobile/app/native-chat-settings.tsx
  • mobile/app/notifications.tsx
  • mobile/app/settings.tsx
  • mobile/app/troubleshoot.tsx
  • mobile/app/voice-settings.tsx
  • mobile/src/components/MobileRichMarkdownEditor.tsx
  • mobile/src/components/NewWorktreeFormSheet.tsx
  • mobile/src/components/NewWorktreeModal.tsx
  • mobile/src/components/NewWorktreeModalController.tsx
  • mobile/src/components/SmartWorkspaceSourceField.tsx
  • mobile/src/components/mobile-rich-markdown-editor-contract.ts
  • mobile/src/components/mobile-rich-markdown-editor-document-body.ts
  • mobile/src/components/mobile-rich-markdown-editor-document-suffix.ts
  • mobile/src/components/mobile-rich-markdown-editor-document.test.ts
  • mobile/src/components/mobile-rich-markdown-editor-html.ts
  • mobile/src/components/mobile-rich-markdown-editor-script-primary.ts
  • mobile/src/components/mobile-rich-markdown-editor-script-secondary.ts
  • mobile/src/components/mobile-rich-markdown-editor-script-string.ts
  • mobile/src/components/mobile-rich-markdown-editor-script.ts
  • mobile/src/components/new-worktree-modal-types.ts
  • mobile/src/components/use-mobile-rich-markdown-editor-controller.ts
  • mobile/src/diagnostics/connection-diagnostics-screen-styles.ts
  • mobile/src/diagnostics/connection-diagnostics-screen.tsx
  • mobile/src/diagnostics/connection-diagnostics-view.tsx
  • mobile/src/diagnostics/diagnostics-device-operations.ts
  • mobile/src/diagnostics/native-diagnostics-operations.ts
  • mobile/src/diagnostics/troubleshoot-view.tsx
  • mobile/src/diagnostics/use-troubleshoot-diagnostics.ts
  • mobile/src/host-screen/host-screen-overlays.tsx
  • mobile/src/settings/about-screen.tsx
  • mobile/src/settings/browser-settings-screen.tsx
  • mobile/src/settings/mobile-settings-menu-items.ts
  • mobile/src/settings/mobile-settings-menu.tsx
  • mobile/src/settings/native-chat-settings-screen.tsx
  • mobile/src/settings/native-notification-settings-operations.ts
  • mobile/src/settings/native-voice-settings-operations.ts
  • mobile/src/settings/notification-settings-operations.ts
  • mobile/src/settings/notification-settings-screen.tsx
  • mobile/src/settings/pending-credential-cleanup-card.tsx
  • mobile/src/settings/settings-menu-screen.tsx
  • mobile/src/settings/settings-screen-state.test.tsx
  • mobile/src/settings/voice-settings-operations.ts
  • mobile/src/settings/voice-settings-poller-refresh.test.tsx
  • mobile/src/settings/voice-settings-screen.tsx
  • mobile/src/settings/voice-settings-styles.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 4 remain after this review.

void loadTerminalLinkOpenMode().then(
(mode) => {
if (active) {
setLinkMode(mode)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Do not overwrite a selection with the initial load.

The picker is interactive while loadTerminalLinkOpenMode() is pending. If the user selects a mode first, Line 49 can restore the older persisted mode after the new mode was saved. Ignore the load result after the first user selection.

Proposed fix
-import { useCallback, useEffect, useState } from 'react'
+import { useCallback, useEffect, useRef, useState } from 'react'

+  const didSelectLinkMode = useRef(false)

-        if (active) {
+        if (active && !didSelectLinkMode.current) {
           setLinkMode(mode)
         }

   const selectLinkMode = useCallback((mode: MobileTerminalLinkOpenMode) => {
+    didSelectLinkMode.current = true
     setError(null)
📝 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.

Suggested change
setLinkMode(mode)
if (active && !didSelectLinkMode.current) {
setLinkMode(mode)
}

Comment on lines +29 to +37
const refreshSettings = useCallback(async () => {
const [enabled, permission] = await Promise.all([
operations.preference(),
operations.permission()
])
setPushEnabled(enabled.enabled)
setPermissionState(permission)
setError(null)
}, [operations])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add a stale-response fence to refreshSettings.

refreshSettings has two triggers: the focus effect and the AppState 'active' listener. Neither trigger checks whether its response is still the latest.

Trigger path: the user taps the switch on. operations.permission(true) shows the OS permission alert, so iOS reports 'inactive' and then 'active' when the alert closes. The listener starts refreshSettings, which reads the preference before togglePush writes it. If that read resolves after togglePush calls setPushEnabled(saved.enabled), the screen shows the stale value while storage holds the new value. The same interleaving also clears a toggle error, because refreshSettings calls setError(null).

The voice screen in this cohort already fences reads with a request epoch. Use the same approach here.

♻️ Proposed fence using a request counter
+  const requestEpoch = useRef(0)
+
   const refreshSettings = useCallback(async () => {
+    const epoch = ++requestEpoch.current
     const [enabled, permission] = await Promise.all([
       operations.preference(),
       operations.permission()
     ])
+    if (epoch !== requestEpoch.current) {
+      return
+    }
     setPushEnabled(enabled.enabled)
     setPermissionState(permission)
     setError(null)
   }, [operations])

Also bump requestEpoch.current at the start of togglePush, so an in-flight refresh cannot overwrite the toggle result. Import useRef from react.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No new issues in this incremental delta. The three commits are clean, and the one accessibility nit from the prior review remains open.

Reviewed changes

  • Dropped unused capability props — removed scope, available, loadLinkMode, availability, and linksAvailable from the extracted settings screens. No caller passed them and their defaults made every gated branch unreachable, so the rendered tree is unchanged (only a disabled={false} that base never set).
  • Re-show the voice spinner on a refocus retry — refresh now raises loading itself instead of a derived-state effect, so re-entering after a failed load spins rather than leaving a stale error card. Correct because DictationSetupPollController serialises reads via its inFlight guard, so no in-flight read can clear a newer one's flag.
  • Pinned the spinner's first paint — new tests assert the spinner (not the error card) renders before focus lands and that a refocus retry re-shows it; both fail without the underlying behavior change.

I traced the removed capability props to confirm no residual callers remain, and verified the loading flag churn is invisible during normal polling (setup !== null keeps the spinner branch off). The aria-checked consistency nit on the voice mode selector (voice-settings-screen.tsx:239) is still present, so that thread stays open.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H merged commit 4e16813 into main Sep 10, 2026
1 check passed
@Jinwoo-H
Jinwoo-H deleted the pr3-screen-extraction branch September 10, 2026 23:10
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