[Bug]: Middle-click closing a right panel tab also pastes the primary selection into the composer on Linux
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
- 76/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ệ
- react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu bằng cách đọc RightPanelTabs.tsx và phần xử lý sự kiện nút chuột giữa trong surface.ts của terminal, sau đó xem issue liên quan #15531 để nắm bối cảnh. Tái hiện lỗi trên Linux khi composer đang được focus và đóng một tab của panel bên phải bằng nút chuột giữa. Hoàn thành khi tab đóng mà không dán vùng chọn chính vào composer.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
- On Linux, select some text anywhere so it goes into the primary selection.
- Open two or more right panel tabs, such as PR, browser, or Files.
- Click into the composer so it has focus.
- Without clicking anywhere else, middle-click one of the right panel tabs to close it.
Expected behavior
The tab closes and nothing is pasted into the composer.
Actual behavior
The tab closes, and the primary selection is also pasted into the composer.
This only happens when the composer has focus right before the middle-click. If I first click on an empty area so the composer loses focus, the middle-click only closes the tab. Middle-clicking a tab doesn't move focus, so the paste lands in whatever editable still has it.
This comes up all the time in my daily workflow: I switch back and forth between the composer and the right panel tabs (PR, browser, Files), so the composer almost always has focus when I go to close a tab.
Likely cause: RightPanelTabs.tsx handles middle-click close (added in #3161). It calls preventDefault() on the middle mousedown and in onAuxClick, but never on the middle mouseup. Chromium pastes the primary selection on Linux at mouseup time, before auxclick fires, so the preventDefault() in handleTabAuxClick runs too late to stop it.
The terminal already handles this: surface.ts cancels the middle mouseup on platforms where isMiddleClickPastePlatform() is true (#11018). The tab handler could add a matching onMouseUp that calls preventDefault() when event.button === 1.
Related: #15531 has the same root cause in the chat timeline. A shared fix, such as a document-level capture mouseup guard for middle-clicks that don't land in an editable, would cover both.
Impact
Minor bug or occasional failure
Version or commit
v0.0.46-nightly.20261005.2667
Environment
Linux (Omarchy / Hyprland, Wayland), T3 Code desktop v0.0.46-nightly.20261005.2667
Workaround
Click on an empty area first so the composer loses focus, or close tabs with the × button instead of a middle-click.
[!NOTE]
This issue was generated by Claude Opus 5.5 (high effort).
- Ngôn ngữ chính
- TypeScript
- Star
- 24.8k
- Fork
- 6.4k
- Merge trung bình
- 13 giờ 9 phút
- Pull request đã merge (30 ngày)
- 271
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]: Side-by-side diff squeezes the "N unmodified lines" divider into the line-number columnĐang mởbug via-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
pingdotgg/t3code#17157 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug via-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
pingdotgg/t3code#17013 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation via-triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 83/100
pingdotgg/t3code#16995 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation via-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
pingdotgg/t3code#16988 · 1 bình luận ·
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 68/100
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ự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
answerLoops/answerLoops#345 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
siyuan-note/siyuan#20313 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
LanternOps/breeze#8254 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
gofish-graphics/gofish-graphics#1084 ·
Maintainer thường phản hồi trong vòng 1 ngày