Skip to content

feat(editor): keep table of contents toggle size and follow active heading - #3473

Merged
AlexAndBear merged 1 commit into
mainfrom
fix/editor-toc-scroll-and-toggle
Sep 29, 2026
Merged

AlexAndBear merged 1 commit into
mainfrom
fix/editor-toc-scroll-and-toggle

Conversation

@AlexAndBear

@AlexAndBear AlexAndBear commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Description

  • Fix the table of contents toggle shrinking when the outline is long enough to overflow the panel (shrink-0 on the toggle, min-h-0 on the list)
  • Center the active heading in the outline list when the table of contents is expanded, so it no longer starts at the top after being collapsed
  • Keep the active heading in view in the outline list while scrolling the document
  • Keep the outline list still while navigating to a clicked heading, since scrolling the list cancels the running smooth scroll in Chrome
  • Keep the clicked heading marked as active during navigation instead of flickering through the headings in between

Related Issue

How Has This Been Tested?

  • test environment: local dev setup (Chrome via Playwright), document with 100 headings
  • test case 1: expand a long outline, toggle keeps its full height
  • test case 2: collapse, scroll the document, expand again, active heading is centered in the outline
  • test case 3: scroll the document with the outline open, active heading stays in view
  • test case 4: click headings far below and above, document scrolls all the way to them
  • test case 5: unit tests in TextEditorTableOfContents.spec.ts

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@tammi-23 tammi-23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍 great work

@AlexAndBear
AlexAndBear merged commit a15da29 into main Sep 29, 2026
32 checks passed
@AlexAndBear
AlexAndBear deleted the fix/editor-toc-scroll-and-toggle branch September 29, 2026 13:30
@openclouders openclouders mentioned this pull request Sep 29, 2026
1 task
@AlexAndBear AlexAndBear changed the title fix(editor): keep table of contents toggle size and follow active heading feat(editor): keep table of contents toggle size and follow active heading Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants