Uh oh!
There was an error while loading. Please reload this page.
feat(tui): expand pasted text - #39920
Merged
Merged
Conversation
kitlangton
enabled auto-merge (squash)
July 31, 2026 18:05
Uh oh!
There was an error while loading. Please reload this page.
github-actionsBot
pushed a commit
to ReStranger/opencode
that referenced
this pull request
Jul 31, 2026
* upstream/v2: fix(tui): render plugin slots and routes with component semantics (anomalyco#39917) refactor(ai): simplify provider options (anomalyco#39924) refactor(core): rename attachments config to media (anomalyco#39927) feat(tui): expand pasted text (anomalyco#39920) feat(ai): expand OpenRouter native support (anomalyco#39907)
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 freeto 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.
What
Allow collapsed pasted text in the TUI composer to be expanded without opening an editor:
[Pasted ~N lines]placeholder to expand it in placeExpansion affects only the selected or matching pasted block. Other pasted blocks, file mentions, and agent mentions remain tracked.
How
packages/tui/src/component/prompt/index.tsxnow replaces a tracked pasted extmark with its original text, removes that pasted part from prompt metadata, and realigns later pasted-part indexes.Mouse expansion resolves the exact extmark at the clicked cursor offset. Repeated paste expansion reuses the first collapsed pasted part whose normalized content matches the incoming paste.
Scope
This applies only to text that the composer would already collapse under the existing paste threshold. Short pastes and
prompt.paste: "full"retain their current behavior. Attachments are unchanged.Testing
bun typecheckinpackages/tuibun run test test/prompt/part.test.tsinpackages/tuiDemo
Simulated OpenCode Drive session. Static control dead time was trimmed from the recording; interaction transitions remain at normal speed.
expand-pasted-text-demo.mp4