Repository navigation
fix: make Backspace and Delete on a message's blank line replace only that line - #7185
Conversation
… that line #7117 made Backspace and Delete on a message's blank line propose an edit that runs from the end of the paragraph above, so `keeps` sees the blocks it joins. The editor dispatched that edit as written, so CodeMirror rewrote every blank line between the paragraph and the caret with the same children, which the teardown's write watch reports as an unchanged write in both desktop delete cases of test_native_reply_edits_after_semantic_paint_keep_the_first_line. deleteAtEdge still checks the wide edit and now dispatches it without the source the edit puts back as it was, so the field replaces only the line the key takes. The draft and the caret after the key are as before. A runtime test asserts that each key replaces only its line. Closes #7174
|
@leaf-agent The fix works, but
|
…and narrowed fieldState and narrowed each computed the edit between two strings' longest common prefix and the non-overlapping common suffix. Both now call one module-level helper, differing. No behaviour changes.
|
Done in d5ade73. A module-level
|
Since #7117, Backspace and Delete on a message's blank line propose an edit that runs from the end of the paragraph above, so the draft check (
keeps) sees the blocks the edit joins.deleteAtEdgedispatched that wide edit as written. CodeMirror then rewrote every blank line between the paragraph and the caret with the children they already had, and the teardown's write watch failed both desktop delete cases oftests/journeys/test_thread_response_continuity.py::test_native_reply_edits_after_semantic_paint_keep_the_first_linewithunchanged write: children of div.cm-content.cm-lineWrapping.deleteAtEdgestill checks the wide edit. It now dispatches the edit without the source the edit puts back as it was (narrowedinfield-editor.js), so the field replaces only the line the key takes. The draft and the caret after the key don't change, since the resulting document is the same. No user-visible behaviour changes apart from the DOM writes that go away.Verification:
main(32dc564a8) both*-delete-desktopcases error at teardown.pnpm run test:runtimepasses 1132 of 1132.pnpm run check:browserandtest_a_draft_nests_its_blocks_as_its_sent_message_doespass.Closes #7174 — automated triage