Skip to content

fix: hide trailing word chars under caret in mid-text inline preview#359

Merged
bartekplus merged 1 commit intomasterfrom
fix/inline-preview-midword-trailing-token
Apr 14, 2026
Merged

fix: hide trailing word chars under caret in mid-text inline preview#359
bartekplus merged 1 commit intomasterfrom
fix/inline-preview-midword-trailing-token

Conversation

@bartekplus
Copy link
Copy Markdown
Owner

The mid-text inline preview mirrored the block DOM and inserted a ghost suffix at the caret, but left the remaining characters of the word under the caret in place. Acceptance consumes those characters via findTrailingToken, so the preview read "Threee dog walked the street" while acceptance produced "Three dog walked the street" — breaking the WYSIWYG invariant users rely on.

Thread a resolveTrailingToken callback through the presenter that mirrors acceptance's trailing-token logic, and strip those characters from the cloned preview in both the input/textarea and contenteditable mirror paths (walking across inline element boundaries for formatted words).

The mid-text inline preview mirrored the block DOM and inserted a ghost
suffix at the caret, but left the remaining characters of the word under
the caret in place. Acceptance consumes those characters via
findTrailingToken, so the preview read "Threee dog walked the street"
while acceptance produced "Three dog walked the street" — breaking the
WYSIWYG invariant users rely on.

Thread a resolveTrailingToken callback through the presenter that mirrors
acceptance's trailing-token logic, and strip those characters from the
cloned preview in both the input/textarea and contenteditable mirror
paths (walking across inline element boundaries for formatted words).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bartekplus bartekplus merged commit 48c0cf8 into master Apr 14, 2026
8 checks passed
@bartekplus bartekplus deleted the fix/inline-preview-midword-trailing-token branch April 14, 2026 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant