MCPcopy Index your code
hub / github.com/codeaashu/claude-code / onFocusChange

Function onFocusChange

src/hooks/useAwaySummary.ts:92–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

90 }
91
92 function onFocusChange(): void {
93 const state = getTerminalFocusState()
94 if (state === 'blurred') {
95 clearTimer()
96 timerRef.current = setTimeout(onBlurTimerFire, BLUR_DELAY_MS)
97 } else if (state === 'focused') {
98 clearTimer()
99 abortInFlight()
100 pendingRef.current = false
101 }
102 // 'unknown' → no-op
103 }
104
105 const unsubscribe = subscribeTerminalFocus(onFocusChange)
106 // Handle the case where we're already blurred when the effect mounts

Callers 1

useAwaySummaryFunction · 0.85

Calls 3

getTerminalFocusStateFunction · 0.85
abortInFlightFunction · 0.85
clearTimerFunction · 0.70

Tested by

no test coverage detected