Skip to content

fix(web): fix layout loop with single row grids in explore page #20833

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gabrielsoldani
Copy link

Description

Fixes #20829.

SingleGridRow doesn't actually enforce through grid styles that the grid should be laid out in a single row.

This makes Firefox get stuck in an infinite layout loop in the Explore page:

  1. SingleGridRow, by a very small amount, picks an itemCount N that Firefox lays out in two rows.
  2. The increase in height overflows the parent container.
  3. This causes a vertical scrollbar to be shown, which decreases the width of the grid.
  4. SingleGridRow observes the resize event and recalculates itemCount, now N-1, which Firefox lays out in a single row.
  5. The decrease in height stops overflowing the parent container.
  6. The scrollbar is hidden, which increases the width of the grid.
  7. SingleGridRow observes the resize event. Repeat from step 1.

This patch stops the People and Places grids from being laid out in two rows using grid-flow-col.

SingleGridRow is also used in SearchPeopleSection but I haven't been able to reproduce a similar layout loop there.

How Has This Been Tested?

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

Copy link
Contributor

Label error. Requires exactly 1 of: changelog:.*. Found: . A maintainer will add the required label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[web] /explore flickers in Firefox
1 participant