Skip to content

feat: library statistics dashboard #124

Description

@nikazzio

Summary

Add a statistics overview to the Library view showing aggregate metrics about the user's manuscript collection.

Motivation

Users accumulate manuscripts over time but have no at-a-glance view of their archive's scope. A dashboard gives a sense of completeness and helps prioritize transcription work.

Proposed metrics

  • Total manuscripts in library
  • Total pages across all manuscripts
  • Pages with transcriptions (count + %)
  • Pages with OCR completed (count + %)
  • Total disk space used (downloads + thumbnails)
  • Provider breakdown (pie/bar chart: how many from BnF, BSB, etc.)
  • Recently added / recently worked on

Proposed approach

  • New route GET /library/stats returning an HTMX partial.
  • All metrics computable from SQLite queries on existing tables.
  • Optional: lightweight chart via Chart.js or pure CSS bars.
  • Accessible from Library toolbar or as a collapsible panel.

Acceptance criteria

  • Stats panel visible in Library view
  • Shows manuscript count, page count, transcription coverage
  • Shows disk usage
  • Provider distribution displayed
  • Responsive — works on narrow screens
  • Data loads fast (<500ms for typical library of ~100 manuscripts)

Technical notes

  • Disk usage: sum file sizes under downloads/ per manifest.
  • Transcription coverage: query transcriptions table grouped by manifest.
  • Consider caching stats with a short TTL to avoid re-scanning on every load.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:libraryLibrary local assets and catalog viewsminorIncrements the minor version when adding new functionality in a backward-compatible manner.priority:P2Medium prioritystatus:readyReady to be implementedtype:featureNew user-facing feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions