Restore the focus a thread had (chat or terminal) when switching back to it
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 72/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- typescript
- Domaine
- frontend
Piste de recherche
Lisez apps/web/src/lib/terminalFocus.ts et l’appel à l’entrée dans le fil dans ChatView.tsx (vers la ligne 2655) ; suivez la façon dont getTerminalFocusOwner() et la fonction de nettoyage renvoyée par focusTerminalOnThreadEnter gèrent le focus. Préservez le comportement explicite d’affichage du terminal depuis la barre latérale et vérifiez les étapes de reproduction : en revenant dans un fil, le focus est rétabli dans le champ de saisie du chat ou dans le terminal selon celui qui l’avait au moment de quitter le fil.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- TypeScript
- Étoiles
- 24.8k
- Forks
- 6.4k
- Merge moyen
- 13 h 9 min
- PR mergées (30 j)
- 187
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de pingdotgg/t3code
-
[Bug]: t3 connect status reports "Exposure: enabled" for publish-only links without a tunnelOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
via-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
via-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
Les mainteneurs répondent en général sous 1 jour
-
via-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: Shows "Open in Zed" when the ZFS Event Daemon is installed asPeut-être pris @danjdewhurst l’a pris il y a 1 jour. Ouvertebug needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de pingdotgg/t3code
Issues similaires
-
bug:unconfirmed
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Heroic-Games-Launcher/HeroicGamesLauncher#6062 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement good first issue help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
Richard-Zhang1019/Crossbow#431 ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: Agent 确认窗口,选项内容过长会超出对话框Ouvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 63/100
EKKOLearnAI/ekko-studio#3761 ·
Les mainteneurs répondent en général sous 1 jour
-
Per line discountOuverteenhancement good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
ruyd/agentic-sdlc-lab#4 · 2 commentaires ·