Skip to content

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

Merged
gvonness-apolitical merged 1 commit intomainfrom
feat/toc-virtual-scrolling
Feb 3, 2026
Merged

feat(toc-panel): add virtual scrolling for large TOC lists#19
gvonness-apolitical merged 1 commit intomainfrom
feat/toc-virtual-scrolling

Conversation

@gvonness-apolitical
Copy link
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

@gvonness-apolitical gvonness-apolitical 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
@gvonness-apolitical gvonness-apolitical force-pushed the feat/toc-virtual-scrolling branch from 3f97b41 to 6b7d774 Compare February 3, 2026 03:52
@gvonness-apolitical gvonness-apolitical merged commit 94da868 into main Feb 3, 2026
3 checks passed
@gvonness-apolitical gvonness-apolitical deleted the feat/toc-virtual-scrolling branch February 3, 2026 03:55
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