Focus the `clai2` web UI composer after switching sessions
Merged
MP
1mo ago+101+101+012345678901234567890123456789-47-47-01234567890123456789
Fixes #11283
Why we make these changes
After you click a session in the web UI sidebar, focus stays on the sidebar row, so whatever you type goes nowhere. The composer only focused itself on mount, and switching sessions keeps it mounted. Now, once the picked session shows, App focuses the co... [truncated]
New public surface
none
User-visible behavior
Before: click session B in the sidebar, wait, type: nothing is entered.
After: the keystrokes go into session B's prompt box.
Verification
- New Playwright case
test_switching_sessions_focuses_the_composerintests/clai2/browser/test_web_browser.py. It checks that the composer is focused after a switch and that typing lands in it. It also holds the/openrequest, moves focus to the sess... [truncated] app.jsrebuilt from source withnpm run build(Node v24.22.1) after each rebase ontomain;tests/clai2/test_web_assets.pypasses.tests/clai2/test_web*.py(64 passed), ruff, pyright and pre-commit pass on the changed files.- Browser tests could not run reliably on this machine. In the WSL headless Chromium shell,
requestAnimationFramenever fires, so Playwright clicks time out. Before the rebase, one run of the browser suite passed (4 passed), but later runs were flaky... [truncated]
What changes for existing users
Picking a session from the sidebar now puts the cursor in its prompt box.
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
- PR title is fit for the release changelog.