feat(web): copy a thread transcript from the thread menu - #143
Merged
Conversation
yngatech-nightly
Bot
force-pushed
the
main
branch
from
August 15, 2026 15:27
b0a9983 to
90c3747
Compare
Adds a Copy transcript action to the thread context menu (sidebar right-click and chat header). It copies the conversation as markdown (## User / ## Assistant sections under the thread title), omitting tool activity, reasoning, and still-streaming replies. User prompts are copied as their visible text, without the injected terminal/element/ issue context blocks. Because the detail subscription only holds a turn window on pagination-capable servers, the action fetches a full unwindowed snapshot on demand via a new createThreadSnapshotCommands factory in client-runtime instead of reading cached state.
Copy transcript is the only asynchronous copy action: nothing superseded an in-flight snapshot fetch, so copying a large thread and then quickly a small one let the slow fetch land last and silently overwrite the clipboard with the wrong transcript (confirmed against an 8000-message fixture). Only the most recent copy request may write the clipboard now; superseded results are dropped without writing or toasting.
incognitojam
force-pushed
the
t3code/add-copy-transcript
branch
from
August 15, 2026 15:43
2c52001 to
28bf1b6
Compare
The latest-request guard only ordered transcript copies against each other; a slow transcript fetch could still land after Copy path, a message copy button, or Cmd+C and stomp the newer clipboard content (reproduced: Copy transcript on an 8000-message thread, then Copy thread ID 130ms later, left the transcript in the clipboard). Clipboard writes now bump a shared epoch — every write through writeTextToClipboard plus DOM copy events once tracking is installed — and a transcript fetch drops its result if the epoch moved while it was in flight. The four call sites writing through navigator.clipboard directly now route through writeTextToClipboard so their copies count. A fetch slower than 400ms also shows a loading toast, so a pending transcript copy is visible instead of landing silently. Copies made outside the app remain unobservable from a web page; that window is bounded by the snapshot fetch timeout.
With the clipboard epoch in place a late-landing transcript is harmless: it can only land when nothing else was copied since the click, meaning the user is still waiting for exactly that content. The loading toast was left covering only slow-connection progress feedback, at the cost of a timer and toast lifecycle threaded through every exit path of the copy hook. Remove it and collapse the two fetch-failure branches that showed the same toast. If remote users miss the feedback, GitActionsControl has the loading-toast pattern to reintroduce it behind real demand.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
TL;DR: New Copy transcript thread action copies the conversation as markdown (
## User/## Assistantunder the thread title) — no tool calls, reasoning, or half-streamed replies — for sharing or pasting into a new chat as context.There was no way to get a thread's conversation out of T3 Code. This adds
copy-transcriptto the shared thread action menu (sidebar right-click and chat header), with the serializer inapps/web/src/lib/threadTranscript.ts. User prompts are copied as their visible text, without injected terminal/element/issue context blocks; image attachments become[Attached image: …]placeholders.Details worth reviewing:
createThreadSnapshotCommandsfactory in client-runtime. The cached detail atom holds only the last 10 user turns (nothing for never-opened threads), so reading client state would silently truncate.navigator.clipboardcall sites now route throughwriteTextToClipboard), and a transcript fetch whose epoch moved drops its result. A late-landing transcript is therefore harmless — it only lands when nothing else was copied since the click. Copies made in other applications during the fetch are unobservable from a web page (window bounded by the 6s fetch timeout).Verified with unit tests (serializer, menu builder, clipboard epoch) and an integrated browser pass against seeded fixtures — including reproducing both clipboard race directions on an 8000-message thread and confirming the guard fixes them.
Before / After
Written by an agent (T3 Code, claude-fable-5).