Repository navigation
feat(about): carousel photos in Payload, compressed on upload - #53
Merged
maxitect merged 6 commits intoNov 13, 2026
Merged
Conversation
✅ Deploy Preview for clarksbowlingclub ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
maxitect
force-pushed
the
feat/43-carousel-photos-in-payload-with-images-compressed
branch
from
November 13, 2026 00:48
6972d9b to
247afda
Compare
maxitect
marked this pull request as ready for review
November 13, 2026 00:51
maxitect
deleted the
feat/43-carousel-photos-in-payload-with-images-compressed
branch
November 13, 2026 00:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The About page carousel now reads its photos from Payload, and every image uploaded to
mediais compressed, in the browser before it leaves the admin and again on the server as a safety net. With no photos in the global, the page keeps showing the repo images.Changes
carouselarray of onephotoupload (tomedia) and a localised, requiredalt. One migration,20261113_001547_carousel: two child tables with real foreign keys, no_relstable.mediauploads: Payload'sresizeOptions(2560 px, never enlarged),formatOptions(progressive JPEG, quality 80) andmimeTypeslimited to JPEG, PNG and WebP, the formats both the browser and the server re-encode as a still JPEG.uifield onmedia(ImageCompressor) watches the form'sfile, re-encodes with jSquash (@jsquash/jpeg,@jsquash/resize) and swaps the file before submit. It shows the original and compressed size, and uploads the original when the codec cannot run. Payload has a slot that replaces the Upload section (admin.components.edit.Upload), but using it means re-implementing the stock Upload, whose props the slot does not receive; auifield withuseField({ path: "file" })reaches the same form value without copying Payload's code.'wasm-unsafe-eval'inscript-srcfor/adminonly.AboutClienttakes the photos from the cached About reader (getAboutPage).carouselFallback.tsholds the four repo images and their alt texts, used while the global has no photos.content:importimports the four photos (media rows and global) in order, and skips when the global already has photos.Acceptance criteria
Closes
Closes #43
Notes
requiredfield for the locale being saved only, so "both languages" means a blank alt is rejected in English and in French. A new photo saved in English alone passes, and the French page shows the English alt throughfallback: true. Payload has no supported way to require the other locale in the same save.media.altstays required and localised as it was, so an editor creating a photo inline fills it as well as the row'salt. The import fills both.ALTER TABLE "calendar_settings" ... SET DEFAULT false(snapshot drift from Advent calendar live at /calendrier by 1 December #29; production's column already has that default). I removed it fromupanddown.photo_idisNOT NULL, Payload makes the keyON DELETE SET NULL), which protects the page.Carouselcomponent is untouched, to keep the rebase with Performance: home page weight, images, caching and function region #35 small. Its fixed 5000x500Imagedimensions are Performance: home page weight, images, caching and function region #35's.next devsometimes loops with "Maximum update depth exceeded" until the server restarts. It never appeared on a fresh server or in the production build.After merge (for the user)
payload migrateon Neonmain:20261113_001547_carouselapplies on top ofinitial,calendarandcalendar_checks(proved below onpreviewreset frommain)./admin/globals/about-page, or runNODE_ENV=production pnpm content:importagainstmainto import the four current photos. Until then the page shows the repo images.public/images/carousel/andsrc/lib/data/carouselFallback.ts(and the fallback line incontent.ts).Review
Verdict: ALL CLEAR
Rounds: 2
Rebased onto
mainafter #51 (no conflicts) and pushed with--force-with-leasepinned to 6972d9b.image/*formatOptionshas no background optionRe-verified: AC4 and AC5 (deploy, rebuilt preview 247afda: 11.93 MB JPEG "Compressed in the browser: 11.93 MB to 514 KB.", POST 201;
mediarow photo12.jpg image/jpeg 2560x1920 481618; bucket photo12.jpg 481618) PASS, AC7 (browser, admin: notes.txt and anim.gif POST 400, acceptimage/jpeg, image/png, image/webp) PASS, AC4 (browser, production build: 13.71 MB JPEG compressed in the browser, POST 201, stored image/jpeg 2560x1920) PASS, codec-blocked fallback (browser) PASS, AC8 (browser: live region and arrow keys) PASS,/aboutfallback on a production build readingpreviewreset frommain(four repo images, EN and FR, 1280 and 390, no console errors) PASS, migration up/down/up onpreviewreset frommainPASS,migrate:create: "No schema changes detected" PASS · check.sh PASSEvidence
AC1
Before is production (
https://clarksbowlingclub.com), after is this branch ondevafterpnpm content:import. Alt texts are read from the rendered<img>elements.The French page showed the English alt texts before and still does: the hard-coded list had one language.
AC2
AC3
AC4 and AC5
On
https://deploy-preview-53--clarksbowlingclub.netlify.app/admin, headless Chromium, media create page, test files of 18.5 MB (JPEG) and 22.9 MB (PNG), both above the 12 MB asked for:With the carousel global empty, the preview's
/aboutstill renders the four repo images (/_next/image?url=%2Fimages%2Fcarousel%2Fargentic.jpg, posing, leaving, yesday), so production keeps its photos until the band uploads.AC6
The PNG is random noise, which does not compress; real photos land well under 1 MB.
AC7
AC8
Migration on production's state
neon branches reset preview --parent, then with the preview env loaded (NEON_BRANCH=preview):Compression in the browser (production build)