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

fix(ui): gallery grid calculation #6889

Merged
merged 1 commit into from
Sep 19, 2024
Merged

Conversation

psychedelicious
Copy link
Collaborator

Summary

There was an issue w/ the calculation causing an infinite loop but the fixed algorithm from #6887 wasn't correct bc it doesn't take into account the grid gap correctly. This then breaks arrow key navigation.

  • Restore the previous calculation
  • Bail out if the gallery elements don't have any width, which causes the infinite loop - this part was missed when copying the logic from GalleryImageGrid

Related Issues / Discussions

n/a

QA Instructions

shouldn't freeze

Merge Plan

n/a

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)

There was an issue w/ the calculation causing an infinite loop but the fixed algorithm wasn't correct bc it doesn't take into account the grid gap correctly. This then breaks arrow key navigation.

- Restore the previous calculation
- Bail out if the gallery elements don't have any width, which causes the infinite loop - this part was missed when copying the logic from GalleryImageGrid
@github-actions github-actions bot added the frontend PRs that change frontend files label Sep 19, 2024
@blessedcoolant
Copy link
Collaborator

LGTM

@blessedcoolant blessedcoolant merged commit 8e0ee69 into main Sep 19, 2024
14 checks passed
@blessedcoolant blessedcoolant deleted the psyche/fix/ui/gallery-calc branch September 19, 2024 20:23
@blessedcoolant
Copy link
Collaborator

This then breaks arrow key navigation.

On second check, what is breaking here exactly? I am not able to see any functional difference between the two. Unless I'm missing something?

Also ... the while loop performance is very bad compared to when not using it. And I am not exactly sure what is breaking with the older code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend PRs that change frontend files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants