Hive
fix(web): prevent Open Graph card preview trimming
GitHub issue · Closed
What changed
This updates generated Open Graph cards so link previews keep the full card content visible:
- Changes the generated card size from 1920 by 1080 to 1920 by 1008.
- Tightens vertical spacing across the brand, title, description, author, and footer areas.
- Bumps the card renderer version so previously stored cards regenerate with the new layout.
- Updates Open Graph tests for the new image height and renderer version.
Why
Spec cards can be rendered correctly at the source size but still appear trimmed when a preview surface crops large images to a wider card ratio. The spec screenshot showed footer content sitting close enough to the bottom edge that preview cropping could remove part of the card.
Root cause
The card renderer used a 16:9 image frame while some consumers display large preview images closer to a 1.91:1 ratio. The footer metadata was valid inside the generated image, but it did not have enough vertical safety margin for those preview crops.
Approach
The generated card keeps the same width and uses a shorter 1008 pixel height that matches the wider preview ratio more closely. The internal spacing was reduced proportionally so long spec titles still have room while the footer remains comfortably inside the frame.
Impact
New Open Graph cards advertise and render at 1920 by 1008. Existing stored card images get new object keys through the renderer version bump, so they regenerate the next time they are requested.
Validation
mise exec -- mix format lib/hive_web/open_graph.ex test/hive_web/open_graph_test.exsmise exec -- mix test test/hive_web/open_graph_test.exs test/hive_web/controllers/open_graph_controller_test.exsmise exec -- mix compile --warnings-as-errors- Rendered the affected spec card locally and confirmed the generated image is 1920 by 1008 with the footer visible.
No GitHub comments yet.