Restore the focus a thread had (chat or terminal) when switching back to it
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- frontend
Línea de trabajo
Lee apps/web/src/lib/terminalFocus.ts y la llamada al entrar en el hilo en ChatView.tsx (alrededor de la línea 2655); sigue cómo getTerminalFocusOwner() y la función de limpieza que devuelve focusTerminalOnThreadEnter gestionan el foco. Conserva el comportamiento explícito de mostrar el terminal desde la barra lateral y verifica los pasos para reproducirlo: al volver a un hilo, se restaura el foco en el campo de entrada del chat o en el terminal según cuál lo tuviera al salir.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- TypeScript
- Estrellas
- 24.8k
- Forks
- 6.4k
- Merge medio
- 8 h 26 min
- PR fusionados (30 d)
- 133
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pingdotgg/t3code
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
via-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
pingdotgg/t3code#33044 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de pingdotgg/t3code
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Azure/azure-functions-nodejs-extensions#180 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 2 días
-
iso-bmff: add IsoBoxReadView.readUint64 and IsoBoxWriteView.writeUint64 for exact 64-bit fieldsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
streaming-video-technology-alliance/common-media-library#611 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
prime-radiant-inc/evener#5901 ·
Los mantenedores suelen responder en 1 día
-
area:frontend kind:bug priority:p3 ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día