fix(readline): make pasted text placeholders atomic - #674
Closed
yxlyx wants to merge 1 commit into
Closed
Conversation
Track collapsed paste labels as positional semantic spans instead of re-associating hidden bodies through display-string matches. Live spans now render with attachment highlighting, move as one cursor/word unit, detach on edits, and are consumed on expansion so typed lookalikes cannot resurrect or duplicate removed content. Split history replay into a focused sibling module so replayed draft labels remain ordinary text and readline stays within the source line ceiling. Closes #673 Co-Authored-By: Codegraff <blackfloofie@codegraff.com>
justrach
approved these changes
Aug 29, 2026
justrach
left a comment
Owner
There was a problem hiding this comment.
Checked against #673 acceptance on the current main composer (string-match expand) vs this branch.
This is the right fix: identity lives on a positional paste store, highlight is only for live validated spans, Option/Alt+Backspace and word-nav treat the marker as one unit, submit expands only tracked spans, and a typed lookalike stays literal. History dropping semantic identity is also correct — there is no hidden body to restore.
CI is green (zig/sdk/windows). No follow-up needed from this review; leaving #673 to close with the merge.
Owner
|
Folded into release/v0.0.282 (#696). Closing as superseded. |
yermakoffivan
pushed a commit
to yermakoffivan/codegraff
that referenced
this pull request
Aug 31, 2026
…ders yxlyx: semantic paste spans so [Pasted text #N] is one navigation/delete unit and a typed lookalike does not resurrect a hidden body.
yermakoffivan
pushed a commit
to yermakoffivan/codegraff
that referenced
this pull request
Aug 31, 2026
…justrach#694 Record the three product merges on the new release branch, remap the TLS-generation ADR to 0048 so 0042 stays TUI claims, and leave justrach#277 / justrach#200 parked.
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.
Closes #673.
What changed
[Pasted text #N +L lines]label.readline_replay.zigsoreadline.zigremains below the 600-line source ceiling.Why
Problem / failure mode
The composer stored long paste bodies out of band but represented them with ordinary editable text. Submission searched for the exact display string and replaced every match. Users therefore had no visual proof that a marker still had an intact payload, Option/Alt+Backspace deleted the marker word by word, and deleting then manually recreating an identical label could resurrect hidden content.
Reason for this approach
Attachment identity must not be inferred from presentation text. Positional semantic spans let the editor distinguish a live paste from an identical typed string, render that distinction, shift the attachment with surrounding edits, and detach it whenever an edit touches the span. The same ranges also define atomic cursor and deletion boundaries.
Constraints and trade-offs
Rejected alternatives
Adding paste labels to the existing string-based
markslist would highlight every identical lookalike and preserve the resurrection bug. Special-casing word-boundary deletion without semantic identity would improve Option+Backspace but would not establish whether a payload was still attached or make submission safe.Verification
scripts/eval-tier1.shzig test src/readline_paste.zig— 8/8 focused state-machine tests passed.zig build test -Dtest-filter='paste' --summary all— 60/60 relevant tests passed.ESC DEL(Option/Alt+Backspace) removes the complete paste marker,