Repository navigation
refactor(image): route hand-rolled <img> elements through the Image atom - #214
Conversation
Both branches render, and a hidden <img> is still fetched, so since #141 a desktop visitor took the desktop branch's `width=800` variant and the mobile branch's unresolved `/public` original — the same picture twice. The mobile branch now uses the atom with the desktop branch's `sizes`, so both resolve the same srcset candidate and the browser makes one request. `rounded="none"` keeps today's square corners against the atom's `rounded-xs` default, and the atom's container supplies the `relative aspect-video overflow-hidden` the wrapper div was carrying. The comment refusing the atom "until #148" is stale: #148 merged in f1f8aa7, and the atom's first render now carries `opacity-100`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW2ei3KxPxbsi25Xd8
The lead image was a raw <img> on the unresolved `/public` URL, so it
fetched the full original and offered no srcset. It now goes through the
atom with `aspectRatio="video"` and `forceAspectRatio={false}`: since
#141 a variant is a width-only `width=<n>` segment, so the ratio picks
which widths the srcset offers and crops nothing.
`sizes` tracks the `max-w-3xl` column this content renders in, not the
viewport — the earlier `100vw` reading missed that AtlasContent sets its
own column. `className` reaches the <img> rather than the container, so
the margin moved to an element of its own.
The comment refusing the atom "until #148" is stale: #148 merged in
f1f8aa7, so the atom's first render is visible to a reader who never
hydrates — which is most of this markup's audience.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjW2ei3KxPxbsi25Xd8
The atlas `sizes` declared the `max-w-3xl` cap, but that cap bounds the padded box, so the image is 720px and never 768. Declaring the cap cost a whole srcset tier at DPR 2 — a Pixel 7 fetched `width=1536` for a slot needing `width=1024`. It now declares the gutters it actually renders in. ContentOverlay's two branches must agree on `sizes` or the browser resolves the srcset twice, which is the bug this ticket fixes. That coupling was a comment; it is now one constant both branches read. Also: drop `max-w-full`, inert beside `w-full` and carried over from the raw <img>; fold four overlapping specs into two; cut comments restating the atom's own prop docs and docs/rules/testing.md. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW2ei3KxPxbsi25Xd8
|
Should #150's criteria 4 and 6 — an explicit Two records of yours disagree. #150's body folds the line in. #152's Decisions says: "→ With #146, in PR #207. This ticket drops them and blocks on it instead (Ardnived, 2026-10-28)."
I recommend A, and read #207's LCP call as the better evidenced: the circle is 384–512px against a 128px Reply with a letter, or your own answer. 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Deploying wemeditate-design with
|
| Latest commit: |
f852103
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fa423818.wm-design.pages.dev |
| Branch Preview URL: | https://claude-refactor-150-image-at-7l3f.wm-design.pages.dev |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-web | f852103 | Commit Preview URL Branch Preview URL |
Oct 28 2026, 05:52 PM |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The diff is the ticket and nothing more: two call sites, one constant, one wrapper div. It is smaller than #150, because criteria 4 and 6 were reassigned to #146 / PR #207, and #152's Decisions carries that in the reviewer's own words, dated 2026-10-28. The omission is sanctioned, not skipped. The question thread asking it again is right.
Every behavioural claim in the body holds on the preview, the two the ticket asked to be confirmed included: the atlas sizes is the column measured inside its gutters, and the ticket's own 100vw was wrong. No contract surface is touched — AtlasSeoImage is hand-written here and unchanged, and the diff adds no type, prop or export.
One redundancy, pre-existing but now provable from the diff. Nothing blocking.
Findings
consider—ContentOverlay.tsx:217: the desktop branch restates three utilities the atom already emits. The new mobile branch is the proof.
What was checked
Read whole: ContentOverlay.tsx, AtlasContent.tsx, Image.tsx, both specs, server/atlas-types.ts, blockConverters.tsx. #150 and #152, whose Decisions line matches the body verbatim. Reviewer profile read.
Re-derived, not taken from the body:
- Home page: each overlay's two branches share one
…/width=800src, one 4-entrysrcSetandsizes="100vw".…/publicmatches 0 times. Onerel="preload" as="image", theSplashhero's. - Belfast class page:
width=800, a 640/800/1024/1536srcSet, the three-clausesizes,loading="lazy",opacity-100, 0aspect-video, 0 preloads. Ladle alias returns 200. - The
sizesarithmetic fromAtlasContent.tsx:193(mx-auto max-w-3xl px-4 py-8 sm:px-6): the 48rem cap less 3rem of gutters is 720px, and100vw - 3remreaches 720px at exactly 48rem. AtlasContentrenders one image site, so the conversion left no sibling outside it.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The desktop branch passed `w-full h-full object-cover` to <Image>, which already emits all three for a boxed aspect ratio — the home-page preview rendered them twice in one class attribute. The new mobile branch proves it: it passes no className and renders the same box. `imageBlendClass` is the only part doing work, and it is '' for every variant but highContrast, so the className is now that alone. Verified by SSR render: the desktop <img> loses exactly the three duplicates and keeps `brightness-70 contrast-70` on highContrast. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWp4SWjtxLvy4vB16y
|
One finding addressed, and
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
The session for this item did not finish after 3 attempts. I have stopped retrying. A mention ( 🤖 sydevs dispatcher |
#214 routed ContentOverlay and AtlasContent through the Image atom, which is what this guard's docstring said would happen there rather than here. The pin is a measurement, so merging main moved it. The reason for stopping at <Image> is unchanged: four of the six remaining raw tags still do not name getImageURL, so that arm would still need the exemption list the guard refuses. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXyy2UmAFQvQw35rQN
Summary
ContentOverlay's mobile branch and the atlas lead image now render through theImageatom, so both request awidth=<n>variant and emit asrcSet.MeditationPlayeris not here. fix(image): nothing stops a hand-rolled eager <img>, and three specs cannot fail #152's Decisions section records you assigning that line to fix(image): six paths skip the variant pipeline, four over-fetch #146's PR fix(image): six paths skip the variant pipeline, four over-fetch #207 on 2026-10-28. See Notes.Change outline
Behaviour — what each site asks Cloudflare for now
Both sites previously reached
getImageURLwith noaspectRatio, so the URL passed through unresolved andgetImageSrcSetreturned''.Flow — why the overlay fetched twice, and what ends it
Both branches stay in the DOM at every breakpoint, and a hidden
<img>is still fetched. Since #141 merged (PR #147) they resolved to different URLs.one overlay block, desktop visitor desktop <Image aspectRatio="video"> getImageURL(src, 'width=800') → …/<id>/width=800 ← fetched mobile `````<img src={imageSrc}>````` - no resolution → …/<id>/public ← fetched again + mobile <Image aspectRatio="video" sizes={LEAD_IMAGE_SIZES}> + same srcSet + same sizes + same DPR → …/<id>/width=800 ← same candidate, one fetchBehaviour — the atlas
sizesis the column, not the viewportThe ticket proposed
100vw, and asked for it to be confirmed against the rendered width. It does not hold:AtlasContentsets its own column atmx-auto max-w-3xl px-4 py-8 sm:px-6, andmax-w-3xlcaps the padded box.Declaring the cap costs a whole srcset tier at DPR 2 — a 412px-wide phone at DPR 2.625 would have declared 1081 and taken
width=1536for a slot needingwidth=1024.Preview
Branch aliases, each confirmed to serve this branch's own markup rather than derived from the branch name:
ContentOverlayblocks. Both branches of each now resolve…/504d3db7…/width=800; before this PR the mobile one was on/public.…/picture-105…/width=800with a 4-entry srcSet.Both render from live SahajCloud data, so nothing needed seeding. The alias follows the head commit, and
f852103removes only duplicate class names, so both pages look the same before and after its build.Test results
.claude/skills/pr-prep/check.sh— lint (0 errors; the 2 warnings on changed files are both pre-existing onmain),tsc --noEmit,test:run.pnpm build. Both re-run onf852103, afterorigin/mainwas merged in — the merge was clean, and its only overlap with this branch is a comment inAtlasContent.tsxthat chore(urls): record the Link relativize decision in comment and docs #210 rewrote.renderToStaticMarkupwas probed directly to confirm React 19 really does hoist<link rel="preload">there — otherwise the twonot.toContain('rel="preload"')assertions would assert nothing.…/<image_id>/public. Verified against the producer, not assumed —sydevs/SahajCloudsrc/plugins/storage/cloudflareImagesAdapter.tsbuilds`${config.deliveryUrl}/${imageId}/public`, andsrc/endpoints/atlas/seo/seoDocument.tspasses Payload's virtualurlthrough untouched./security-reviewskipped — no changed path matchessecurityReview.triggerPattern.comment-lintclean.Verified on the deployed preview, items 1–4 of the ticket's checklist:
ContentOverlay<img>s on the home page carry the samesrc(…/504d3db7…/width=800), the same 4-entrysrcSetandsizes="100vw", so the browser picks one candidate and makes one request./public.imagedelivery\.net/[^/]*/[^/"]*/publicmatches 0 times on the home page. It would have matched twice before this PR — the two sites fix(image): six paths skip the variant pipeline, four over-fetch #207's body assigns to this ticket.width=800with a 640/800/1024/1536 srcSet,sizes="(max-width: 40rem) calc(100vw - 2rem), (max-width: 48rem) calc(100vw - 3rem), 720px",loading="lazy",opacity-100(so a no-JS reader sees it), and noaspect-videobox, so it is not cropped.Splashhero's deliberatefetchPriority="high"preload, not an overlay's.Manual verification
mainat mobile and desktop widths. The variants change bytes, not layout, so anything that moves is a defect.rounded(4px) to the atom'srounded="square"(rounded-xs, 2px), which the ticket sanctions. Worth a glance.opacity-100on first render — but that has not been checked in a real browser.Notes for reviewer
MeditationPlayer.tsx:685is deliberately untouched, against this ticket's criteria 4 and 6. refactor(image): route hand-rolled <img> elements through the Image atom #150's body folds it in, but fix(image): nothing stops a hand-rolled eager <img>, and three specs cannot fail #152's Decisions section records the opposite, from you, dated the same day: "→ With fix(image): six paths skip the variant pipeline, four over-fetch #146, in PR fix(image): six paths skip the variant pipeline, four over-fetch #207. This ticket drops them and blocks on it instead (Ardnived, 2026-10-28)", and "Neither is this ticket's work." PR fix(image): six paths skip the variant pipeline, four over-fetch #207 is open with your review requested and takes that line toloading="eager" fetchPriority="high"plus a square variant, reasoning thatMeditationTemplaterenders the player as the page's only content. I builtloading="lazy"first, then dropped it: it would have conflicted in two files and shipped the loser red, and fix(image): six paths skip the variant pipeline, four over-fetch #207's reading looks better evidenced than mine — the circle is 384–512px against a 128pxAvatar. Criteria 4 and 6 are met by fix(image): six paths skip the variant pipeline, four over-fetch #207, not by this PR. Asked as a question thread; say the word and I will take the line.sizes="100vw"for the atlas image was wrong, and it told me to confirm it. See the third outline view.srcSetsurvives SSR assrcset". It does not — React 19 keeps it camelCase, so the checklist's owngrep -o 'srcset="…"'returns 0 on a page with 7.docs/rules/testing.mdhas it right, and fix(image): nothing stops a hand-rolled eager <img>, and three specs cannot fail #152 §2 exists to fix the three specs that inherited the error.<Image forceAspectRatio={false}>that fails to load collapses to 0px, hiding its alt text and the error icon. Not fixed here: the fix is in a shared atom with 13 callers and needs a design call, and two of the three affected sites predate this PR.<Image>above themd:hidden/hidden md:blocksplit, so an overlay block mounts one atom instead of two. It is the restructure refactor(image): route hand-rolled <img> elements through the Image atom #150 considered and rejected, for visual risk at every breakpoint.<img>withgetImageURL/getImageSrcSeton the atlas route instead of the atom, since/map's markup is discarded when the widget mounts and the atom adds client code there. A real cost, and a fair point — but criterion 2 and your 2026-10-28 answer both name the atom explicitly. Raise it if you want it revisited.ARTICLE_IMAGE_SIZESfromRichText.tsxwith the atlas image. The strings coincide; the columns do not. RichText's ismax-w-4xl(896px) with centred uploads atsm:w-1/2; the atlas column ismax-w-3xl. Sharing it would couple two independent caps.mt-6wrapper and let the margin ride on the<img>. The container is a BFC, so the margin would sit inside the clipping box. It renders the same today only because that box has no background.width/heightto avoid CLS.AtlasSeoImage(server/atlas-types.ts:72-75) carries onlyurlandalt, so there are no dimensions to pass.Detail
The desktop branch's three utilities are gone (
f852103).<Image>emitsobject-cover absolute inset-0 w-full h-fullitself wheneveraspectRatiois boxed, so the call site restated all three and the renderedclasscarried them twice.imageBlendClasswas the only part doing work, and it is''for every variant buthighContrast. The atlas call site keeps itsw-full, which is not redundant:forceAspectRatio={false}means the atom emits no width there.Both "until #148" comments are gone, which is criterion 7. #148 merged in
f1f8aa7, andImage.tsx:204now startsisLoadingatfalse, so the atom's first render carriesopacity-100. The retainedAtlasContent.test.tsxassertion that the lead image is free ofopacity-0is what holds that, and the preview confirms it on real markup.rounded="none"on the mobile branch matches today's square corners; the atom defaults torounded="square"(rounded-xs). The desktop branch keeps the default, where it is invisible anyway — its container sits inside anoverflow-hiddenparent.max-w-fullwas dropped from the atlas image. It is inert besidew-full, and Tailwind's preflight already setsimg { max-width: 100% }. It was carried over from the raw<img>, and no otherImagecall site in the repo has it.Why
forceAspectRatio={false}and not a boxedaspect-video. Since #141 a variant is a width-onlywidth=<n>segment, so the ratio crops nothing and only picks which width tiers the srcSet offers. Natural flow renders the photo at its own ratio, exactly as today.The preview links are branch aliases, not the per-commit one. CI's
scripts/get-cloudflare-preview-url.mjsselected252de255-wemeditate-web…for the smoke gate, which is correct there — it must pin one SHA — but a per-commit alias in a PR body goes stale on the next push. The branch alias was confirmed by fetching the class page from it and matching this branch's ownsizesstring, so it is not a guess from the branch name.Only one atlas route in the content set has a lead image. Of four class pages sampled under
/map/gb, three render zero<img>. That is why the Preview section links the Belfast one specifically.Closes #150
🤖 Written by the sydevs autonomous loop — see what this is
🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjW2ei3KxPxbsi25Xd8