-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add FXIOS-10913 [Homepage] [Top Sites] full layout configuration for top sites #23918
base: main
Are you sure you want to change the base?
Add FXIOS-10913 [Homepage] [Top Sites] full layout configuration for top sites #23918
Conversation
var numberOfTilesPerRow: Int? { | ||
willSet { | ||
guard newValue != numberOfTilesPerRow else { return } | ||
queue.async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that dispatching actions were already only dispatching on main thread, so not sure why I need to add this, but I was getting a crash and ensuring the call happens on main thread, addresses the issue. Going to look at this again with fresh eyes on Monday, but opened a PR to review to get early eyes + if anyone has a clue.
bdaf5e9
to
23cc16a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I'll let Carson do the final review 👍
23cc16a
to
fe685f6
Compare
fe685f6
to
47c611f
Compare
Client.app: Coverage: 32.53
Generated by 🚫 Danger Swift against 47c611f |
📜 Tickets
Jira ticket
Github issue
💡 Description
Continues with implementing the rest of the logic for the layout configuration for the top sites section. See part I here.
This PR adds the ability to configure the number of rows shown for top sites section specified in the homepage settings.
topSitesData
, but also new fieldsnumberOfRows
andnumberOfTilesPerRow
numberOfRows
is set initially and updates when the user changes the configuration in settings, which is why we dispatch an action to update the state inTopSitesSettingsViewController
numberOfTilesPerRow
is updated when the value changes when being calculated inTopSitesDimensionImplementation
, which is initialized inHomepageSectionLayoutProvider
. Although it's a bit weird to have the layout update based on this and then use the layout configuration to update the data, I decided to go this route and follow what the existing logic is doing but simplifying and adopting Redux. This section may change as we want to revisit the whole logic in the future.numberOfTilesPerRow
andnumberOfRows
, we only get the first X amount of top data sites + update our datasource based on this calculationNote: I notice a discrepancy in the previous PR in that in landscape we are showing 7 tiles instead of 8. Most likely due to my change in using
environment.container.effectiveContentSize
instead ofview.size
like the previous code. Will create a separate ticket to address this.📝 Checklist
You have to check all boxes before merging
@Mergifyio backport release/v120
)Screenshots
iPhone
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-12-20.at.11.28.48.mp4
iPad
ScreenRecording_12-20-2024.12-29-40_1.MP4