@@ -230,9 +230,12 @@ function ModeIndicator({
230230 proactiveModule ?. getNextTickAt ?? NULL ,
231231 NULL ,
232232 ) ;
233- const voiceEnabled = feature ( 'VOICE_MODE' ) ? useVoiceEnabled ( ) : false ;
234- const voiceState = feature ( 'VOICE_MODE' ) ? useVoiceState ( s => s . voiceState ) : ( 'idle' as const ) ;
235- const voiceWarmingUp = feature ( 'VOICE_MODE' ) ? useVoiceState ( s => s . voiceWarmingUp ) : false ;
233+ const voiceEnabledRaw = useVoiceEnabled ( ) ;
234+ const voiceEnabled = feature ( 'VOICE_MODE' ) ? voiceEnabledRaw : false ;
235+ const voiceStateRaw = useVoiceState ( s => s . voiceState ) ;
236+ const voiceState = feature ( 'VOICE_MODE' ) ? voiceStateRaw : ( 'idle' as const ) ;
237+ const voiceWarmingUpRaw = useVoiceState ( s => s . voiceWarmingUp ) ;
238+ const voiceWarmingUp = feature ( 'VOICE_MODE' ) ? voiceWarmingUpRaw : false ;
236239 const hasSelection = useHasSelection ( ) ;
237240 const selGetState = useSelection ( ) . getState ;
238241 const hasNextTick = nextTickAt !== null ;
@@ -250,16 +253,19 @@ function ModeIndicator({
250253 const escShortcut = useShortcutDisplay ( 'chat:cancel' , 'Chat' , 'esc' ) . toLowerCase ( ) ;
251254 const todosShortcut = useShortcutDisplay ( 'app:toggleTodos' , 'Global' , 'ctrl+t' ) ;
252255 const killAgentsShortcut = useShortcutDisplay ( 'chat:killAgents' , 'Chat' , 'ctrl+x ctrl+k' ) ;
253- const voiceKeyShortcut = feature ( 'VOICE_MODE' ) ? useShortcutDisplay ( 'voice:pushToTalk' , 'Chat' , 'Space' ) : '' ;
256+ const voiceKeyShortcutRaw = useShortcutDisplay ( 'voice:pushToTalk' , 'Chat' , 'Space' ) ;
257+ const voiceKeyShortcut = feature ( 'VOICE_MODE' ) ? voiceKeyShortcutRaw : '' ;
254258 // Captured at mount so the hint doesn't flicker mid-session if another
255259 // CC instance increments the counter. Incremented once via useEffect the
256260 // first time voice is enabled in this session — approximates "hint was
257261 // shown" without tracking the exact render-time condition (which depends
258262 // on parts/hintParts computed after the early-return hooks boundary).
259- const [ voiceHintUnderCap ] = feature ( 'VOICE_MODE' )
260- ? useState ( ( ) => ( getGlobalConfig ( ) . voiceFooterHintSeenCount ?? 0 ) < MAX_VOICE_HINT_SHOWS )
261- : [ false ] ;
262- const voiceHintIncrementedRef = feature ( 'VOICE_MODE' ) ? useRef ( false ) : null ;
263+ const [ voiceHintUnderCapRaw ] = useState (
264+ ( ) => ( getGlobalConfig ( ) . voiceFooterHintSeenCount ?? 0 ) < MAX_VOICE_HINT_SHOWS ,
265+ ) ;
266+ const voiceHintUnderCap = feature ( 'VOICE_MODE' ) ? voiceHintUnderCapRaw : false ;
267+ const voiceHintIncrementedRefRaw = useRef ( false ) ;
268+ const voiceHintIncrementedRef = feature ( 'VOICE_MODE' ) ? voiceHintIncrementedRefRaw : null ;
263269 useEffect ( ( ) => {
264270 if ( feature ( 'VOICE_MODE' ) ) {
265271 if ( ! voiceEnabled || ! voiceHintUnderCap ) return ;
0 commit comments