Skip to content

fix: mark no line after a change that ends at the field's end - #6510

Merged
max-sixty merged 1 commit into
mainfrom
fix/issue-6418-field-after-mark
Nov 19, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/issue-6418-field-after-mark

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Clearing a panel or comment field marked its only line as "after the change", and that is what broke test_an_explicit_target_does_not_overwrite_its_existing_draft on main. #6476 added the mark (data-lf-after, afterChange in field-editor.js) so a removal's carry can split between the words before a removed line and the words after it. A change that ended at the field's end still marked a line when that end fell at a line start. When the field switches drafts, it clears and refills in a single task, so the mark landed on the line and came off again. The write watch then failed the test at teardown with unchanged write: data-lf-after on div.cm-line.lf-face-p … leaf-text.lf-ui.lf-response-control.lf-fab-input (run 44480242315). No words follow a change that ends at the field's end, so the field now marks no line there. Every other placement of the mark stays as #6476 left it.

Evidence, run locally:

Refs #6418 — automated triage

#6476 marks the first line whose words come after a change
(`data-lf-after`), so a removal's carry can split there. A change that
ended at the field's end still marked a line where that end was a line
start: clearing the field put the mark on its only, empty line. A draft
switch clears the field and fills it again in one task, so the mark came
and went on the same line, and the write watch failed
test_an_explicit_target_does_not_overwrite_its_existing_draft at teardown
with "unchanged write: data-lf-after on div.cm-line". No words follow a
change that ends at the field's end, so it now marks none.

Refs #6418
@max-sixty
max-sixty merged commit 8512ab2 into main Nov 19, 2026
6 checks passed
@max-sixty
max-sixty deleted the fix/issue-6418-field-after-mark branch November 19, 2026 10:01
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.

2 participants