Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Masonry: Update fluid grid to not floor column width (take two) #3913

Merged

Conversation

liuyenwei
Copy link
Contributor

Summary

This PR re-lands the change originally introduced in #3874 (which updates fullWidthLayout column widths to not be floored) and addresses the bug that caused it to be reverted.

Why was this reverted previously

This previous change was reverted after it was reported that pins were "stacking" . After doing some debugging, I was able to trace the issue down to the initializeHeightsArray function, which is called during multi-column layout. Currently, it has some logic to determine column based on a combination of position.left + columnWidthAndGutter - when column widths are floating point numbers, this ends up breaking since the calculated column is no longer an integer.

This PR fixes the above issue by ensuring that the above calculation is rounded to the nearest integer.

Test Plan

Patched this locally and testing in pinboard

Before

image

After

image

@liuyenwei liuyenwei requested a review from a team as a code owner December 16, 2024 18:42
Copy link

netlify bot commented Dec 16, 2024

Deploy Preview for gestalt ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 3d551c1
🔍 Latest deploy log https://app.netlify.com/sites/gestalt/deploys/67608478aa3f950008d5dfa1
😎 Deploy Preview https://deploy-preview-3913--gestalt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@liuyenwei liuyenwei added the patch release Patch release label Dec 16, 2024
@liuyenwei liuyenwei merged commit e3f9625 into pinterest:master Dec 17, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch release Patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants