Repository navigation
Conversation
Co-authored-by: Claude <[email protected]>
…legation when needed (meta#8308)
…t identical links (meta#8309) Co-authored-by: Bob Ippolito <[email protected]>
…h local screenshot captures (meta#8316) Co-authored-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]> Co-authored-by: etrepum <[email protected]>
Change DecoratorTextNode to extend DecoratorNode<unknown> instead of DecoratorNode<JSX.Element>, removing the dependency on React's JSX types from @lexical/extension which has no React dependency declared. Fixes meta#8325
etrepum
pushed a commit
that referenced
this pull request
May 10, 2026
…at bug Adds AUDIT #1 (non-root) demonstrating that the suffix-path `subTreeTextFormat = null` clear breaks `__textFormat` propagation on a *paragraph* (not just root) when the paragraph's prefix has no text descendants — e.g. linebreak-only prefix + final text node. Skipping `reconcileTextFormat`/`reconcileTextStyle` for `$isRootOrShadowRoot` (consistent with the existing LexicalElementNode.exportJSON gate, see meta#7968) would mask the root variant of AUDIT #1, but this non-root test shows the underlying clear logic still needs fixing for paragraph-level parents. https://claude.ai/code/session_01KR9zZXhh8Foj6QXKR8XeMs
etrepum
pushed a commit
that referenced
this pull request
May 10, 2026
RootNode / ShadowRootNode never expose `__textFormat` / `__textStyle` to user code: `LexicalElementNode.exportJSON` excludes them (meta#7968) and selection inheritance only reads element format/style for empty-element anchors gated on `!isRootTextContentEmpty`. Skipping reconcile here aligns the in-memory invariant with the serialization invariant and removes the cosmetic root-level symptom of the suffix-fast-path's stale-format clear. Updates AUDIT #1 (root) to lock in the new behavior. AUDIT #1 (non-root) continues to fail as a regression marker for the underlying suffix-clear bug, which the gate does not address. https://claude.ai/code/session_01KR9zZXhh8Foj6QXKR8XeMs
etrepum
pushed a commit
that referenced
this pull request
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
etrepum
added a commit
that referenced
this pull request
Oct 5, 2026
… selection tests ## Description The macOS Chromium first-node table selection test failed all three attempts because its leading paragraph survived setup Backspace. The later shift-selection assertion then saw the trailing paragraph at child index 2 instead of 1. Check native and Lexical caret positions before deleting adjacent paragraphs and before shift-selection in the related first-node, last-node, and surrounding-content variants. Verify the remaining paragraph count after setup deletion. Preserve all existing table-selection expectations and platform exclusions. ## Test plan ### Before macOS Chromium on e8c17b8: https://github.com/facebook/lexical/actions/runs/37251396589 ``` Selection > shift+arrowup into a table, when the table is the first node, selects the whole table - Expected + Received Array [ - 1, + 2, ] Retry #1 Retry #2 1 failed ``` ### After Linux WebKit, all eight adjacent-table selection cases repeated three times, four workers, retries disabled: ``` rich-text: expected=18, skipped=6, unexpected=0, flaky=0 rich-text-with-collab: expected=18, skipped=6, unexpected=0, flaky=0 ``` ```sh E2E_EDITOR_MODE=rich-text node node_modules/playwright/cli.js test --project=webkit --workers=4 --retries=0 e2e/Selection.spec.mjs --grep 'into a table' --repeat-each=3 --reporter=json E2E_EDITOR_MODE=rich-text-with-collab node node_modules/playwright/cli.js test --project=webkit --workers=4 --retries=0 e2e/Selection.spec.mjs --grep 'into a table' --repeat-each=3 --reporter=json ``` ESLint, Prettier, and git diff --check passed. macOS Chromium is unavailable locally and is validated in CI.
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.
Co-authored-by: Claude [email protected]