Skip to content

fix(articles): bound the height of article images - #132

Merged
aquie00t merged 1 commit into
mainfrom
fix/article-image-bounds
Aug 26, 2026
Merged

fix(articles): bound the height of article images#132
aquie00t merged 1 commit into
mainfrom
fix/article-image-bounds

Conversation

@aquie00t

Copy link
Copy Markdown
Contributor

An article with a picture in it opened to a wall of picture. Two separate causes, both mine.

The cover

It lost its height bound in #129, when it stopped being cropped to 16:9 so it could render at its own ratio. That reads fine for a landscape cover and badly for a portrait one: 720px of column width becomes over a thousand pixels of height, and the reader arrives at an image with the title somewhere below the fold.

Full width again, but capped — and cropped, so it stays a banner rather than becoming the page.

Body images

These only ever had max-w-full, which does nothing for a tall image. One portrait screenshot filled the screen and pushed the paragraph it was illustrating out of sight.

Bounded on both axes now, and deliberately not cropped: scaling a diagram down whole keeps what it was drawn to show, where covering it to a box would cut part of it away. That is the one place where the cover and the body should behave differently.

Reviewing

The tests assert Tailwind classes, which is usually a weak thing to do — here it is the right thing, because the missing class was the defect. Each is written to say what breaks without it rather than restating the class name.

The editor's cover preview had the same gap; that fix went to #131, since the editor does not exist on main yet. The two are matched deliberately — a preview that is taller than the published article leaves the writer guessing.

Verification

pnpm build, tsc -b, pnpm lint clean. 414 unit tests across 59 files pass.

Worth saying plainly: this was a regression I introduced, and the reason it survived review is that the reading view was only ever exercised against articles with no cover. The new tests close that specific gap.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Hu1QuLxS84vdf1gmzoGtWP

An article with a picture opened to a wall of it.

The cover lost its height bound in #129, when it stopped being cropped to
16:9 so it would render at its own ratio. That reads fine for a landscape
cover and badly for a portrait one: 720px of column width becomes over a
thousand pixels of height, and the reader arrives at an image with the
title somewhere below the fold. It is full width again but capped, and
cropped to stay a banner rather than a page.

Body images only ever had `max-w-full`, which does nothing for a tall one.
A single portrait screenshot filled the screen and pushed the paragraph it
illustrated out of sight. They are bounded on both axes now, and
deliberately not cropped — scaling a diagram down whole keeps what it was
drawn to show, where covering it to a box would cut part of it away.

The tests assert the classes, which is unusual and right here: the missing
class was the whole defect.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu1QuLxS84vdf1gmzoGtWP
@cloudflare-workers-and-pages

Copy link
Copy Markdown
Contributor

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
tdn-client bb98d0a Commit Preview URL

Branch Preview URL
Aug 26 2026, 01:17 AM

@aquie00t
aquie00t merged commit 969de30 into main Aug 26, 2026
8 checks passed
@aquie00t
aquie00t deleted the fix/article-image-bounds branch August 26, 2026 02:08
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