Repository navigation
Fix research figure aspect ratio distortion - #157
Merged
Merged
Conversation
Preserve author-set width (including percentages) in apply_dimensions, scale height only for numeric width-only cases, and set height: auto on research-v2 content figures so HTML height attrs cannot stretch images.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Contributor
Member
Author
|
@coderabbitai review |
Contributor
|
This was referenced Oct 29, 2026
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.
Description
On
/research/, non-badge figures were vertically stretched: column width was capped (max-width: 100%) while HTMLheightstayed at the file’s natural pixel height.Root cause:
_plugins/responsive_images.rbapply_dimensionstreated “width present without height” as “missing both”, overwriting authorwidth="75%"with natural pixel width and injecting natural height..research-content img:not([src*="img.shields.io"])inresearch-v2.csslackedheight: auto, so the height attribute won.Type of Change
Changes Made
height: autoto research-v2 content figure rule (CSS safety net).apply_dimensionsso it never overwrites an author-set width:75%) → leave width alone, do not invent heighttests/responsive-images.test.rband wire it into the Jekyll workflow.object-fit: coverboxes or existingheight: auto; no extra CSS needed beyond research-v2.Testing Done
bundle exec jekyll serve(built_site+python3 -m http.server)./scripts/lint-check.sh✅npm test✅ (215 tests)npm run lint✅./scripts/build.sh✅bundle exec ruby tests/responsive-images.test.rb✅Screenshots
Before (live production)
After (local build with fix)
Related Issues
Fixes stretched research figures reported against live https://comphy-lab.org/research/ (follow-up to #147 mobile first-paint dims).
Checklist
Additional Notes
Journal covers with inline
max-width: 256pxpreviously rendered ~256×1560; withheight: autothey render at correct aspect (~256×335). Authorwidth="75%"figures keep the percentage attribute and no conflicting height.Summary by CodeRabbit