Repository navigation
Conversation
📝 Walkthrough
Priority: ⬇️ Low Severity of issue fixed: Low Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments: 1
mobile/src/session/mobile-dictation-disabled-controls.test.tsx: 1
1-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd caller-level regression tests for disabled dictation.
The new test covers only
MobileTerminalInputActions. It does not exercise the live or bufferedMobileSessionCommandDockpaths, or the chat caller. Existing tests would still pass if either caller stopped hiding its microphone.Add tests that disable dictation at each caller boundary and assert that the live, buffered, and chat microphone controls are absent.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
af88c500-f5fc-4d42-a31a-09def0bd6ea0
📥 Commits
Reviewing files that changed from the base of the PR and between 2d1ec53 and ae3a973ecdd05270f370337819534597dd78f9af.
📒 Files selected for processing: 7
mobile/src/session/MobileNativeChatOverlay.tsxmobile/src/session/MobileSessionActiveContent.tsxmobile/src/session/MobileSessionCommandDock.tsxmobile/src/session/MobileTerminalInputActions.tsxmobile/src/session/mobile-dictation-disabled-controls.test.tsxmobile/src/session/use-mobile-session-native-chat-dictation.tsmobile/src/session/use-mobile-session-screen-state.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
| @@ -211,6 +212,7 @@ export function useMobileSessionNativeChatDictation( | |||
| try { | |||
| const setup = await fetchDictationSetup(client) | |||
| setDictationMode(setup.dictationMode) | |||
| setDictationEnabled(setup.enabled !== false) | |||
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- changed file and nearby definitions ---'
nl -ba mobile/src/session/use-mobile-session-native-chat-dictation.ts | sed -n '1,280p'
printf '%s\n' '--- references and likely lifecycle symbols ---'
rg -n -F --glob '*.{ts,tsx,md}' -e 'refreshDictationMode' -e 'fetchDictationSetup' -e 'dictationEnabled' -e 'hostId' -e 'session' mobile/src mobile 2>/dev/null | sed -n '1,260p'
printf '%s\n' '--- changed hunks against supplied base ---'
git diff --unified=50 10505696a2c3c9882bbccdadce9a9a6cdcb2d53e ae3a973ecdd05270f370337819534597dd78f9af -- mobile/src/session/use-mobile-session-native-chat-dictation.ts
printf '%s\n' '--- focused tests/docs filenames ---'
rg --files mobile | rg -i '(dictat|session|chat).*(test|spec)|(^|/)(test|tests|docs?)(/|$)' | sed -n '1,240p'Repository: stablyai/orca
Length of output: 41261
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- exact dictation state ownership ---'
rg -n -F --glob '*.{ts,tsx}' -e 'setDictationEnabled' -e 'dictationEnabled' mobile/src | sed -n '1,220p'
printf '%s\n' '--- hook composition and host/session lifecycle ---'
rg -n -F --glob '*.{ts,tsx}' -e 'useMobileSessionNativeChatDictation(' -e 'useMobileSessionFeedbackCapabilities(' -e 'MobileSessionFeedbackCapabilitiesModel' mobile/src/session mobile/src/app mobile/app 2>/dev/null | sed -n '1,260p'
printf '%s\n' '--- setup implementation and consumers ---'
nl -ba mobile/src/dictation/mobile-dictation-setup.ts | sed -n '1,240p'
rg -n -F --glob '*.{ts,tsx,md}' -e 'fetchDictationSetup' -e 'dictationMode' -e 'Voice dictation' mobile/src mobile/docs docs 2>/dev/null | sed -n '1,260p'
printf '%s\n' '--- focused test ---'
nl -ba mobile/src/session/mobile-dictation-disabled-controls.test.tsx | sed -n '1,320p'Repository: stablyai/orca
Length of output: 20778
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- screen state owner ---'
nl -ba mobile/src/session/use-mobile-session-screen-state.ts | sed -n '1,290p'
printf '%s\n' '--- session controller composition ---'
nl -ba mobile/src/session/use-mobile-session-controller.ts | sed -n '1,180p'
printf '%s\n' '--- route/session component lifecycle references ---'
rg -n -F --glob '*.{ts,tsx}' -e 'useMobileSessionController' -e 'useMobileSessionScreenState' -e 'MobileSessionActiveContent' -e 'worktreeId]' -e 'hostId]' mobile/src app 2>/dev/null | sed -n '1,280p'Repository: stablyai/orca
Length of output: 41517
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- session route screen ---'
nl -ba mobile/src/session/MobileSessionRouteScreen.tsx | sed -n '1,180p'
printf '%s\n' '--- app session route ---'
nl -ba 'mobile/app/h/[hostId]/session/[worktreeId].tsx' | sed -n '1,180p'
printf '%s\n' '--- session foundation ---'
nl -ba mobile/src/session/use-mobile-session-foundation.ts | sed -n '1,260p'
printf '%s\n' '--- host client binding ---'
nl -ba mobile/src/transport/host-client-hooks.ts | sed -n '1,130p'Repository: stablyai/orca
Length of output: 15851
Reset dictation visibility when setup refresh fails.
When a refresh follows a change in Voice settings and fetchDictationSetup fails, the catch block keeps the previous dictationEnabled value. If the previous response disabled dictation, the reachable composer can keep its microphone hidden after dictation is enabled on the host. Reset the value to the default enabled state in this fallback.
🐛 Suggested fix
} catch {
// Non-fatal: fall back to the default toggle behavior.
+ setDictationEnabled(true)
}| // False only once the host says Settings ▸ Voice dictation is off; the mic button is then hidden. | ||
| const [dictationEnabled, setDictationEnabled] = useState(true) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '1,100p' mobile/src/session/MobileNativeChatOverlay.tsx
sed -n '215,245p' mobile/src/session/MobileSessionActiveContent.tsx
sed -n '330,375p' mobile/src/session/MobileNativeChatComposer.tsx
sed -n '200,230p' mobile/src/session/use-mobile-session-native-chat-dictation.ts
rg -n 'MobileWebShellScreen|MobileSessionActiveContent|MobileSessionCommandDock|useFocusEffect' mobile/src/session mobile/app/hRepository: stablyai/orca
Length of output: 15193
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- MobileNativeChatOverlay ---'
nl -ba mobile/src/session/MobileNativeChatOverlay.tsx | sed -n '90,230p'
printf '%s\n' '--- MobileNativeChatComposer mic and props ---'
rg -n -F -- 'onMicPress' mobile/src/session/MobileNativeChatComposer.tsx mobile/src/session/use-mobile-native-chat-composer-tray.ts
nl -ba mobile/src/session/MobileNativeChatComposer.tsx | sed -n '1,95p;320,395p'
printf '%s\n' '--- terminal actions and active content ---'
nl -ba mobile/src/session/MobileTerminalInputActions.tsx | sed -n '1,145p'
nl -ba mobile/src/session/MobileSessionActiveContent.tsx | sed -n '1,80p;150,260p'
printf '%s\n' '--- screen state, mounting, and dictation callbacks ---'
nl -ba mobile/src/session/use-mobile-session-screen-state.ts | sed -n '90,155p'
rg -n -F -e 'useMobileSessionScreenState' -e 'MobileSessionContentRow' -e 'handleDictationToggle' -e 'handleDictationPressIn' -e 'handleDictationPressOut' mobile/src/session
nl -ba mobile/src/session/use-mobile-session-native-chat-dictation.ts | sed -n '1,110p;150,235p'Repository: stablyai/orca
Length of output: 43244
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- MobileSessionCommandDock ---'
nl -ba mobile/src/session/MobileSessionCommandDock.tsx | sed -n '1,90p;255,315p;330,380p'
printf '%s\n' '--- MobileSessionContentRow and surface ---'
nl -ba mobile/src/session/MobileSessionContentRow.tsx | sed -n '1,90p'
nl -ba mobile/src/session/MobileSessionSurface.tsx | sed -n '1,70p'
printf '%s\n' '--- controller composition and session screen ---'
nl -ba mobile/src/session/use-mobile-session-controller.ts | sed -n '1,75p'
nl -ba mobile/src/mobile-web-shell/MobileWebShellScreen.tsx | sed -n '1,120p'Repository: stablyai/orca
Length of output: 24259
🏁 Script executed:
set -o pipefail
printf '%s\n' '--- MobileSessionSurface callers ---'
rg -n -F -- 'MobileSessionSurface' mobile/src mobile/app
printf '%s\n' '--- session content loading guards ---'
rg -n -F -e 'MobileSessionSurface' -e 'showLoadingState' -e 'connState' mobile/src/session/MobileSession*.tsx mobile/src/mobile-web-shell mobile/app/h/' || test "$?" -eq 1Repository: stablyai/orca
Length of output: 1136
🏁 Script executed:
nl -ba mobile/src/session/MobileSessionRouteScreen.tsx | sed -n '1,80p'Repository: stablyai/orca
Length of output: 830
Keep microphone controls hidden until dictation setup resolves.
dictationEnabled starts as true, while refreshDictationMode updates it only after fetchDictationSetup resolves. The session mounts MobileSessionSurface immediately. Therefore, a host with dictation disabled can briefly render an actionable terminal or chat microphone before the response sets the state to false.
Initialize the state as disabled and restore the default-enabled fallback when setup fails.
Suggested fix
- // False only once the host says Settings ▸ Voice dictation is off; the mic button is then hidden.
- const [dictationEnabled, setDictationEnabled] = useState(true)
+ // Keep microphone controls hidden until the host reports dictation capability.
+ const [dictationEnabled, setDictationEnabled] = useState(false) } catch {
// Non-fatal: fall back to the default toggle behavior.
+ setDictationEnabled(true)
}ae3a973 to
9b717de
Compare
Honor enabled voice settings across terminal/chat controls and capture. Refresh hold/toggle state on connection, focus and foreground while fencing stale replies. Adversarial review: 63 existing tests plus six disable/late-finish/unmount/settings ownership probes pass; final required CI and aggregate gate pass. Existing native screenshots and microphone lifecycle exercise are attached to the PR. Fixes #30307. Fixes #30511. Adapted from community #30316 and #30513 by @innocarpe. Co-authored-by: Wooseong Kim <[email protected]>
|
Closing as superseded by merged #31349 ( The merged implementation preserves photo attachments and gates capture as well as visible controls. Native before/after screenshots and recording/reconnect exercise are attached to #31349. Before merging, independent adversarial review passed 63 existing tests plus six disable/late-finish/unmount/settings-race probes; CI and aggregate gate passed. Thank you @innocarpe. |
ELI5
Turning voice dictation off in Settings leaves microphone actions visible in the terminal and chat composer. A disabled feature should not keep inviting the user to start it.
What Changed
Carry the host's enabled flag through session state and conditionally show microphone actions in live, buffered and chat input. Keep photo attachment available and retain the existing controls when dictation is enabled.
Why
Use the existing voice setup response rather than introducing another preference or changing capture permissions.
Linked Issue
Fixes #30307
Visual Proof
Actual input-actions component with dictation enabled versus disabled. The attachment action remains visible.
Isolated browser rendering; no native microphone capture is claimed.
Testing
Application typecheck and disabled-control/capture regressions verify that the mic disappears, attachment stays actionable and re-enabling restores dictation.
Changed-file formatting and lint passed. The full mobile suite and a release build were not completed locally; the focused checks above are the local evidence. Physical-device behavior remains unverified. The existing host protocol is retained; remote-host interaction has not been exercised on a physical device.
AI Disclosure
Prepared with OpenAI Codex.
Review
One independently reviewable user behavior.
Agent skill upstream boundary
Checklist