Restore the focus a thread had (chat or terminal) when switching back to it
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Đọc apps/web/src/lib/terminalFocus.ts và lời gọi khi vào thread trong ChatView.tsx (khoảng dòng 2655); theo dõi cách getTerminalFocusOwner() và hàm dọn dẹp được trả về bởi focusTerminalOnThreadEnter xử lý tiêu điểm. Giữ nguyên hành vi hiển thị terminal rõ ràng từ thanh bên và xác minh các bước tái hiện: khi quay lại thread, tiêu điểm được khôi phục vào ô nhập chat hoặc terminal, tùy vào thành phần đang có tiêu điểm lúc rời đi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 24.8k
- Fork
- 6.4k
- Merge trung bình
- 8 giờ 26 phút
- Pull request đã merge (30 ngày)
- 133
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pingdotgg/t3code
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
via-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
pingdotgg/t3code#33044 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của pingdotgg/t3code
Issue tương tự
-
Absenderzeile über dem Anschriftfeld wird bei Angeboten und Rechnungen am Ende abgeschnittenĐang mởfehler
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Azure/azure-functions-nodejs-extensions#180 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
laaielichter/Threesmith#28 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 2 ngày
-
iso-bmff: add IsoBoxReadView.readUint64 and IsoBoxWriteView.writeUint64 for exact 64-bit fieldsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
streaming-video-technology-alliance/common-media-library#611 ·
Maintainer thường phản hồi trong vòng 1 ngày