Skip to content

Add chapter detection and navigation dropdown#15

Open
Ck-Dev786 wants to merge 1 commit intothomaskolmans:mainfrom
Ck-Dev786:feature/chapter-navigation
Open

Add chapter detection and navigation dropdown#15
Ck-Dev786 wants to merge 1 commit intothomaskolmans:mainfrom
Ck-Dev786:feature/chapter-navigation

Conversation

@Ck-Dev786
Copy link
Copy Markdown

✨ Add Chapter Navigation Support

This PR introduces chapter-aware navigation to improve usability when reading long documents.

🚀 Features

  • Detects structured section headings (e.g. 1, 1.1)
  • Adds a "Jump to Chapter" dropdown in the header
  • Allows quick navigation to detected sections
  • Automatically updates current chapter during reading

🧠 Implementation Details

  • Added heuristic-based detectChapters() to parse numeric section headings
  • Maps chapters to word indices for navigation
  • Reactive tracking of current chapter based on reading progress
  • Integrated dropdown UI with existing header controls

⚠️ Notes

  • Detection is heuristic-based due to lack of structured metadata in PDFs
  • Works best with structured documents like textbooks and academic PDFs
  • Filtering added to avoid noise (e.g. years, random numbers)

This improves navigation significantly for long documents without affecting existing functionality.
image_2026-03-24_175136620
image_2026-03-24_175226275

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