Skip to content

Conversation

@anantham
Copy link
Owner

Summary

  • Restructure Settings modal from horizontal tabs to sidebar navigation with 4 logical sections (Settings, Features, Workspace, Export)
  • Add Gallery panel to browse all generated images organized by chapter
  • Add ImageLightbox for full-screen viewing with keyboard navigation
  • Enable cover image selection that persists to novel metadata
  • Wire cover image through to EPUB export with proper EPUB3 formatting

Changes

New Components

File Tests Purpose
SettingsSidebar.tsx 5 Collapsible sidebar navigation
GalleryPanel.tsx 6 Image gallery organized by chapter
ImageLightbox.tsx 12 Full-screen viewer with navigation

Modified Files

File Changes
SettingsModal.tsx Replace tabs with sidebar
hooks/useNovelMetadata.ts Add setCoverImage() function
components/settings/types.ts Add CoverImageRef type
services/epubService/types.ts Add coverImage to exports
services/epubService/packagers/epubPackager.ts EPUB3 cover handling
store/slices/exportSlice.ts Fetch cover from ImageCacheStore

Test plan

  • SettingsSidebar: 5 tests passing
  • SettingsModal: 3 tests passing
  • GalleryPanel: 6 tests passing
  • ImageLightbox: 12 tests passing
  • Build succeeds
  • Manual: Open Settings modal, verify sidebar navigation works
  • Manual: Navigate to Gallery, verify images appear
  • Manual: Click image to open lightbox, test arrow key navigation
  • Manual: Set cover, export EPUB, verify cover appears

Screenshots

To be added during review

🤖 Generated with Claude Code

anantham and others added 7 commits December 28, 2025 20:11
MOTIVATION:
- Users need an easy way to share translations with the community
- Current export flow requires manual file management
- No clear workflow for updating existing books in the library

APPROACH:
- Add 'Publish to Library' button to existing export modal
- Use File System Access API to pick local git repo folder
- Auto-detect existing metadata.json for update vs new scenarios
- Auto-compute stats from IndexedDB data

CHANGES:
- docs/plans/2025-12-28-publish-to-library-design.md: Full design spec

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
MOTIVATION:
- Users can now select a cover image in the Gallery panel
- The cover needs to flow through to the final EPUB file
- EPUB3 spec requires specific cover handling (manifest properties, cover.xhtml)

APPROACH:
- Add coverImage field to EpubMeta and EpubExportOptions types
- Update EPUB packager to handle cover images:
  - Extract base64 data from cover image
  - Create cover.xhtml with full-screen cover display
  - Add cover to manifest with properties="cover-image"
  - Add cover page to spine (first position)
  - Add meta name="cover" reference for EPUB2 compatibility
- Update exportSlice to fetch cover from Cache API using ImageCacheStore
- Convert blob to base64 data URL for embedding in EPUB

CHANGES:
- services/epubService/types.ts: Added coverImage to EpubMeta and EpubExportOptions
- services/epubService/packagers/epubPackager.ts: Full cover image processing
- services/epubService.ts: Pass coverImage to packager
- store/slices/exportSlice.ts: Fetch cover from ImageCacheStore before export

IMPACT:
- EPUBs now include cover image when selected in Gallery
- Cover displays as first page in e-readers
- Graceful fallback if cover fetch fails

TESTING:
- TypeScript compilation passes
- Build succeeds
- Settings tests pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
MOTIVATION:
- GalleryPanel and ImageLightbox lacked unit test coverage
- Tests ensure component behavior is verified before merging

CHANGES:
- components/settings/GalleryPanel.test.tsx: 6 tests
  - Empty state display
  - Chapter sections with images
  - Cover status indicator
  - Collapse/expand functionality
  - Filtering chapters without images
- components/settings/ImageLightbox.test.tsx: 12 tests
  - Image and info panel rendering
  - Cover button states
  - Close button and Escape key
  - Arrow navigation (buttons and keys)
  - Wrap-around at boundaries
  - Set as cover callback
  - Single image (no arrows)
  - Backdrop click to close

TESTING:
- All 18 tests passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Dec 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
lexicon-forge Ready Ready Preview, Comment Dec 29, 2025 7:06pm

MOTIVATION:
- Users confused by "File" and "Load" buttons doing different things
- Clicking "Load" with empty input silently did nothing

CHANGES:
- Rename "📁 File" → "📁 Import" (import from local file)
- Rename "Load" → "🔗 Fetch" (fetch from URL)
- Disable Fetch button when input is empty
- Add dynamic tooltip explaining what each button does

IMPACT:
- Clearer UX - users understand what each button does
- Fetch button visually disabled when no URL entered
- Hover tooltips provide additional context

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@anantham anantham merged commit 45d6c99 into main Dec 29, 2025
3 of 4 checks passed
@anantham anantham deleted the feat/gallery-sidebar-navigation branch January 1, 2026 07:48
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.

2 participants