Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

feat(toc-panel): add virtual scrolling for large TOC lists#19

Merged
gvonnessi merged 1 commit into
mainfrom
feat/toc-virtual-scrolling
Feb 3, 2026
Merged

feat(toc-panel): add virtual scrolling for large TOC lists#19
gvonnessi merged 1 commit into
mainfrom
feat/toc-virtual-scrolling

Conversation

@gvonnessi

Copy link
Copy Markdown
Collaborator

Summary

  • Implement virtual scrolling for TOC panels with >50 flattened items
  • Only render visible items plus a buffer (5 items above/below) for improved performance with large TOCs
  • Flatten nested items for virtual scroll while preserving level-based indentation via CSS classes
  • Add ResizeObserver for dynamic container height updates
  • Standard (nested) rendering still used for smaller lists (<50 items)

Changes

  • src/components/ui/toc-panel.ts: Added virtual scrolling logic with configurable threshold (50 items)
  • src/components/ui/toc-panel.test.ts: Added 18 tests covering virtual scrolling, events, accessibility

Test plan

  • All 232 tests pass
  • Build succeeds
  • Manual testing with large EPUBs/PDFs that have extensive TOCs

@gvonnessi gvonnessi force-pushed the feat/toc-virtual-scrolling branch from a0986c1 to 3f97b41 Compare February 3, 2026 03:48
- Implement virtual scrolling for TOC panels with >50 items
- Only render visible items plus buffer for better performance
- Use absolute positioning and a spacer element for scroll height
- Flatten nested items for virtual scroll rendering
- Preserve level-based indentation via CSS classes
- Add ResizeObserver for dynamic container height updates
- Add comprehensive tests for virtual scrolling behavior
@gvonnessi gvonnessi force-pushed the feat/toc-virtual-scrolling branch from 3f97b41 to 6b7d774 Compare February 3, 2026 03:52
@gvonnessi gvonnessi merged commit 94da868 into main Feb 3, 2026
3 checks passed
@gvonnessi gvonnessi deleted the feat/toc-virtual-scrolling branch February 3, 2026 03:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant