Repository navigation
fix: mark no line after a change that ends at the field's end - #6510
Merged
Merged
Conversation
#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
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.
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_draftonmain. #6476 added the mark (data-lf-after,afterChangeinfield-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 withunchanged 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:
test_an_explicit_target_does_not_overwrite_its_existing_draftpasses on Leave the words after a removed line where the field's foot holds them #6476's parent, errors at Leave the words after a removed line where the field's foot holds them #6476 (626ddc467) and onmain, and passes with this change.test_a_line_removed_among_the_words_moves_only_what_layout_movedpasses in all six cases (panel, card and comment box, in Chromium and Firefox). The rest oftest_comment_targets.pyandpnpm run test:runtimepass too.Refs #6418 — automated triage