Skip to content

feat: Add thumbnail canvas cache with LRU eviction - #145

Merged
Gnathonic merged 3 commits into
mainfrom
feat/thumbnail-canvas-cache
Jan 23, 2026
Merged

feat: Add thumbnail canvas cache with LRU eviction#145
Gnathonic merged 3 commits into
mainfrom
feat/thumbnail-canvas-cache

Conversation

@Gnathonic

Copy link
Copy Markdown
Owner

Summary

  • Add LRU cache for thumbnail ImageBitmaps with 50MB memory limit
  • Add ThumbnailCanvas component with visibility-based lazy loading
  • Coalesces concurrent requests for the same thumbnail
  • Right-aligned drawing preserves manga spine visibility

Details

thumbnail-cache.ts: GPU-ready bitmap cache that:

  • Tracks decoded memory usage (width × height × 4 bytes)
  • Evicts least recently used entries when limit exceeded
  • Prevents duplicate loads via pending request tracking

ThumbnailCanvas.svelte: Canvas-based thumbnail renderer that:

  • Uses IntersectionObserver for visibility-based loading
  • Draws right-aligned for manga/RTL layouts
  • Re-renders efficiently on dimension changes

🤖 Generated with Claude Code

Add GPU-ready ImageBitmap caching for catalog thumbnails:
- LRU cache with 50MB memory limit
- Coalesces concurrent requests for same thumbnail
- Canvas component with IntersectionObserver for lazy loading
- Right-aligned drawing for manga spine visibility

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

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Jan 19, 2026

Copy link
Copy Markdown

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

Project Deployment Review Updated (UTC)
mokuro-reader Ready Ready Preview, Comment Jan 23, 2026 11:01am

Request Review

- Add concurrency throttling to thumbnail cache (max 6 parallel loads)
- Use FILO ordering so visible items load before scrolled-past items
- Add IntersectionObserver for lazy loading (200px preload margin)
- Add cache invalidation when volume covers are edited
- Remove spine showcase alpha warning now that performance is fixed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Gnathonic
Gnathonic marked this pull request as ready for review January 23, 2026 13:45
@Gnathonic
Gnathonic merged commit 64f4a81 into main Jan 23, 2026
7 of 8 checks passed
@Gnathonic
Gnathonic deleted the feat/thumbnail-canvas-cache branch January 23, 2026 13:45
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