Repository navigation
feat(app): add copy and download actions to text file tabs - #60088
dee-lienardy wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Looks good. I checked it in the e2e harness: with this change a text file tab shows the toolbar, and Copy content and Download work. The new test passed 3 runs in a row and fails without the change. review, side-panels, mobile-plugins and tabs specs pass, apart from the two mobile drawer tests you mentioned. tsc -b in packages/gui-plugins is clean.
The toolbar handles the new optional props: the mode toggle and the "open in browser" entry stay hidden, and the code view keeps its scroll because the text is only read when a button is used.
Public API: unchanged (ArtifactToolbar is internal to gui-plugins).
No blocking concerns.
Related: #58878
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
There was a problem hiding this comment.
The new commits only merge dev and don't touch the files this PR changes, so my earlier review still holds. At the new head, the copy/download e2e test still passes and tsc -b in packages/gui-plugins is clean. Public API: unchanged. No new concerns.
There was a problem hiding this comment.
The new commit only merges dev and doesn't touch the files this PR changes, so my earlier review still holds. At the new head, the copy/download e2e test still passes and tsc -b in packages/gui-plugins is clean. Public API: unchanged. No new concerns.


Issue for this PR
Closes #
Type of change
What does this PR do?
Opening a text file in the file pane gave you no way to copy its content or save it. Non-text files already show a small toolbar with those actions, so I gave the code view the same toolbar instead of inventing a new UI. It reuses
ArtifactToolbar, so text files get Copy content, Download, and Copy path with the existing styles and translations. The only change inside the toolbar is thatmode,meta, andhtmlbecame optional props, because the text view has no preview toggle or metadata.There is also a keeper e2e in
packages/app/e2e/regression/tabs.spec.tsthat copies a file tab's content to the clipboard and downloads it.Left out on purpose: the review diff preview header has no actions either. That can be a follow-up if wanted.
How did you verify your code works?
bun typecheckpasses inpackages/gui-pluginsandpackages/app.bun script/lint-changed.ts origin/devreports 0 problems.tabs.spec.ts. 36 passed. The 2 mobile drawer failures also fail on a cleandevcheckout without this change.Visual
Screenshots / recordings
The new toolbar above a text file, and the File actions menu:
Checklist
Added by the opencode bot (AI-generated).
Related: #58878