Skip to content

feat(frontend): add image optimization with thumb() utility#14

Merged
drizki merged 1 commit intomainfrom
feat/image-optimization
Feb 2, 2026
Merged

feat(frontend): add image optimization with thumb() utility#14
drizki merged 1 commit intomainfrom
feat/image-optimization

Conversation

@drizki
Copy link
Contributor

@drizki drizki commented Feb 2, 2026

Summary

Adds server-side image resizing support to the frontend via a new thumb() utility function.

Changes

  • New: apps/isekai-frontend/src/lib/image.ts

    • thumb(url, width, options?) - generates optimized image URLs with resize query params
    • ImageSize constants: XS (128), SM (256), MD (400), LG (800), XL (1200)
  • Updated components:

    Component Thumbnail Size Lightbox
    ReviewGridItem Grid: MD, List: XS -
    DraftTableRow XS Unchanged (original)
    ReviewDetailPanel LG Unchanged (original)
    Dashboard SM (grid), XS (schedule list) -
    Scheduled XS Unchanged (original)
    Published XS Unchanged (original)
    Schedule XS (all cards) -
    EditDeviation MD -

How it works

When served through vault-proxy, the ?w=400 (or similar) query params trigger server-side image resizing. When served directly from R2/S3, the params are ignored for graceful degradation.

Testing

  • TypeScript compiles without errors
  • Build succeeds
  • Manual testing with pnpm dev

- Add src/lib/image.ts with thumb() function and ImageSize constants
- thumb() appends ?w=WIDTH query params for vault-proxy server-side resizing
- Graceful degradation: params ignored when served directly from R2/S3

Updated components:
- ReviewGridItem: Grid thumbnails (MD), List thumbnails (XS)
- DraftTableRow: Table thumbnails (XS), lightbox unchanged
- ReviewDetailPanel: Preview (LG), lightbox unchanged
- Dashboard: All grid images (SM), schedule list (XS)
- Scheduled: Table thumbnails (XS), lightbox unchanged
- Published: Table thumbnails (XS), lightbox unchanged
- Schedule: All card thumbnails (XS)
- EditDeviation: File previews (MD)
@codecov
Copy link

codecov bot commented Feb 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@drizki drizki merged commit 0d0d819 into main Feb 2, 2026
2 checks passed
@drizki drizki deleted the feat/image-optimization branch February 2, 2026 16:11
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.

2 participants