Skip to content

refactor(docs): remove POSTER_SIZES, which does nothing while images are unoptimized - #241

Merged
hunterbecton merged 1 commit into
mainfrom
hunter/sha-221-remove-poster_sizes-which-does-nothing-while-images-are
Oct 9, 2026
Merged

hunterbecton merged 1 commit into
mainfrom
hunter/sha-221-remove-poster_sizes-which-does-nothing-while-images-are

Conversation

@hunterbecton

Copy link
Copy Markdown
Member

Why

POSTER_SIZES said it made next/image pick a card poster no larger than the card needs. The docs site exports with images: { unoptimized: true }, so next/image renders each card poster as a plain <img> with no srcset, and it drops sizes. The prop never changed which file a visitor downloads. SHA-221.

What changes

The card poster

The card poster's Image no longer takes sizes, and POSTER_SIZES is gone. The homepage's HTML is the same as before. Next warns about a fill image with no sizes only when the image is optimized, so the dev console stays quiet on /. DemoPoster.tsx and home-hero.tsx keep their sizes="100vw". It does nothing either, but no comment there claims it does, and the ticket leaves them alone.

The React Doctor suppression

React Doctor's nextjs-image-missing-sizes rule reads the JSX but not next.config.ts, so it flags the bare fill. The Image carries an inline suppression, and the comment above it says what to add if optimization comes on. The rule stays on for the rest of the repo, where it will catch a missing sizes once optimization is on.

The homepage spec

"each favorite shows its poster" drops the comment that next/image may serve a resized file, which is never true under unoptimized. The shape check stays.

…are unoptimized

The docs site exports with `images: { unoptimized: true }`, so next/image
renders each card poster as a plain <img> with no srcset, and it drops
`sizes`. POSTER_SIZES never picked a smaller file. Remove it, and remove
the homepage spec comment that said next/image may serve a resized file.

React Doctor's nextjs-image-missing-sizes rule assumes optimization is on,
so the card's Image carries an inline suppression that gives the reason.
Copilot AI balanced review requested due to automatic review settings October 9, 2026 19:58
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit da478c0.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused refactor matches the unoptimized Next.js configuration without changing tested behavior.

0 open findings

What changed in this PR

Removes ineffective sizes handling for unoptimized favorite posters and updates related test commentary.

Changes:

  • Removes POSTER_SIZES and the unused sizes prop.
  • Adds a targeted React Doctor suppression with rationale.
  • Corrects outdated test commentary.
File Description
apps/​docs/​src/​components/​favorites/​favorites-list.tsx Removes ineffective poster sizing metadata.
apps/​docs-tests/​docs/​homepage.spec.ts Removes an inaccurate image-resizing comment.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@hunterbecton
hunterbecton merged commit 5da3e8d into main Oct 9, 2026
12 checks passed
@hunterbecton
hunterbecton deleted the hunter/sha-221-remove-poster_sizes-which-does-nothing-while-images-are branch October 9, 2026 21:10
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.

2 participants