You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: web review-panel copy content button #58878
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
I want a "copy file content to clipboard" button in the web review-panel. It's actually difficult to copy manually, because double-clicking opens the "add comment" panel, which cancels the double-click-select-effect.
Thanks for the suggestion, @divinity76! You're asking for a button in the web review panel that copies a file's full content, since copying by hand is awkward when double-clicking opens the add-comment panel and cancels the selection.
May I contribute a Copy file contents action in the review file header? It would copy the complete current text, not diff hunks, with clipboard success/error feedback. Deleted files would use complete old text when available; binary or unavailable content would not overwrite the clipboard.
I have a local implementation prepared with AI assistance, but have not opened a PR. I should have requested design review before implementing it. Is this approach approved for an implementation PR, or would you prefer a different scope?
Confirming this affects the desktop app's file panel too (not just the web review panel), plus the root cause from source so the fix can be targeted.
Repro on desktop 2.2.7 (remote-SSH mode): open a plain-text file (e.g. a .sql file) in the right-hand file panel and click once on a line — the comment editor opens immediately. A single click is enough; a drag is not required.
Root cause:
packages/gui-plugins/src/file/view.tsx:489 passes enableLineSelection to the file viewer unconditionally — there is no setting to turn it off.
packages/session-ui/src/components/file.tsx:325 — handleMouseDown only checks event.button !== 0; it does not check altKey/shiftKey/metaKey/ctrlKey, so holding a modifier does not bypass the gesture.
packages/session-ui/src/pierre/selection-machine.ts:274-278 — a press with no movement still produces a single-line range, which is why a bare click is enough.
packages/session-ui/src/components/line-comment-machine.ts:71-76 — line.selection-ended with a non-null range calls openDraft, which renders the editor.
The code view renders with no toolbar at all (view.tsx:508), unlike the artifact view, which has a working "Copy content" button (artifact-toolbar.tsx:97) already covered by an e2e test (packages/app/e2e/regression/review.spec.ts:917).
Note on #59785: that PR adds the copy action to the review panel header, so the file panel still has no copy affordance once it lands. It would be good to either reuse the same action in the file panel, or gate enableLineSelection behind a user setting — the review panel already gates it on a prop (session-review-file-preview-v2.tsx:120,194), so the plumbing exists.
One more thing worth fixing while here: the comment editor auto-focuses its textarea on open (line-comment.tsx:326), which discards the text selection the viewer had just restored (selection-bridge.ts:88). So "drag to select, then Ctrl/Cmd+C" does not work either, even though the viewer goes to the trouble of preserving the selection.
Activity
opencode-agent commentedon Oct 25, 2026
Thanks for the suggestion, @divinity76! You're asking for a button in the web review panel that copies a file's full content, since copying by hand is awkward when double-clicking opens the add-comment panel and cancels the selection.
Maintainers will consider it. A related request:
lancy69 commentedon Oct 27, 2026
May I contribute a Copy file contents action in the review file header? It would copy the complete current text, not diff hunks, with clipboard success/error feedback. Deleted files would use complete old text when available; binary or unavailable content would not overwrite the clipboard.
I have a local implementation prepared with AI assistance, but have not opened a PR. I should have requested design review before implementing it. Is this approach approved for an implementation PR, or would you prefer a different scope?
divinity76 commentedon Oct 27, 2026
@lancy69 i recommend just sending the PR asap, worst they can do is close the PR
lancy69 commentedon Oct 28, 2026
Got it. I'll make a PR now :)
ESwordCn commentedon Nov 11, 2026
Confirming this affects the desktop app's file panel too (not just the web review panel), plus the root cause from source so the fix can be targeted.
Repro on desktop 2.2.7 (remote-SSH mode): open a plain-text file (e.g. a
.sqlfile) in the right-hand file panel and click once on a line — the comment editor opens immediately. A single click is enough; a drag is not required.Root cause:
packages/gui-plugins/src/file/view.tsx:489passesenableLineSelectionto the file viewer unconditionally — there is no setting to turn it off.packages/session-ui/src/components/file.tsx:325—handleMouseDownonly checksevent.button !== 0; it does not checkaltKey/shiftKey/metaKey/ctrlKey, so holding a modifier does not bypass the gesture.packages/session-ui/src/pierre/selection-machine.ts:274-278— a press with no movement still produces a single-line range, which is why a bare click is enough.packages/session-ui/src/components/line-comment-machine.ts:71-76—line.selection-endedwith a non-null range callsopenDraft, which renders the editor.view.tsx:508), unlike the artifact view, which has a working "Copy content" button (artifact-toolbar.tsx:97) already covered by an e2e test (packages/app/e2e/regression/review.spec.ts:917).Note on #59785: that PR adds the copy action to the review panel header, so the file panel still has no copy affordance once it lands. It would be good to either reuse the same action in the file panel, or gate
enableLineSelectionbehind a user setting — the review panel already gates it on a prop (session-review-file-preview-v2.tsx:120,194), so the plumbing exists.One more thing worth fixing while here: the comment editor auto-focuses its textarea on open (
line-comment.tsx:326), which discards the text selection the viewer had just restored (selection-bridge.ts:88). So "drag to select, then Ctrl/Cmd+C" does not work either, even though the viewer goes to the trouble of preserving the selection.