sidebar: Fix selection highlight flickering when clicking terminal threads (#64387)

Clear keyboard selection when clicking a terminal thread, as we already
do for agent threads.

The old test cleared selection itself instead of clicking a row. Replace
it with seven scoped tests:

| Test | Action | Expected result |
|---|---|---|
| Different terminal | Terminal A → click Terminal B | B active,
selection cleared |
| Same terminal | Terminal A → click Terminal A | A still active,
selection cleared |
| Different thread | Thread A → click Thread B | B active, selection
cleared |
| Confirm terminal | B active, A selected → Confirm | A active, A still
selected |
| Confirm thread | Thread A selected → Confirm | A active, A still
selected |
| Refocus without selection | Focus outside → sidebar | Search focused,
selection still empty |
| Refocus with selection | Focus outside → sidebar | List focused,
selection preserved |

Each click test starts with the source item active and
keyboard-selected, with the sidebar list focused so the keyboard
highlight is visible.

Before:


https://github.com/user-attachments/assets/eee8bc47-e962-402f-9268-8134dc20ba5b

After:


https://github.com/user-attachments/assets/a437f4c8-b2c0-47d8-99c6-c4600b49c359

Release Notes:

- Fixed the selection highlight flickering in the sidebar when clicking
terminal threads.
d0ae2f05d1Smit Barmase committed on 9/18/2026, 7:17:01 AM· committed by GitHubparent49276a3
2 files changedLine totals unavailable