Skip to content

Copy a previewed file's contents from the Files header - #115

Open
ShriD5 wants to merge 2 commits into
mainfrom
t3-watch/2026-11-21-copy-file-contents
Open

ShriD5 wants to merge 2 commits into
mainfrom
t3-watch/2026-11-21-copy-file-contents

Conversation

@ShriD5

@ShriD5 ShriD5 commented Nov 21, 2026

Copy link
Copy Markdown
Owner

What T3 added (pingdotgg/t3code@07fe456146): a copy button in the file preview toolbar that copies the whole file. It shows "Copied" with a check for a moment, and is hidden for media, documents and truncated reads.

How Godspeed does it

  • FileDocument::copyable_text (crates/ui/src/files/document.rs) returns the file only when the read is complete: not loading or errored, not truncated, has text, and isn't empty.
  • A files-copy-contents toolbar button in the Files header (render_breadcrumb, crates/ui/src/files/preview.rs) sits before "Open in default editor". It copies the editor's live text, so unsaved edits come along, and falls back to the text as read. The icon turns into a check and the tooltip reads "Copied" for 1.2s, the same as the Markdown code-block copy. The rendered Markdown view doesn't show the button.
  • Also logs T3 through 0dc32b5c8b in docs/godspeed/T3-WATCH.md (217 commits) and adds rows to T3-GAPS.md.

Screenshots not available (this agent doesn't launch the GUI).

Tests run

  • New: only_a_complete_non_empty_read_can_be_copied
  • cargo build -p godspeed: ok. cargo check --workspace --tests: ok.
  • cargo test -p zeron-ui --lib: 2188 passed, 0 failed.

Check by eye

  • Open a source file in Files: the copy icon sits between Reveal and Open in default editor. Click it and paste: you get the whole file, including unsaved edits.
  • The icon turns into a check for about a second.
  • No button on images, binary or truncated files, or while the rendered Markdown preview is showing. Toggle to the Markdown code view and the button appears.

The T3-WATCH ledger rows sit on top of main's ledger, so they may conflict with the open t3-watch PRs #112 and #114.

🤖 Generated with Claude Code

A Copy contents button sits beside Reveal in the file header. It copies
the editor's text, so unsaved edits come along, and shows a check for a
moment. Truncated, binary, empty and still-loading reads have no button,
nor does the rendered Markdown view.

Also logs T3 through 0dc32b5c8b in the T3 watch ledger.

Inspired by: pingdotgg/t3code@07fe456146
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant