Skip to content

feat: add toc toolbar item#3247

Open
VladaHarbour wants to merge 1 commit into
mainfrom
sd-2751_toc-node-icon
Open

feat: add toc toolbar item#3247
VladaHarbour wants to merge 1 commit into
mainfrom
sd-2751_toc-node-icon

Conversation

@VladaHarbour
Copy link
Copy Markdown
Contributor

No description provided.

@VladaHarbour VladaHarbour self-assigned this May 12, 2026
@VladaHarbour VladaHarbour requested a review from a team as a code owner May 12, 2026 15:26
@linear
Copy link
Copy Markdown

linear Bot commented May 12, 2026

SD-2751

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1456204222

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +101 to +104
const containing = index.candidates.filter((c) => pos >= c.pos && pos < c.pos + c.node.nodeSize);
const anchor =
containing.length > 0 ? containing.reduce((a, b) => (a.node.nodeSize < b.node.nodeSize ? a : b)) : null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Anchor TOC insertion outside nested TOC entry blocks

Selecting the smallest containing block here causes failures when the cursor is inside an existing TOC entry paragraph: toBlockAddress(anchor) resolves to that inner paragraph, so prepareTableOfContentsInsertion(..., { at: { kind: 'after', target } }) returns a position inside a tableOfContents node (whose content only allows paragraphs), and insertTableOfContentsAt then no-ops after a RangeError. In that context the toolbar button appears enabled but clicking it does nothing; the anchor should be promoted to an enclosing insertable block (e.g., the TOC block itself or another valid outer block).

Useful? React with 👍 / 👎.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants