Hide tiny images instead of scaling them up as hero/card artwork (#115) - #116
Draft
shellen wants to merge 1 commit into
Draft
Hide tiny images instead of scaling them up as hero/card artwork (#115)#116shellen wants to merge 1 commit into
shellen wants to merge 1 commit into
Conversation
Small images — favicons, site logos, avatars — were being scaled up as the article hero and as Rundown/dash card images whenever they were the best candidate found. Fixes #115: - New isTinyImage() helper; the hero and all card images check natural dimensions on load (<200px wide or <100px tall) and fall back to their existing no-image treatment instead of scaling up - listFiles' body-image fallback skips favicon/apple-touch-icon URLs at pick time so they never become card artwork Covered by a Playwright spec (canvas-generated 32x32 hidden, 400x250 kept) and jest tests for the pick-time filter. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AdXEsWQTadb9qbTQjLkMqn
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.
Fixes #115.
Two layers:
isTinyImage()(naturalWidth < 200 || naturalHeight < 100, covering favicons up to apple-touch-icon 180×180). The article hero, Rundown deck cards, dash cards, and section-featured images check itonloadand fall back to their existing no-image treatment (hidden hero, initials/color block) instead of blowing the image up.listFiles' first-body-image fallback skipsfavicon*/apple-touch-icon//favicons/URLs so they never become card artwork in the first place.Tests: new Playwright case (32×32 canvas image → hero hidden; 400×250 → hero stays) plus jest coverage for the pick-time skip. One existing source-shape test updated for the shared-fallback refactor it inspects. 178 jest + 3 e2e pass, typecheck clean.
Draft — hold for the next release (0.5.2) per rollout schedule; do not merge this week.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AdXEsWQTadb9qbTQjLkMqn