Skip to content

perf: resize R2 thumbnails in chat and galleries#17569

Merged
e7h4n merged 1 commit into
mainfrom
perf/r2-image-thumbnails
Jun 13, 2026
Merged

perf: resize R2 thumbnails in chat and galleries#17569
e7h4n merged 1 commit into
mainfrom
perf/r2-image-thumbnails

Conversation

@e7h4n

@e7h4n e7h4n commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a shared r2ImageTransformUrl helper for cdn.vm0.io and cdn.vm7.io R2 image transform URLs, while leaving non-CDN and already transformed URLs unchanged.
  • Use transformed thumbnail URLs for web chat image previews, artifact preview badges, composer template cards, selected template chips, presentation preview slides, illustration previews, and video posters.
  • Use transformed preview URLs across gallery-style web pages: Illustration, Web Design, Reports, Presentation, and Sprite; add cdn.vm7.io to Next image remote patterns.

Tests

  • pnpm exec prettier --write <changed files>
  • git diff --check
  • pnpm --filter @vm0/core lint
  • pnpm --filter web lint
  • pnpm --filter @vm0/app lint
  • pnpm --filter @vm0/core check-types
  • pnpm --filter web check-types
  • pnpm --filter @vm0/app check-types
  • pnpm --filter @vm0/core test -- src/__tests__/r2-image-transform.spec.ts
  • pnpm exec vitest run src/views/zero-page/__tests__/chat-composer-models-and-templates.test.tsx -t "selects and removes an illustration style from the picker"

Notes

  • An unfiltered run of src/views/zero-page/__tests__/chat-composer-models-and-templates.test.tsx hit two unrelated existing failures: the slash picker keyboard selection timeout and the /custom-skill-1 visible picker expectation. The targeted thumbnail test passes.

@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...latform/src/views/zero-page/zero-chat-composer.tsx 85.71% 2 Missing ⚠️
turbo/packages/core/src/r2-image-transform.ts 96.87% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

API preview: https://pr-17569-api.vm6.ai

@github-actions

Copy link
Copy Markdown
Contributor

⚡ Lighthouse — Web

Category Score
🟠 Performance 65
🟢 Accessibility 96
🟠 Best Practices 75
🟢 SEO 100

Tested URL: https://pr-17569-www.vm6.ai/ · Full report

@e7h4n e7h4n left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Summary

This PR adds a shared R2 image transform URL helper for vm0/vm7 CDN assets and applies it to chat previews, composer template previews, selected chips, and web gallery preview images. It also extends the web Next image remote pattern list for cdn.vm7.io.

Findings

No P0 or P1 issues found.

Testing

  • Coverage: Adequate for this performance-focused change. The helper has focused coverage for vm0/vm7 CDN URLs, query/hash preservation, already transformed URLs, and non-R2 fallbacks; the touched composer behavior also has an updated UI expectation.
  • Conventions: Compliant. I did not find forbidden internal mocks, direct fetch mocking, fake timers, or mocked database usage in the changed tests.
  • Verification: GitHub check rollup is green for the PR; git diff --check origin/main...HEAD passes locally.

@e7h4n e7h4n added this pull request to the merge queue Jun 13, 2026
Merged via the queue into main with commit a91f0cf Jun 13, 2026
86 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in VM0 Kanban Jun 13, 2026
@github-actions github-actions Bot mentioned this pull request Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant