Skip to content

fix(web): crisp thumbnails via Cloudflare transforms + backfill capped screenshot groups - #726

Merged
Zach Dunn (zachdunn) merged 2 commits into
mainfrom
claude/thumbnail-image-quality-201b21
Aug 21, 2026
Merged

fix(web): crisp thumbnails via Cloudflare transforms + backfill capped screenshot groups#726
Zach Dunn (zachdunn) merged 2 commits into
mainfrom
claude/thumbnail-image-quality-201b21

Conversation

@zachdunn

@zachdunn Zach Dunn (zachdunn) commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

Two thumbnail fixes on the signed-in pages:

1. Thumbnails now go through Cloudflare Image Transformations (1899a97)

Thumbnail tiles inlined the full-size original and let the browser downscale it — jagged text on small tiles, and multi-MB full-page captures fetched for 26px thumbs. New thumbUrl(src, width) helper rewrites uploads.sh-zone embed URLs (embed. / storage. / store.uploads.sh) to the same-origin /cdn-cgi/image/width=…,quality=82,fit=scale-down,format=auto,onerror=redirect/… path form. Applied at 2× CSS size for retina:

  • File table: list thumb (64), grid card (560)
  • Screenshots page: tiles (560), hover preview (1120)

Pass-through for BYO-bucket hosts, SVGs, and already-transformed URLs; onerror=redirect falls back to the original bytes on transform failure; fit=scale-down never upscales. Transformations is already enabled on the zone (verified against prod: 63KB original → ~1.7KB tile). Full-size viewers (/f/ MediaStage, galleries) untouched. No CSP change — the transform URL is same-origin on the image host.

2. Screenshots page: backfill thumb strips past the by-path group cap (985dae0)

The by-path overview thumbs only the 50 most-recent (project, path) groups globally, while the filterable catalog carries up to 500 paths. Filtering by project surfaced catalog paths whose group fell past that cap, rendering bare headings with no tiles. Those strips are now fetched lazily through the same files/search?meta.path=… route the drill-in uses, filtered to the group's project via the projectLabelFromItemMeta mirror, batched 12 per pass (chained until done) and cached per (project, path). No API change.

Verification

  • 9 new unit tests (thumb-url.test.ts, workspace-screenshots.test.ts); full web suite 748 passing, astro check + worker typecheck clean.
  • Prod curl: transform endpoint 200s on both embed and storage hosts with correctly resized output.
  • Local stack repro: seeded a workspace where one project had 56 catalog paths and 0 thumbed groups — before the fix, 56 bare headings; after, 56/56 groups show strips, all searches 200, no console errors.

Visual

Same prod screenshot rendered at tile width — left is the old full-size original browser-downscaled, right goes through the transform (63.6 KB → 8.5 KB transferred):

Thumbnail quality and payload before/after Cloudflare image transform

Thumbnail tiles inlined the full-size original and let the browser
downscale it, which made text look jagged. thumbUrl() rewrites
uploads.sh-zone embed URLs to the same-origin /cdn-cgi/image path form
(fit=scale-down, format=auto, onerror=redirect); other hosts, SVGs, and
already-transformed URLs pass through untouched. Applied to the file
table list thumb (64) and grid card (560), and the screenshots page
tiles (560) and hover preview (1120).
The by-path overview thumbs only the 50 most recent (project, path)
groups; filtering — especially by project — surfaces catalog paths past
that cap, which rendered as bare headings with no tiles. Backfill those
strips lazily through the drill-in's files/search?meta.path route,
filtered to the group's project with the projectLabelFromItemMeta
mirror, batched 12 per pass and cached per (project, path). Late
responses are never dropped: the cache is view-independent, so the
effect keeps no cancellation guard.
@changeset-bot

changeset-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 985dae0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
uploads-web 985dae0 Commit Preview URL

Branch Preview URL
Aug 21 2026, 12:43 AM

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (2)
  • coderabbit:review
  • review
🚫 Excluded labels (none allowed) (1)
  • wip

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f27d2d3a-7982-4279-b083-2f10710dac35

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@uploads-sh

uploads-sh Bot commented Aug 21, 2026

Copy link
Copy Markdown

thumb-compare.webp

Maintained by uploads.sh · add media: uploads put <file> --pr 726 · docs

@zachdunn
Zach Dunn (zachdunn) merged commit 778d68d into main Aug 21, 2026
4 checks passed
@zachdunn
Zach Dunn (zachdunn) deleted the claude/thumbnail-image-quality-201b21 branch August 21, 2026 00:44
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