Skip to content

feat: add heading breadcrumb bar and TOC panel to editor#5

Open
hoiyada7-maker wants to merge 1 commit into
mainfrom
feature/heading-breadcrumb
Open

feat: add heading breadcrumb bar and TOC panel to editor#5
hoiyada7-maker wants to merge 1 commit into
mainfrom
feature/heading-breadcrumb

Conversation

@hoiyada7-maker

Copy link
Copy Markdown
Owner

Summary

  • Adds a heading breadcrumb bar above the editor showing the current heading hierarchy (e.g. H1 > H2 > H3) in bold orange
  • Clicking the bar opens a tree-structured TOC panel with fold/unfold controls per node
  • Clicking a heading in the TOC navigates the editor to that line

Details

  • New EditorPane component wraps Editor + HeadingBreadcrumb with cursor tracking
  • onCursorLine callback added to Editor — fires on every selection/cursor change
  • TOC renders as a tree: headings with children show ▾/▸ toggle; leaf nodes show a dot
  • Each node independently collapsible in the TOC panel
  • Current heading highlighted in orange; ancestor headings in muted orange
  • Active item auto-scrolls into view when TOC opens
  • Long heading text truncated to 15 chars per segment in the breadcrumb bar

Test plan

  • Open a markdown file with multiple heading levels
  • Verify breadcrumb bar shows full path (e.g. Introduction > Setup > Quick Start)
  • Move cursor to different sections — breadcrumb updates in real time
  • Click breadcrumb to open TOC panel
  • Verify current heading is highlighted and scrolled into view
  • Click ▾/▸ on a parent heading to collapse/expand its children
  • Click a heading label to jump the editor to that line

🤖 Generated with Claude Code

Shows current heading hierarchy (H1 > H2 > H3) in a bar above the
editor in bold orange. Clicking opens a tree-structured TOC panel
where each node can be independently folded/unfolded; clicking a
heading navigates the editor to that line.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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