Skip to content

Add library export options#12

Open
kvmgithub wants to merge 1 commit into
Promises:mainfrom
kvmgithub:feature/library-export
Open

Add library export options#12
kvmgithub wants to merge 1 commit into
Promises:mainfrom
kvmgithub:feature/library-export

Conversation

@kvmgithub
Copy link
Copy Markdown

Summary

This change adds a library export panel to the main Library screen. Users can export the currently searched and filtered library to CSV, JSON, XLSX, TXT, and PNG, or copy the formatted TXT export directly to the system clipboard.

What changed

  • Added an export button next to the existing search button in the Library header.
  • Added an export controls panel that follows the same toggle pattern as the search/filter controls.
  • Added selectable export formats:
    • CSV
    • JSON
    • XLSX
    • TXT
    • PNG
  • Added export sorting by name or audiobook length, with ascending/descending direction.
  • Added grouping options for author and series.
  • Export now fetches all books matching the current Library search/filter state, not just the visible paginated rows.
  • Added a shared TypeScript export utility for normalizing book metadata and generating CSV, JSON, XLSX, TXT, and PNG input data.
  • Added structured TXT output with a header, numbered audiobook entries, and indented bullet-style metadata lines.
  • Added a Copy TXT action that places the same formatted TXT output on the Android system clipboard.
  • Added Android native bridge support for:
    • rendering the PNG export as a bitmap with covers, titles, authors, series, and lengths;
    • copying formatted text to the system clipboard.

User impact

Users can now export their library in the formats supported by Libation-style workflows, plus a visual PNG summary of the library view. The export respects the active search/filter scope and can be organized by title, length, author, and series.

The TXT format is useful for quick sharing and note-taking because it is readable without spreadsheet software. The clipboard action avoids creating a file when users only need to paste a structured list into another app.

Implementation notes

The XLSX export is generated directly as a minimal Office Open XML workbook so no new JavaScript dependency is required.

The PNG export uses the Android native bridge because the current app does not have a cross-platform view-capture or canvas dependency. The renderer builds a single image from the same normalized export rows used by the other formats and attempts to load cover images when available.

The clipboard feature uses Android's native ClipboardManager through the existing Expo Rust bridge module, avoiding an additional clipboard package.

Validation

Automated validation:

  • npm run typecheck
  • ./gradlew :app:compileDebugKotlin
  • git diff --check

Manual Android validation:

  • npm run build:rust:android
  • npx expo run:android
  • CSV export verified.
  • JSON export verified.
  • XLSX export verified.
  • TXT export verified.
  • PNG export verified.
  • TXT clipboard copy verified.

@kvmgithub kvmgithub marked this pull request as ready for review May 16, 2026 16:32
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