[Bug]: Cmd+C copies the entire conversation instead of the selection
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- 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ệ
- javascript
Hướng nghiên cứu
Start with the feed's copy listener and the Cmd+A and Mod+C handlers in the bundled renderer, then reproduce the issue with a tall expanded row and a selection inside it. Done means Cmd+C copies only the selection, explicit select-all still produces a transcript, and selections from the diff viewer's open shadow root do not trigger the transcript override.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
GUI version
0.1.40
Operating system
macOS (Apple silicon)
Reproduction steps
- Open a conversation in which a single chat row can fill the mounted window — e.g. a turn whose work trace is expanded, a turn containing a large inline diff, or a very long answer.
- Press
Ctrl+O("Expand or collapse all traces") to expand every trace, or click a turn's "Worked for … · N steps" line to expand just that turn. - Select a few characters inside that turn. A small selection is enough; it does not need to span the conversation.
- Press
Cmd+Cand paste into any text editor.
Expected behavior
Cmd+C copies exactly the current selection. A whole-conversation transcript should only be produced by an explicit select-all action.
Actual behavior
The clipboard receives a plain-text transcript of the entire session — every message, each prefixed with User: / Assistant: — including messages that were never rendered on screen and were never part of the selection. The result is indistinguishable from the app's own select-all. Once it happens it repeats on every subsequent Cmd+C until the selection is cleared, because nothing clears the feed selection after the override.
Contributing factors, from reading the bundled renderer:
- The feed installs a
copylistener that builds a transcript of the whole message list and replaces the clipboard when a geometric predicate passes: the current DOM selection must partially contain (containsNode(row, true)) both the first and the last currently mounted[data-feed-row]element. - Because the feed is virtualized (
increaseViewportBy: {top: 800, bottom: 800}), the mounted rows are only the viewport ± 800 px window. When one tall row fills that window, the first and last row are the same element, so any selection inside that row satisfies the predicate — even three characters. Tall rows are easy to produce: expanding a trace renders the full reasoning text, tool calls and output cards inside a single row. - The predicate is evaluated against the rendered window, but the payload is always the entire session. So the clipboard can contain messages that were never rendered, let alone selected.
Related, same root cause: Mod+C is bound to run.interrupt ("Stops the agent when nothing is selected; copies otherwise"), and the Cmd+A handler only skips INPUT / TEXTAREA / contentEditable targets. Key events originating inside a shadow root are retargeted to the host element, so pressing Cmd+A while focus is inside the diff viewer (diffs-container, an open shadow root) is not excluded — it selects the entire feed, which then trips the transcript override on the next Cmd+C.
Screenshots, recordings, or sanitized logs
Sanitized reconstruction of the predicate (minified identifiers omitted), verified in a stock Chromium 153 harness using the same DOM shape ([data-feed-row] rows inside a scroll container):
const sel = feedEl.ownerDocument.getSelection();
if (!sel || sel.rangeCount === 0 || sel.isCollapsed) return false;
const rows = feedEl.querySelectorAll("[data-feed-row]");
const first = rows[0], last = rows[rows.length - 1];
return sel.containsNode(first, true) && sel.containsNode(last, true);
| setup | predicate result |
|---|---|
| 6 rows mounted, a few characters selected in a middle row | false |
| 6 rows mounted, selection spanning the first to the last mounted row | true |
| 1 row mounted (tall row), 3 characters selected inside it | true |
| selection made inside an open shadow root | false |
Also verified: when the row containing the selection is unmounted, Chromium collapses the selection — so detached/stale selections are not the cause; the geometry alone is.
Fix direction: gate the transcript override on an explicit flag set by the app's own select-all handler instead of inferring intent from selection geometry; if geometry is kept, require full containment (containsNode(row, false)) and emit only the rows actually covered by the selection; clear the feed selection after an override; skip the override when the selection's range root is not the document.
Safety check
- I removed credentials and private project information from this report.
- Ngôn ngữ chính
- Shell
- Star
- 85
- Fork
- 5
- Merge trung bình
- 2 giờ 46 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 CommandCodeAI/desktop
-
[Feedback]: add copy block under a code blockCó thể đã có người làm @aliarain đã nhận 4 ngày trước. Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CommandCodeAI/desktop#94 · 1 người được giao ·
-
[Feedback]: Add Expand & Collapse for changesCó thể đã có người làm @aliarain đã nhận 4 ngày trước. Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
CommandCodeAI/desktop#66 · 1 bình luận · 2 reaction ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
CommandCodeAI/desktop#122 ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
CommandCodeAI/desktop#121 ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
CommandCodeAI/desktop#120 ·
Tất cả issue của CommandCodeAI/desktop
Issue tương tự
-
🎙️ task - fix(deployer): deploy --env prep runs deploy:dev where the repo declares deploy:prepĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
backlog bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
WLAN-Pi/wlanpi-profiler#306 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: backend good first issue priority: P3 - low size: S type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Mizithra/ActiveTerrain#31 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
obra/superpowers#2422 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
ComplianceAsCode/content#15152 ·
Maintainer thường phản hồi trong vòng 3 ngày