fix(embeds): GIF previews keep their own size and shape (#341) #344
Merged
jared
merged 2 commits from 2026-10-11 00:53:26 -04:00
fix/gif-card-aspect into lotus
No Reviewers
Labels
Clear labels
a11y
area: appearance
area: auth-session
area: build-ci
area: calls
area: desktop
area: media
area: messaging
area: mobile
area: moderation
area: navigation
area: notifications
area: settings
area: threads
bug
dependencies
docs
duplicate
enhancement
help wanted
invalid
needs-human-review
performance
planning
priority: critical
priority: high
priority: low
priority: medium
qa
question
research
security
tech-debt
ux
wontfix
Accessibility: keyboard, screen reader, contrast, motion
Client area: appearance
Client area: auth-session
Client area: build-ci
Client area: calls
Client area: desktop
Client area: media
Client area: messaging
Client area: mobile
Client area: moderation
Client area: navigation
Client area: notifications
Client area: settings
Client area: threads
Something is not working
Third-party package versions and advisories
README / LOTUS_* docs wrong or missing
This issue or pull request already exists
New feature
Need some help
Something is wrong
Re-render storms, leaks, heavy work on hot paths
Data loss, security hole, or crash on a main path
Broken feature or serious usability problem
Minor issue or polish
Wrong behaviour in an edge case or notable degradation
Manual QA: shipped, needs a human in a real environment
More information is needed
XSS, unsafe URLs, data leaks, auth/session
Code health, dead code, fragile patterns
Usability or visual inconsistency
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: LotusGuild/cinny#344
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #341
Giphy and Tenor link previews forced every GIF into one box: full card width, max 200 px tall,
object-fit: cover. Square GIFs lost half their height, portrait ones three quarters, and small ones were blown up 4×.Change
utils/gifPreviewSize.ts(+ 6 unit tests): fit the GIF inside 400×320 fromog:image:width/height, keeping its aspect ratio and enlarging small GIFs at most 2×.GifCard: centres the GIF on the surface colour withobject-fit: containand reserves the box before load. The "GIF" badge sits on the GIF's own corner.Before → after (headless Chromium, fixture previews shaped like Synapse's Giphy response)
Checks:
tscclean · unit tests 1325 pass / 2 skipped · ESLint 0 errors (36 warnings, unchanged) · Prettier clean.Before (lotus): tall 240×480 GIF
After: wide, square, tall and small test GIFs, each shown whole
🤖 Generated with Claude Code
https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
CI note: the only failing step is
npm audit --audit-level=high(new source-map-js advisory, unrelated to this change; tracked in #345). Build, ESLint, unit tests and boot-check passed in run 2417.Merged
deps/npm-audit-fixes(#346) into this branch so the CI audit step passes here too. Once #346 is merged into lotus, that commit drops out of this diff. Merge order: #346, then this one.