[BUG] Preview pane auto-refresh steals keyboard focus from chat input while typing (Windows desktop, 2.1.170)
Summary
On the Claude Code desktop app (Windows), when a preview pane / preview server is open and auto-refreshes, keyboard focus is pulled out of the chat input. While typing a message, focus is lost mid-sentence and I have to click back into the chat input box with the mouse — over and over. Composing any message while a preview is open becomes very disruptive.
This is still reproducible on the latest build after updating today (2026-06-10, 2.1.170) — the behavior is unchanged.
Environment
- OS: Windows 11 Pro (10.0.26200)
- Claude Code version: 2.1.170 (just updated)
- Surface: Desktop app (Windows)
- Project workspace: opened over WSL (Ubuntu 24.04). Dev server runs inside WSL (Vite + React, HMR enabled); the preview pane points at that dev server.
Steps to reproduce
- Open a project with a running dev server and keep the preview pane open (e.g. a Vite + React app with HMR).
- Trigger anything that makes the preview reload/refresh (an HMR update, a navigation, or a periodic refresh).
- Start typing a message in the chat input.
- While the preview refreshes, watch the chat input.
Expected
Keyboard focus stays in the chat input regardless of preview-pane refresh/reload. Typing is never interrupted.
Actual
When the preview refreshes, focus is yanked away from the chat input. Subsequent keystrokes don't land in the input — I have to click back into the chat box with the mouse to keep typing. This repeats on every preview refresh.
Impact
Composing any non-trivial message while a preview is open requires constant mouse re-focusing — it directly undermines the type-while-iterating workflow the preview feature is meant to support.