Added table of contents modal for documents with multiple chapters:
New Features:
- TableOfContents component with modal dialog
- List icon button in chapter navigation bar
- Click any chapter to jump directly to it
- Current chapter highlighted in the list
- Scrollable list for books with many chapters
- Clean modal UI with transitions
Benefits:
- Quick navigation for large documents with many chapters
- Better UX for series/textbooks with 10+ chapters
- No need to click Previous/Next repeatedly
- Shows all chapter titles at a glance
Technical Details:
- Uses Headless UI Dialog for accessibility
- Integrates with existing goToChapter function
- Matches existing design system and styling
- Added to HTMLViewer chapter navigation bar
Fixed all TypeScript errors preventing build:
- Added TTSAudiobookChapter type import to HTMLContext
- Replaced 'any' types with proper TTSAudiobookChapter type
- Removed unused goToChapter from HTMLViewer destructuring
- Updated AudiobookExportModal to accept 'html' documentType
- Fixed HTMLContext return types to match EPUB/PDF contexts
- createFullAudioBook now returns Promise<string> (bookId only)
- regenerateChapter now returns Promise<TTSAudiobookChapter>
- Prefixed/removed unused parameters in placeholder functions
Build now completes successfully with only minor warnings
in placeholder code that will be implemented later.
Solve large file performance issues with automatic chapter pagination:
- Files >50KB automatically split into chapters
- Each chapter loads independently for instant performance
- TTS auto-advances through chapters seamlessly
HTMLContext enhancements:
- Integrate chapter detection on document load
- Track current chapter and total chapter count
- Implement chapter navigation (next/previous/goto)
- Register location change handler with TTS for auto-advance
- Only load current chapter text instead of entire file
HTMLViewer UI additions:
- Chapter navigation bar with Previous/Next buttons
- Display current chapter title and position (e.g., "Chapter 3 of 15")
- Responsive button states (disabled at start/end)
- Clean, minimal design matching existing UI
TTS Context improvements:
- Support location handlers for both EPUB and HTML
- Auto-advance to next chapter when reaching end
- Auto-reverse to previous chapter when going backwards
- Seamless playback across chapter boundaries
Benefits:
- 3.12MB file → ~60 chapters @ 50KB each
- Instant page loads instead of browser freeze
- Smooth TTS playback with automatic chapter transitions
- Memory efficient - only one chapter in memory at a time
- Works for both text and markdown files
Files changed:
- contexts/HTMLContext.tsx: Full pagination implementation
- components/HTMLViewer.tsx: Chapter navigation UI
- contexts/TTSContext.tsx: Handler-based auto-advance
Test with large files:
1. Open 3MB+ text file → automatically split into chapters
2. See chapter navigation bar at top
3. Click Previous/Next to navigate
4. Play TTS → automatically advances through chapters
- Isolate concurrent LibreOffice runs with per-job profile directories
(soffice -env:UserInstallation) and per-job temp folders
- Poll for generated PDF and verify stable file size before reading
- Consolidate temp artifacts under docstore/tmp and clean up via rm -r
- Add headless/nologo flags and improve error handling
ui(accessibility):
- ConfirmDialog exposes proper dialog roles
- DocumentFolder toggle adds type, aria-expanded, aria-controls, and title;
associate content panel with an id
- HTMLViewer wraps content in .html-container for HTML/TXT views
test: add comprehensive Playwright specs and helpers
- Accessibility, API health, deletion flows, folders, navigation, playback,
and upload scenarios
- Add sample.md and unsupported.xyz; update sample.pdf; extend helpers
ci: run Playwright workflow on version1.0.0 branch