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 layout logic to support rendering skeleton pins #3877

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rebeccayeyi
Copy link
Contributor

@rebeccayeyi rebeccayeyi commented Nov 15, 2024

Summary

What changed?

  • Added a utility function to retrieve an item's height from the skeleton pin, using it instead of the measurement cache when applicable.

Why?

  • This change is necessary to render skeleton pins as part of Masonry's items rather than _loadingStateItems.
    • This should help with overall performance since we are now having the real pins just replace the skeleton pins where currently, we render either the skeleton pins or the real pins
    • This also unlocks infinite scrolling

Test Plan

Note

  • If this change is okay, will also apply the same changes to Masonry v2!

Checklist

  • Added unit tests
  • Added documentation + accessibility tests
  • Verified accessibility: keyboard & screen reader interaction
  • Checked dark mode, responsiveness, and right-to-left support
  • Checked stakeholder feedback (e.g. Gestalt designers, relevant feature teams)

@rebeccayeyi rebeccayeyi requested a review from a team as a code owner November 15, 2024 20:14
@rebeccayeyi rebeccayeyi marked this pull request as draft November 15, 2024 20:14
@rebeccayeyi rebeccayeyi changed the title Masonry: update layout logic to support skeleton pin Masonry: update layout logic to support rendering skeleton pins Nov 15, 2024
Copy link

netlify bot commented Nov 15, 2024

Deploy Preview for gestalt ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit c28eb56
🔍 Latest deploy log https://app.netlify.com/sites/gestalt/deploys/673cad4734f8d300083dc17e
😎 Deploy Preview https://deploy-preview-3877--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.

const height = isLoadingStateItem(item, renderLoadingState)
? item.height
: measurementCache.get(item);
const height =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thoughts on making sure that the pin is a skeleton pin? we could just check to see if height is available, but i wasnt sure if we wanted to expose that API

@rebeccayeyi rebeccayeyi marked this pull request as ready for review November 20, 2024 14:49
@rebeccayeyi rebeccayeyi marked this pull request as draft November 21, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant