Repository navigation
Use public Lexical state APIs for shortcut handling - #25
Conversation
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ae767a961
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| if (!unresolved.length) continue; | ||
| const next = marks.filter((mark) => !unresolved.includes(mark)); | ||
| const href = (child instanceof ZettelSpanNode || child instanceof ZettelImageNode ? child.getLinkHref() : undefined) ?? $previousLinkHref(child, unresolved); | ||
| const href = child instanceof ZettelSpanNode || child instanceof ZettelImageNode ? child.getLinkHref() : undefined; |
There was a problem hiding this comment.
Preserve link targets when the href cache is absent
When a block join moves linked content whose node has no cached linkHref, this now treats the link as unresolvable and removes its mark. This affects ZettelBreakNode and ZettelInlineHtmlNode, which may legally carry link marks but never receive the new cache, as well as spans and images restored from Lexical JSON saved before this commit. Deleting a boundary after loading such content therefore silently strips the link; retain a previous-state lookup fallback or migrate/cache hrefs for every linkable inline node.
Useful? React with 👍 / 👎.
Summary
This follow-up closes two integration issues found during the Lexical 0.51 review:
_nodeMapstate.EditorState._selection/_nodeMapreads in Markdown shortcut handling withEditorState.read,$getSelection, and$getNodeByKey.No additional Changeset is needed: these fixes harden behavior included in the already merged changesets for this release.
Verification
pnpm run ci— passed (173 package tests)pnpm test:demo— passed (35 Chromium checks, no page errors)