Skip to content

fix: sync toc active heading on click#61

Open
ZhoucpSAMA wants to merge 1 commit into
pd4d10:mainfrom
ZhoucpSAMA:codex/fix-toc-active-heading
Open

fix: sync toc active heading on click#61
ZhoucpSAMA wants to merge 1 commit into
pd4d10:mainfrom
ZhoucpSAMA:codex/fix-toc-active-heading

Conversation

@ZhoucpSAMA

@ZhoucpSAMA ZhoucpSAMA commented Jun 2, 2026

Copy link
Copy Markdown

What

  • Track the active heading index when a TOC item is clicked.
  • Sync the active TOC item while scrolling the preview pane.
  • Let the TOC prefer the explicit active heading index over the block-derived fallback.
  • Add a regression test for clicking a nested TOC heading.

Why

Clicking a nested TOC item scrolls the preview correctly, but the highlighted TOC item can remain on the root heading because the active state is still derived from currentBlockIndex.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant