Repository navigation
Conversation
Opening a document that contains a markdown table could crash the whole editor tree with "Minified Lexical error #232" TableObserver: Expected to find TableElement in DOM for key %s. Root cause: the kernel supports reversible root detach - route switches and React Activity hide the subtree through setRootElement(null). Lexical's TableObserver survives the detach: its DOM MutationObserver and the editor-level SELECTION_CHANGE_COMMAND listener stay registered. Any async table bookkeeping flushed after the detach (a queued table-subtree DOM mutation racing the route switch, or selection cleanup) resolves the table element through $lookup(), where getElementByKey() returns null and Lexical 0.42 throws the uncaught #232. Fix: wrap TableObserver.prototype.$lookup in patchTableNode(). While the root is detached - or when the upstream lookup throws on a missing element - degrade to the observer's last-known table element so read-only bookkeeping keeps working instead of taking the editor down. The wrapper caches the element on every successful lookup and never swallows errors when no fallback exists. Reproduced in jsdom: detach root, mutate a detached table row, flush the MutationObserver callback -> uncaught #232 before the fix, clean after. Upstream (lexical main, 0.52) still throws in this situation, so the guard stays in lobe-editor. Tests: new src/plugins/table/node/table-observer-detach.test.ts covers the post-detach mutation flush, selection bookkeeping across detach/reattach, and the attached baseline. Full table (24), kernel (74) and common (78) suites plus tsc --noEmit stay green.
|
👍 @arvinxx Thank you for raising your pull request and contributing to our Community. 非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
Acceptance evidence (T-379 fix round, 2026-10-11)Reproduced before the fix (jsdom, @lexical/table 0.42.0):
Verification performed:
Upstream note: |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
merge-ready ✅(2026-10-22T~10:45Z 判定):① CI 关键检查无 fail;② Codex 收敛——👍 reaction + receipt 评论(Reviewed commit |
Problem
Opening an Agent Document that contains a markdown table could crash the whole editor tree with:
Error #232 =
TableObserver: Expected to find TableElement in DOM for key %s(@lexical/table 0.42.0). Tracked in LobeHub as T-632 (ventmsg_9qSd082x38qIboPM7Q, desktop).Root cause
The editor kernel supports reversible root detach — route switches and React Activity hide the subtree through
setRootElement(null). Lexical'sTableObserversurvives the detach:MutationObserverand the editor-levelSELECTION_CHANGE_COMMANDlistener stay registered;$lookup();getElementByKey()returnsnulland Lexical throws the uncaught 🐛 fix: clamp rendered image max width to the container #232, taking down the whole editor tree.Upstream
lexical(main, 0.52.0) still throws in this situation, so the guard belongs in lobe-editor.Reproduction (jsdom, before this fix)
registerTableSelectionObservermounts the observer +trackTable);setRootElement(null)(route switch / Activity hide);trackTableMutationObserver callback runs post-detach →$lookup()→ uncaught 🐛 fix: clamp rendered image max width to the container #232.Fix
Wrap
TableObserver.prototype.$lookupin the existingpatchTableNode():Tests
New
src/plugins/table/node/table-observer-detach.test.ts:Full suites stay green: table 24/24, editor-kernel 74/74, common 78/78 (+1 skipped);
tsc --noEmitclean; lint-staged (prettier/eslint/stylelint), circular-deps and commitlint pass.