Repository navigation
add forward delete line + fix delete backward line - #6
Merged
Merged
Conversation
zurfyx
pushed a commit
that referenced
this pull request
Jul 26, 2022
Added dependency array to useEffect
etrepum
referenced
this pull request
in etrepum/lexical
May 10, 2026
The PR meta#8482 suffix-incremental fast path was unconditionally clearing `subTreeTextFormat` / `subTreeTextStyle` after the suffix walk, on the assumption that the parent's first text descendant always lived in the non-dirty prefix. That assumption fails when the prefix has no text descendants at all (e.g. linebreak-only prefix + final text node), and the parent's `__textFormat` / `__textStyle` then go stale after a format toggle on the suffix's first text descendant. Replace the clear with an O(1) probe: - Cache `__lexicalFirstTextKey: NodeKey | null` on each element DOM alongside `__lexicalTextContent`. It records the deep first-text descendant key from the cycle that just wrote the cache. - Track `subTreeFirstTextKey` in module state alongside `subTreeTextFormat` / `subTreeTextStyle`, captured at the same sites. - In the suffix path, climb the cached key's `__parent` chain to find its direct-child ancestor under the reconciled element, then probe `dirtyChildren`: a non-dirty ancestor proves the prefix is still authoritative, so we recover format/style from the live next-state text node and let `reconcileTextFormat` no-op via equality. A dirty ancestor (or missing key) means the suffix-derived values stay. Walk depth is bounded by tree depth from text to its parent element (typically 1). Memory cost is one extra NodeKey slot per element DOM. Also adds the matching format-capture rule (`if isTextNode && format === null then capture`) to the suffix walks in both same-size and size-delta paths so direct-TextNode suffix children populate subTreeTextFormat for the fallback case. Updates AUDIT #1 (root) to lock in the new behavior, removes the now- obsolete AUDIT #6 (made impossible by the $isRootOrShadowRoot gate), and adds AUDIT #1 (non-root) control demonstrating that prefix-with- text correctly suppresses suffix format propagation. All 2499 unit tests pass. https://claude.ai/code/session_01KR9zZXhh8Foj6QXKR8XeMs
3 tasks done
zurfyx
added a commit
that referenced
this pull request
Oct 30, 2026
## Description `KNOWN_OPEN` said seed 1045 loses text typed into a table a peer removes. Minimized, the seed is two operations: one client makes the paragraph inside a box a check list, which replaces the box with the list, while another inserts a table into that box. The table goes with the box (delete wins), which the Yjs 13 layouts lose too. The comment now says that. Comments only. ## Test plan ### Before ``` $ FUZZ_SEED=1045 pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/Fuzz.test.ts [r0] C2 #4 list check paragraph("<0.14>") [r0] A1 #6 table table(tablerow(tablecell(paragraph("<6.0>")) tablecell(paragraph("<6.1>"))) tabl in test_box loss?: <6.0>[line,op6],<6.1>[line,op6],<6.2>[line,op6],<6.3>[line,op6] ``` (the minimized script, from the fuzz utilities' `minimize`) ### After ``` $ pnpm exec vitest run --project unit packages/lexical-y/src/__tests__/unit/Fuzz.test.ts Test Files 1 passed (1) Tests 16 passed (16) ```
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.
Adding this command and fix a bug on both at the same time we missed the behaviour for deleting empty lines.
Testable with alt + delete I think.
It's still a bit flaky with copy/pasted stuff but I'm looking into it.