fix(studio): gallery thumbnails show true aspect ratio (#706) - #712
Open
mcarlson wants to merge 1 commit into
Open
fix(studio): gallery thumbnails show true aspect ratio (#706)#712mcarlson wants to merge 1 commit into
mcarlson wants to merge 1 commit into
Conversation
Still-image gallery cards hard-coded aspect-ratio 16/9 with object-fit:cover, cropping every thumbnail into the same box. Now the image drives the card height (width:100%, height:auto) so portrait/square/landscape render true. - ImageThumbnail: object-fit:cover/height:100% -> display:block, height:auto - ImageCard: drop fixed 16/9; add $ratio applied only to image-less placeholders (queue/failed) so they don't collapse - ImageGrid: align-items:start so short cards aren't stretched - add pure aspectRatioFromSize() helper (from generated image size), TDD'd Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying frontend-alpha with
|
| Latest commit: |
f1faa76
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1fbb50fe.frontend-btm.pages.dev |
| Branch Preview URL: | https://feat-706-gallery-aspect-rati.frontend-btm.pages.dev |
Deploying frontend-stage with
|
| Latest commit: |
f1faa76
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://931542fe.frontend-d7v.pages.dev |
| Branch Preview URL: | https://feat-706-gallery-aspect-rati.frontend-d7v.pages.dev |
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.
Closes #706
Problem
In the studio still-image gallery, every thumbnail rendered as the same fixed box —
ImageCardhard-codedaspect-ratio: 16 / 9andImageThumbnailusedobject-fit: cover. Portrait and square images were force-cropped (tops/bottoms cut off).Fix
The image now drives the card's height, so each thumbnail shows its true aspect ratio:
ImageThumbnail:height: 100%; object-fit: cover→display: block; width: 100%; height: auto;ImageCard: drop the fixedaspect-ratio: 16 / 9; add a$ratioprop applied only to image-less placeholders (queue / failed) so they don't collapseImageGrid:align-items: startso a short card isn't stretched to its row's tallest neighbouraspectRatioFromSize()(derives the placeholder box from a generated image'ssize), TDD'd insize-options.test.tsNo cropping anywhere; works uniformly for generated, uploaded, and playlist images. The lightbox (already
object-fit: contain) is unaffected.Verification
height: autogenuinely shows the real shape.pnpm type-check,eslint, andsize-optionsunit tests pass.Demo
Before → after (portrait lighthouse + square mandala cropped into 16:9 boxes, then shown full at true aspect):
https://drive.google.com/file/d/1HozD-aHnc10_rGsmCSRL23_vkYjT0--7/view?usp=sharing
#712