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

Bugfix FXIOS-11307 [Homepage] [TopSites] top site layout on rotation #24634

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

Conversation

cyndichin
Copy link
Contributor

📜 Tickets

Jira ticket
Github issue

💡 Description

Fix how we determine the number of tiles for top sites. This issue only exists with the Toolbar Redesign disabled. This is because we are dispatching more actions with the Toolbar Redesign so it causes the numberOfTilesPerRow to re-calculate more often. The issue without the toolbar redesign is that we call the calculation less often and the last call was calculated with the wrong size.

This change guarantees that we are calculating the proper number of tiles before the view changes and adding another dispatch causes the datasource to be updated.

📝 Checklist

You have to check all boxes before merging

  • Filled in the above information (tickets numbers and description of your work)
  • Updated the PR name to follow our PR naming guidelines
  • Wrote unit tests and/or ensured the tests suite is passing
  • When working on UI, I checked and implemented accessibility (minimum Dynamic Text and VoiceOver)
  • If needed, I updated documentation / comments for complex code and public methods
  • If needed, added a backport comment (example @Mergifyio backport release/v120)

Screenshots

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-02-07.at.10.25.30.mp4

@cyndichin cyndichin requested a review from Cramsden February 7, 2025 15:27
Comment on lines +606 to +612
currentNumberOfTilesPerRow = numberOfTilesPerRow(for: width)
store.dispatch(
HomepageAction(
windowUUID: windowUUID,
actionType: HomepageActionType.viewWillTransitionCalled
)
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It feels odd to me to not have the number of tiles as payload associated with the dispatch action. But I kept the changes simple instead of passing the int around. Let me know what you think!

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