Skip to content

[FEATURE]: web review-panel copy content button #58878

Open

Description

@divinity76

Feature hasn't been suggested before.

  • 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.

Image

Activity

  1. opencode-agent commented on Oct 25, 2026

    @opencode-agent
    Contributor

    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:

  2. lancy69 commented on Oct 27, 2026

    @lancy69

    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?

  3. divinity76 commented on Oct 27, 2026

    @divinity76
    Author

    @lancy69 i recommend just sending the PR asap, worst they can do is close the PR

  4. lancy69 commented on Oct 28, 2026

    @lancy69

    Got it. I'll make a PR now :)

  5. ESwordCn commented on Nov 11, 2026

    @ESwordCn

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions