Skip to content

feat: add PNG caching and insights panel OCR tab#55

Merged
ddulic merged 5 commits intomainfrom
005-cache-png-insights-tabs
Mar 17, 2026
Merged

feat: add PNG caching and insights panel OCR tab#55
ddulic merged 5 commits intomainfrom
005-cache-png-insights-tabs

Conversation

@ddulic
Copy link
Copy Markdown
Owner

@ddulic ddulic commented Mar 17, 2026

Summary

  • PNG caching: Skip re-conversion of note pages when the blob already exists in storage; cache misses fail-open so users are never blocked
  • MD5 change detection: last_conversion_md5 column on UserFile (new alembic migration) tracks content hash so stale caches are invalidated when a note file changes
  • OCR tab: New GET /api/extended/{file_id}/ocr endpoint exposes per-page OCR text; SummaryPanel updated with AI / OCR tabs (AI is default)

Test plan

  • Open a large note, wait for full conversion, close and reopen — second open should skip conversion for already-cached pages
  • Modify a note file and reopen — pages should re-convert because the MD5 changed
  • Open Insights panel on a processed note — two tabs ("AI" and "OCR") are visible; AI tab active by default
  • Click OCR tab — per-page extracted text is displayed
  • Click OCR tab on an unprocessed note — empty/pending state shown, no error
  • Run ./script/test — all new tests pass

- Skip PNG re-conversion when blob already exists in storage (cache miss = fail-open)
- Track last_conversion_md5 on UserFile to detect note content changes
- Add /api/extended/{file_id}/ocr endpoint returning per-page OCR text
- Update SummaryPanel with AI / OCR tabs; AI tab is default
- Add alembic migration for last_conversion_md5 column
- Add tests for file service caching, OCR endpoint, and model completeness
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ddulic ddulic merged commit b41e0c8 into main Mar 17, 2026
4 checks passed
@ddulic ddulic deleted the 005-cache-png-insights-tabs branch March 17, 2026 21:47
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