mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-21 15:41:17 +00:00
Codex review of the first pass found a stale-closure bug: createXTermRuntime captures its ctx once (the effect only re-runs on host.id/sessionId change), so the original requestSearchFocus — which branched on a captured isSearchOpen — locked in the initial state and never bumped the focus token on later Cmd/Ctrl+F presses. Make requestSearchFocus state-independent: always setIsSearchOpen(true) and bump the focus token. When closed, opening mounts the SearchBar (isOpen effect focuses); when open, the token bump refocuses. The callback now has a stable identity and behaves correctly regardless of when it was captured. Also drop the now-unused setIsSearchOpen from the runtime ctx type and its ref/construction sites. Co-Authored-By: Claude <noreply@anthropic.com>