Add table of contents sidebar to public page view#18
Merged
Conversation
Match the wider reading area used by PageView and surface the right-rail table of contents for anonymous visitors so public pages read the same as authenticated ones. https://claude.ai/code/session_011zywk9ykwqjZnvsBEzB9Di
Hiding the aside for mindmap pages left the grid's reserved column empty, pushing content off-center. PageView always renders the rail and lets the empty-TOC fallback handle pages with no headings, so mirror that here. https://claude.ai/code/session_011zywk9ykwqjZnvsBEzB9Di
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.
Summary
Adds a table of contents (TOC) sidebar to the public page view, displaying an auto-generated list of headings from markdown content. The sidebar appears on large screens (lg breakpoint and up) and is hidden on print.
Changes
useCallbackhook and newTableOfContentscomponenthandleHeadingscallbackonHeadingsprop toMarkdownViewerto capture heading structure<article>element<aside>sidebar (lg+ screens, no-print) containing the TOC componentImplementation Details
handleHeadingscallback is memoized withuseCallbackto prevent unnecessary re-rendersno-printclass on sidebarhttps://claude.ai/code/session_011zywk9ykwqjZnvsBEzB9Di