Skip to content

Add FXIOS-12363 ⁃ [Menu Redesign] Update horizontal squares options to the latest design #27115

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

Merged

Conversation

dicarobinho
Copy link
Collaborator

πŸ“œ Tickets

Jira ticket
Github issue

πŸ’‘ Description

Updated horizontal cells based on the latest design

πŸŽ₯ Demos

IMG_5258

Before After
Demo

πŸ“ Checklist

  • I filled in the ticket numbers and a description of my work
  • I updated the PR name to follow our PR naming guidelines
  • I ensured unit tests pass and wrote tests for new code
  • If working on UI, I checked and implemented accessibility (Dynamic Text and VoiceOver)
  • If adding telemetry, I read the data stewardship requirements and will request a data review
  • If needed, I updated documentation and added comments to complex code
  • If needed, I added a backport comment (example @Mergifyio backport release/v120)

@dicarobinho dicarobinho requested a review from yoanarios June 5, 2025 16:48
@dicarobinho dicarobinho marked this pull request as ready for review June 5, 2025 16:49
@dicarobinho dicarobinho requested a review from a team as a code owner June 5, 2025 16:49
@mobiletest-ci-bot
Copy link

mobiletest-ci-bot commented Jun 5, 2025

Messages
πŸ“– Project coverage: 37.02%
πŸ“– Edited 6 files
πŸ“– Created 3 files

Client.app: Coverage: 35.41

File Coverage
MainMenuConfigurationUtility.swift 18.51% ⚠️

Generated by 🚫 Danger Swift against 9c5dcd5

Copy link
Contributor

@yoanarios yoanarios left a comment

Choose a reason for hiding this comment

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

Some comments and suggestions in first pass

Comment on lines 115 to 120
if tabInfo.isHomepage {
menuSections.append(getNewTabSection(with: uuid, tabInfo: tabInfo))
menuSections.append(getHorizontalTabsSection(with: uuid, tabInfo: tabInfo))
} else {
menuSections.append(getSiteSection(with: uuid, tabInfo: tabInfo, isExpanded: isExpanded))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We could merge else with inner if like: else if tabInfo.isHomepage { for readability

cell.configureCellWith(model: section.options[indexPath.row])
if let theme { cell.applyTheme(theme: theme) }
return cell
}

func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
collectionView.deselectItem(at: indexPath, animated: false)
guard let section = menuData.first(where: { $0.isTopTabsSection }),
guard let section = menuData.first(where: { $0.isHorizontalTabsSection }),
Copy link
Contributor

Choose a reason for hiding this comment

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

this check is done multiple times can be a computed var to avoid repeating the same code like

var horizontalTabsSection: MenuSection? {
    return menuData.first(where: { $0.isHorizontalTabsSection })
}

@@ -77,11 +84,29 @@ final class MenuRedesignTableView: UIView,
return section == 0 ? UX.topPadding : UX.distanceBetweenSections
}

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if menuData[indexPath.section].isHorizontalTabsSection {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should avoid calculating the height manually, I understand it is a cell containing a collection view but let's explore other solutions.
As last resort if we don't find a solution I think this logic should be in MenuCollectionView or MenuSquareCell instead of here

Copy link
Contributor

@yoanarios yoanarios left a comment

Choose a reason for hiding this comment

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

nit about a comment that can be fixed in next PR. Great work refactoring

@@ -159,11 +174,11 @@ final class MenuRedesignTableView: UIView,
}

func reloadTableView(with data: [MenuSection]) {
// We ignore first section because it is handled in MenuCollectionView
if let firstSection = data.first, firstSection.isTopTabsSection {
// We ignore first section because it is handled in MenuSquaresViewContentCell
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think the comment should be updated. We don't ignore the section just handled independently

}

func reloadData(with data: [MenuSection]) {
menuData = data
Copy link
Contributor

Choose a reason for hiding this comment

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

IMHO this is simpler to read, understand and maintain. Great work

@dicarobinho dicarobinho merged commit 30adaac into main Jun 11, 2025
11 checks passed
@dicarobinho dicarobinho deleted the afarcasanu/fxios_12363_26946_update_horinzotal_cells branch June 11, 2025 14:18
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.

3 participants