Skip to content

Highlights feature#53

Open
vanadium23 wants to merge 6 commits intomainfrom
highlights-feature
Open

Highlights feature#53
vanadium23 wants to merge 6 commits intomainfrom
highlights-feature

Conversation

@vanadium23
Copy link
Copy Markdown
Owner

No description provided.

Deploy and others added 6 commits March 27, 2026 11:56
Add support for syncing and displaying book highlights from KOReader
devices in the Kompanion web UI.

## Features
- Highlight sync API endpoint: POST /api/v1/sync/highlight
- Web UI highlights section on book detail page
- Highlights sorted by page number
- Graceful error handling with empty states

## Implementation
- Add highlight entity and repository layer
- Implement batch upsert with SHA-256 text deduplication
- Add ListHighlights repository method with page sorting
- Wire highlight repository to web controller
- Add formatTime template function
- Create highlights section in book.html template
- Style highlights with CSS (card, text, note, meta)

## Database
- Migration: migrations/20260326_highlight.up.sql
- Table: sync_highlight with composite PK (koreader_partial_md5, text_hash)

## API Compatibility
Compatible with existing KOReader Kompanion plugin (no changes required)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Full cycle test for highlight sync feature:
- Upload book to library
- Sync highlights via API
- Verify highlights display on book detail page
- Test deduplication on re-sync
- Test empty state for books without highlights
- Test auth requirements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The integration tests were missing the testing package import,
causing compilation errors when running via docker-compose.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add kompanion.koplugin for KOReader that allows syncing book highlights
to the Kompanion server. The plugin provides:
- Setup dialog for server URL and device credentials
- Manual highlight sync triggered from KOReader menu
- Support for highlight text, notes, page, chapter, and color

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Isolate highlight listing from repository by introducing HighlightList
use case, similar to HighlightSync for API layer. This follows the
existing architecture pattern where controllers use use cases rather
than repositories directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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