Skip to content

draft outline: live heading list with click-to-jump#83

Merged
jorgefilipecosta merged 2 commits intotrunkfrom
draft-outline-panel
May 6, 2026
Merged

draft outline: live heading list with click-to-jump#83
jorgefilipecosta merged 2 commits intotrunkfrom
draft-outline-panel

Conversation

@jorgefilipecosta
Copy link
Copy Markdown
Member

@jorgefilipecosta jorgefilipecosta commented May 6, 2026

Summary

  • Replaces the Outline tab placeholder with a live, clickable list of headings extracted from the editor's lezer markdown tree.
  • Indents entries by heading level, marks the heading containing the cursor as active, and jumps the editor to the heading line on click.
  • Updates on every doc change with no extra parsing — reuses the syntax tree the existing markdown decorations already build.

Outline populated

Why

The earlier stub limited long-form drafts: writers had no way to see structure or navigate by heading. This is the missing navigation surface.

Notes

  • ATX headings only for now (# Heading). Setext (=== / ---) is one extra case away if needed.
  • Code blocks are correctly skipped — the lezer parser doesn't emit heading nodes inside fenced code.
  • This branch is stacked on the unmerged t3 polish work; reviewing the top two commits gives the outline diff (d976742 implementation, 975ac48 tests).

Test plan

  • 15 unit tests over the lezer extractor, equality guard, and active-row math.
  • e2e: populated panel with three levels, click-to-jump with active highlight, live updates on typing, empty placeholder.
  • Manual: opened a long draft, switched to Outline, clicked through entries, verified scroll + cursor placement.

The Outline tab was a stub. Now it reads the editor's lezer markdown
tree, renders a flat list indented by heading level, marks the heading
containing the cursor, and jumps the editor to the heading line on
click. Updates live on every doc change.
15 unit tests pin the lezer extractor, the equality guard, and the
active-row math. Two e2e tests cover the round-trip — populated panel,
click-to-jump with active highlight, live updates, and the empty
placeholder.
jorgefilipecosta added a commit that referenced this pull request May 6, 2026
@jorgefilipecosta jorgefilipecosta marked this pull request as ready for review May 6, 2026 12:41
@jorgefilipecosta jorgefilipecosta merged commit ae97f34 into trunk May 6, 2026
@jorgefilipecosta jorgefilipecosta deleted the draft-outline-panel branch May 6, 2026 12:43
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