fix(tui): echo the expanded paste, not the [[ … ]] label - #951
Merged
Merged
Conversation
A collapsed paste was expanded for prompt.submit but the transcript echo
kept the composer label. Echo the expanded text (capped CC-style at 10k
chars: 2.5k head + '… +N lines …' + 2.5k tail) and estimate row heights
on the same truncation.
Same bug class fixed along the way:
- /retry re-sent the label (lastUserMsg stored the unexpanded text).
- busy / no-session / steer-rejected / 'session busy' submits lost the
paste once clearIn() dropped the snippets. The queue keeps the LABEL
and its snippets are carried until sent, so {!cmd} interpolation never
runs over pasted content.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
Pasting a long query collapses it in the composer to
[[ Create a persist.. [14 lines] .. ard for follow-up questions. ]]. On submit the backend got the expanded text, but the transcript echo showed the label.Fix
useSubmission.sendechoes the expanded text. User rows over 10k chars render CC-style (UserPromptMessage.tsx): 2.5k head +… +N lines …+ 2.5k tail.virtualHeightsestimates on the same truncation./retrynow re-sends the expanded text; before, it sent the bare label afterclearIn()had dropped the snippets.session busysubmits used to lose the paste. The queue keeps the label, and its snippets are carried in a ref until the message is sent. This way{!cmd}interpolation insendQueuednever runs over pasted content.Tests
useSubmissionPasteEcho.test.tshas 9 tests. 6 of them fail on the olduseSubmission.ts.tscis clean.session busyre-queue fix and its tests were added after that approval and were not re-reviewed.Follow-ups (not in this PR)
carriedSnipsisn't cleared on session new/resume. It's capped at 32 snippets / 4 MB.{!…}puts an interpolation token into the label (edge preview).🤖 Generated with Claude Code