Repository navigation
fix(web): large pastes with a thread link fold into an attachment again - #37889
juliusmarminge wants to merge 7 commits into
Conversation
A large plain-text paste that contains one thread URL goes inline instead of folding into pasted-text.txt, both when pasted into the composer and when a window paste is routed to the blurred composer. These tests reproduce it. The fake environment now advertises file attachment uploads like a real server does, so the composer can stage a folded paste in browser tests.
A large plain-text paste that only mentioned a thread URL stayed inline, because both paste paths skipped folding whenever the clipboard yielded context records, and plain thread links now synthesize records too. Folding is now skipped only when the paste references context copied from T3 (the composer clipboard format or its HTML fragment), so copied chips still import while plain links in a large paste fold like any other text. AI-assisted; verified with the tests and tools listed above.
# Conflicts: # apps/web/src/components/ChatView.browser.test.tsx
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Large text pastes containing thread links can again fold into attachments, while copied T3 context remains protected. The change reuses existing paste handling and preserves the paste-as-text bypass. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Nothing needed changing this round. All 7 required checks passed on 1f28e20 and Macroscope approved the PR with no comments on lines, so there was no finding to fix or dismiss. One check named "Check", which is not required, was still queued when the watch ended. The fix itself: ChatComposer's paste handler and the paste-to-focus redirect skip folding only when the clipboard carries copied T3 composer context that the pasted text references (
pastesCopiedComposerContext). A thread URL that merely appears in a large paste no longer keeps the text inline, so it folds into pasted-text.txt again. Copied chips still stay inline.Fixes #30577
Supersedes #30590. The change is @juliusmarminge's; their commits are kept.
Reproduction on main
In the web app, open a thread with attachment uploads available. Copy a plain-text log larger than 32 KiB containing one hosted T3 thread URL among ordinary log lines, then paste normally into the focused composer: main leaves the log inline, whereas this change creates pasted-text.txt. Clear the draft, click the conversation to blur the composer, and paste again to exercise window-level paste; repeat with a thread URL naming an unavailable environment. As controls, paste the large log without a link, a short thread URL alone, and a copied T3 thread chip.
Evidence
Real web client and server, driven by scenarios:prove in Chromium on Linux. Fresh synthetic project and replay-backed threads; light theme and 1280×800 viewport on both commits. Stills crop the same sidebar/chat area; recordings omit initial pairing/loading.
Paste an approximately 43 KiB plain-text log containing one hosted thread URL with Ctrl+V into the focused composer. Clear and repeat with an unavailable-environment URL. Clear, click the conversation to blur the composer, then repeat both URLs through window-level paste. Run controls for a large unlinked log, a short thread URL, a copied chip, paste-as-text, and large copied T3 context.
Proven: the base leaves all four linked logs inline; the head folds all four into attachments. Successive attachments are named pasted-text.txt through pasted-text-4.txt. Controls behave identically on both commits.
Before recording · After recording
Scenario source · Runner-generated evidence with paired captures
Tests
No new commands this round; CI ran on 1f28e20 and all 7 required checks passed. From the earlier round on the same head: composerInlineTokenPaste.test.ts (6 passed), ChatView.browser.test.tsx (14 passed, and the new case fails with main's guard), vp run check:changed (all pass).
Not in this change
Who did the work
Run by the t3code factory in T3 Code.