Fix vertical/portrait media getting cropped in single-attachment posts#715
Open
rufus-gh wants to merge 1 commit into
Open
Fix vertical/portrait media getting cropped in single-attachment posts#715rufus-gh wants to merge 1 commit into
rufus-gh wants to merge 1 commit into
Conversation
A devlog/post with one attachment forced its media slide to a fixed 16:9 box with object-fit: contain and overflow: hidden. For portrait or vertical videos this showed only the top slice of the asset and clipped the native video controls out of reach. Single-attachment slides now follow the media's own aspect ratio, capped at min(70vh, 560px), with overflow visible so controls stay reachable. Multi-attachment grids are unchanged. Fixes hackclub#627 Fixes hackclub#635 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
|
@rufus-gh & @claude this doesn't follow our https://github.com/hackclub/stardance/blob/main/AI_POLICY.md- please include a screenshot of this working to prove that you tested it |
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.
What & why
Closes #627 and #635.
A devlog/post with a single attachment rendered its media into a fixed 16:9 slide (
aspect-ratio: 16 / 9; max-height: 420px) withobject-fit: containandoverflow: hiddenon the slide. For portrait images and vertical videos this:This matches @maxwofford's diagnosis on #627 that
feed-post-card__videohad an overflow cutoff it shouldn't have.The fix
For the single-attachment case only (
[data-count="1"]), let the media keep its own aspect ratio, height-capped atmin(70vh, 560px), and setoverflow: visibleon the slide so video controls stay reachable. Multi-attachment grids are untouched (they still fill their square/16:9 slots).Only
app/assets/stylesheets/components/_feed.scsschanges. The single render path isapp/views/shared/_post_media.html.erb, used by both the feed and devlog detail pages, so the fix covers both surfaces.Verification
Reproduced the crop and validated the fix in an isolated harness using the exact compiled rules, against a 9:16 portrait, a 16:9 landscape, and a 2-up grid:
Open questions
min(70vh, 560px)is a judgement call for the height cap; happy to tune to whatever the team prefers.