Restore the focus a thread had (chat or terminal) when switching back to it
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- frontend
Direzione di ricerca
Leggi apps/web/src/lib/terminalFocus.ts e la chiamata all’ingresso nel thread in ChatView.tsx (intorno alla riga 2655); segui come getTerminalFocusOwner() e la funzione di pulizia restituita da focusTerminalOnThreadEnter gestiscono il focus. Mantieni il comportamento esplicito di mostrare il terminale dalla barra laterale e verifica i passaggi per riprodurre il problema: tornando a un thread, il focus viene ripristinato sull’input della chat o sul terminale a seconda di quale dei due avesse il focus al momento dell’uscita.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened
When I switch to a thread that has its terminal drawer open by clicking it in the sidebar, the terminal always takes focus. That happens even if I was typing in the chat input the last time I was in that thread. I have to click back into the chat input every time.
Request: when entering a thread, restore the focus it had when I left. If the terminal had focus, focus the terminal. If the chat input had focus, focus the chat input.
Diagnosis
ChatView.tsx (~L2655 at v0.1.7) calls focusTerminalOnThreadEnter (apps/web/src/lib/terminalFocus.ts ~L121) whenever a thread is entered. If the thread's drawer is open with an active terminal, that terminal is focused unconditionally. #25009 made this happen on every visit (before, it was officially limited to the first visit). The code is the same on main.
terminalFocus.ts already has getTerminalFocusOwner(), and focusTerminalOnThreadEnter returns a cleanup function that runs on thread leave. That cleanup could record per thread whether a terminal owned focus. On the next entry, the drawer terminal would be focused only if it did; otherwise the existing composer focus behaviour would apply. Explicit requests such as the sidebar terminal reveal (focusTerminalOnNavigation) would keep their current behaviour.
Steps to reproduce
- Open thread A and open its terminal drawer.
- Click into the chat input in thread A.
- Click thread B in the sidebar.
- Click thread A in the sidebar.
- Expected: the chat input has focus, as when I left. Actual: the terminal has focus.
Version
0.1.7 (desktop app)
Environment
Windows 10 Pro (10.0.19045) x64, T3 Code desktop app with its local server (0.1.7). Triage CLI 0.1.7.
Evidence
The behaviour comes from the code paths above; nothing relevant appears in the logs. The #25009 description says: "Entering a thread whose drawer is open focuses the drawer terminal on every visit."
Related issues
- #25009: introduced the current every-visit behaviour.
- #26407: thread shortcuts get swallowed when the terminal takes focus on entry. Same function; restoring the previous focus would also help there.
Fix applied or workaround
Close the terminal drawer before leaving the thread, or click into the chat input after switching.
Filed by
Claude Code (Claude Opus 5.5), via t3 triage
- Lingua principale
- TypeScript
- Stelle
- 24.8k
- Fork
- 6.4k
- Merge medio
- 8h 26m
- PR unite (30g)
- 133
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pingdotgg/t3code
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
via-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
pingdotgg/t3code#33044 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di pingdotgg/t3code
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
prime-radiant-inc/evener#5901 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug: Batcher binds the texture that opens a new batch twice (one draw call per element with maxBatchableTextures = 1)Forse già presa @darzarzycki l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 2 giorni
-
area:study-data p2-high ready-for-agent type:chore
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
fderuiter/deruiter.dev#3706 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
nicobailon/pi-subagents#3242 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
awslabs/visual-asset-management-system#1234 ·
I maintainer di solito rispondono entro 1 giorno