feat(tui): collapse large pastes to a marker, expandable in place - #236
Merged
Max17190 merged 4 commits intoAug 27, 2026
Merged
Conversation
Max17190
marked this pull request as ready for review
August 27, 2026 03:53
Max17190
force-pushed
the
tui-paste-collapse-expand
branch
from
August 27, 2026 03:55
91fb3ee to
0f50ea6
Compare
Max17190
force-pushed
the
tui-paste-collapse-expand
branch
from
August 27, 2026 04:58
0f50ea6 to
d954dbc
Compare
A pasted log or blob spliced verbatim into the draft, burying it and leaving the six-row composer scrolling through content the user never meant to edit. A paste at ten lines or a thousand characters now collapses to a numbered [pasted #N: ...] marker; the bytes rejoin the draft for every whole-text reader (submit, queueing, history), so a marker never leaves the composer, and ctrl+o with the cursor on a marker splices the bytes back in place for editing. Collapse and expand ship together deliberately: a collapsed paste with no way back is worse than no collapse. An edited marker stops matching and simply stays literal.
expand_pastes replaced every occurrence of a marker, so hand-typing a marker's exact spelling injected the hidden paste twice on read or submit. Each insertion wrote its marker exactly once, so exactly one occurrence expands.
…eference The gesture anchored on the row's first occurrence of a marker, so a byte-identical duplicate typed earlier both swallowed the gesture aimed at the genuine marker and could receive the splice while the genuine marker stayed expandable, delivering the hidden bytes twice. The match is now cursor-anchored, and an in-place expansion tombstones the store slot, so a surviving duplicate is literal text on every later path.
Max17190
force-pushed
the
tui-paste-collapse-expand
branch
from
August 27, 2026 05:19
d954dbc to
f2a3626
Compare
Sequential replacement rescanned the progressively expanded string, so a marker spelling embedded in an earlier paste's content captured a later paste's expansion and the genuine marker submitted as literal text. Every live marker is now located in the draft text first and spliced in one pass; expanded bytes are content, never search territory.
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.
Why
A pasted log or minified blob splices verbatim into the draft, burying it and leaving the six-row composer scrolling through content the user never meant to edit. Comparable frontends that shipped collapse without a way back generated the field's angriest issue threads, so collapse and expand ship together.
Summary
A paste at ten lines or a thousand characters collapses to a numbered
[pasted #N: ...]marker. The bytes rejoin the draft for every whole-text reader (submit, queueing, history), so a marker never leaves the composer.ctrl+owith the cursor on a marker splices the bytes back in place for editing, outranking the last-tool-block expansion only in that position; an edited marker stops matching and stays literal. Small pastes splice exactly as before.Test Plan
large_paste_collapses_to_a_marker_and_reads_back_expanded,small_pastes_splice_literally,a_single_line_blob_collapses_on_the_char_bound,expand_paste_at_cursor_splices_the_bytes_back_for_editing(incl. cursor-off-marker refusal and idempotence),an_edited_marker_never_expands.Greptile Summary
This update collapses large terminal pastes into editable markers while preserving their original content for submission, adds cursor-targeted marker expansion, improves approved-file recovery commands, and refines terminal replay, notification, and unread-message behavior. Focused composer checks confirmed that duplicate marker text does not deliver hidden content twice and that marker-like text embedded in an earlier paste does not interfere with a later paste. Ledger output also retained the correct approved object-to-file mappings after bound files changed.
Confidence Score: 5/5
No blocking failure remains; the exercised composer and ledger recovery flows behaved as intended.
No accepted blocking findings remain.
What T-Rex did
Reviews (4): Last reviewed commit: "fix(tui): paste expansion never searches..." | Re-trigger Greptile