Stop the listing thumbnails collapsing to a sliver - #234
Merged
Conversation
Tailwind's preflight puts max-width:100% on every img, so the thumbnail's min-content width is zero. Auto table layout takes the space it needs from whichever column will yield, and that is the only one that will: under pressure the column shrinks to a few pixels and h-10 holds the height, leaving a tall 4px sliver of cropped photo where a 48x40 thumbnail should be. It has presumably always been one badge away from happening. Adding the Featured badge is what spent the remaining slack, so rows carrying both badges squeeze the column for the whole table, including rows that carry neither. w-12 is a preference here, not a floor; min-w-[3rem] is the floor. The placeholder for an article with no image never had the problem, since a div's fixed width already is its min-content width. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L4qBhBdQto1yNp1zP7VLYc
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.
The thumbnails in the articles list render as a tall 4px sliver of cropped photo instead of a 48×40 image, as spotted after #233.
Cause
Tailwind's preflight puts
max-width: 100%on everyimg. That makes the thumbnail's min-content width zero, so when auto table layout needs space it takes it from the only column that will yield.h-10keeps the height,object-covercrops the width, and what is left is a sliver.w-12is a preference in that algorithm, not a floor.It has presumably always been one badge away from happening. Adding the Featured badge in #231 spent the remaining slack, so a row carrying both badges squeezes the column for the whole table — including rows carrying neither, which is why every thumbnail is affected and not just the flagged ones.
Confirmed, not guessed
Reproduced in isolation with the same markup and Tailwind's preflight rule. At a width where the author names wrap over three lines — exactly what the reported screenshot shows — the column collapses to nothing:
The same page with
min-w-[3rem]holds the thumbnails at full size under identical pressure.Fix
min-w-[3rem]on the image andmin-w-[4rem]on its column header. Verified that both arbitrary classes actually compile into the bundle (min-w-\[3rem\]{min-width:3rem}) rather than assuming JIT picked them up.The placeholder shown for an article with no image never had the problem: a div's fixed width already is its min-content width. Only the
imgis vulnerable, because only it carriesmax-width: 100%.Testing
tsc --noEmit, eslint, vitest (20 tests) and a productionvite buildall pass. No server change.Not fixed here
With both badges present the title truncates early (
Rico Nasty to hea…) because the cell is capped atmax-w-xsand the badges areshrink-0. That is a legibility judgement rather than a rendering bug, so it is left alone — say the word and it can be widened or the badges moved under the title.🤖 Generated with Claude Code
https://claude.ai/code/session_01L4qBhBdQto1yNp1zP7VLYc