Skip to content

Add FXIOS-12510 [HNT - Search Bar] tapping on search bar experience #27505

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
merged 7 commits into from
Jun 25, 2025

Conversation

cyndichin
Copy link
Contributor

@cyndichin cyndichin commented Jun 23, 2025

📜 Tickets

Jira ticket
Github issue

Jira ticket
Github issue

💡 Description

Add tapping on homepage search bar shows a scrim layer for zero search state. Deleting any text or going back to the zero state, should show the scrim. This scrim only appears when tapping on the search bar and not any other zero search state experience (this is TBD).

Also refactor how we configure showing the search bar by adding the check in the homepage middleware.

Note: Please use the debug option to verify that this experience works as expected. You may need to relaunch to switch between experiences. UI tests and a11y will come after requirements are more defined.

🎥 Demos

Simulator.Screen.Recording.-.iPhone.16.-.2025-06-23.at.10.01.52.mp4

📝 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)

Copy link
Contributor

mergify bot commented Jun 23, 2025

This pull request has conflicts when rebasing. Could you fix it @cyndichin? 🙏

@cyndichin cyndichin force-pushed the cc/FXIOS-12510_search-bar-tapping branch 2 times, most recently from 3b98044 to 1d11ac1 Compare June 23, 2025 15:46
@mobiletest-ci-bot
Copy link

mobiletest-ci-bot commented Jun 23, 2025

Messages
📖 Project coverage: 36.57%
📖 Edited 15 files
📖 Created 2 files

Client.app: Coverage: 35.35

File Coverage
HomepageState.swift 96.82%
BrowserViewController.swift 24.44% ⚠️
FeatureFlagsDebugViewController.swift 0.0% ⚠️
HomepageDiffableDataSource.swift 83.21%
BrowserViewControllerState.swift 51.98%
SearchBarState.swift 95.74%
NavigationBrowserAction.swift 100.0%
NimbusFlaggableFeature.swift 99.42%
HomepageViewController.swift 46.63% ⚠️
BrowserNavigationType.swift 100.0%
HomepageAction.swift 100.0%
HomepageMiddleware.swift 51.14%

Generated by 🚫 Danger Swift against 911cf80

@cyndichin
Copy link
Contributor Author

@yoanarios seems like I get the unit test message even though I do have tests. Looks like it gets triggered for new files, it makes sense if we can remove that line of code and keep the ones with 0 test coverage?

Copy link
Contributor

mergify bot commented Jun 23, 2025

This pull request has conflicts when rebasing. Could you fix it @cyndichin? 🙏

zeroSearchDimmingView.trailingAnchor.constraint(equalTo: contentContainer.trailingAnchor)
])

UIView.animate(withDuration: 0.3) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kept constant here instead of UX struct since it's easier to make changes here when doing design review. Happy to move it to struct in future if that's preferred.

@@ -1111,7 +1118,22 @@ class BrowserViewController: UIViewController,
)
}

/// If we are showing the homepage search bar, then we should hide the address toolbar
private func shouldHideToolbar() -> Bool {
Copy link
Contributor Author

@cyndichin cyndichin Jun 23, 2025

Choose a reason for hiding this comment

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

@thatswinnie I didn't see a state for showing / hiding the toolbar, so I added this method and checks directly here in BVC. Let me know if there's a better place otherwise! We can do this in a follow up PR since I'll need to do a follow up PR to show the toolbar when we aren't in homepage.

@cyndichin cyndichin marked this pull request as ready for review June 23, 2025 16:21
@cyndichin cyndichin requested a review from a team as a code owner June 23, 2025 16:21
@cyndichin cyndichin marked this pull request as draft June 23, 2025 17:02
@cyndichin
Copy link
Contributor Author

Tried to keep this smaller, but it's a bit hard to test the UI end to end without the refactoring on the state and addition to middleware.

@cyndichin cyndichin marked this pull request as ready for review June 23, 2025 17:57
@yoanarios
Copy link
Contributor

@yoanarios seems like I get the unit test message even though I do have tests. Looks like it gets triggered for new files, it makes sense if we can remove that line of code and keep the ones with 0 test coverage?

I've opened a PR to remove the check if the file is not found, which was added for the edge case where the file was not added in XCTResults with no lines of code which shouldn't happened in the project

@cyndichin
Copy link
Contributor Author

@yoanarios seems like I get the unit test message even though I do have tests. Looks like it gets triggered for new files, it makes sense if we can remove that line of code and keep the ones with 0 test coverage?

I've opened a PR to remove the check if the file is not found, which was added for the edge case where the file was not added in XCTResults with no lines of code which shouldn't happened in the project

thank you so much! 🔥

@cyndichin
Copy link
Contributor Author

@mergify backport release/v141

Copy link
Contributor

mergify bot commented Jun 24, 2025

backport release/v141

✅ Backports have been created

Copy link
Collaborator

@Foxbolts Foxbolts left a comment

Choose a reason for hiding this comment

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

Looks great @cyndichin, very nice!

Just one issue/question

private func switchToolbarIfNeeded() {
guard !shouldHideToolbar() else {
addressToolbarContainer.isHidden = true
Copy link
Collaborator

@Foxbolts Foxbolts Jun 24, 2025

Choose a reason for hiding this comment

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

I am not seeing where we unhide the address toolbar on orientation change (to landscape), I'm only seeing that we unhide it when showing the zero search view

Copy link
Contributor Author

@cyndichin cyndichin Jun 25, 2025

Choose a reason for hiding this comment

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

thanks for reviewing!! This may change since I have a separate ticket for showing / hiding the address toolbar - https://mozilla-hub.atlassian.net/browse/FXIOS-12632

Any issue with keeping this ticket specific to tapping on search middle bar shows the new zero state and then can address this in the other ticket avoid this PR from getting to large?

I'm planning on pairing with Winnie to see if we can modify the toolbar state instead - #27505 (comment)

Copy link
Collaborator

Choose a reason for hiding this comment

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

works for me 👍

@cyndichin
Copy link
Contributor Author

@mergify rebase

Copy link
Contributor

mergify bot commented Jun 25, 2025

rebase

❌ Base branch update has failed

Git reported the following error:

Rebasing (1/6)
Auto-merging firefox-ios/Client.xcodeproj/project.pbxproj
Auto-merging firefox-ios/Client/Frontend/Home/Homepage Rebuild/HomepageViewController.swift
Auto-merging firefox-ios/nimbus-features/homepageRedesignFeature.yaml
CONFLICT (content): Merge conflict in firefox-ios/nimbus-features/homepageRedesignFeature.yaml
error: could not apply fad606037... Add FXIOS-12510 [HNT - Search Bar] tapping on homepage search bar experience
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply fad606037... Add FXIOS-12510 [HNT - Search Bar] tapping on homepage search bar experience

@cyndichin cyndichin force-pushed the cc/FXIOS-12510_search-bar-tapping branch from 087d23e to 354d45f Compare June 25, 2025 14:17
@cyndichin
Copy link
Contributor Author

Unable to rebase via mergify due to conflict with main in feature flag config with stories redesign. Rebase locally.

@cyndichin cyndichin merged commit 7d83bd8 into main Jun 25, 2025
11 checks passed
@cyndichin cyndichin deleted the cc/FXIOS-12510_search-bar-tapping branch June 25, 2025 14:52
mergify bot pushed a commit that referenced this pull request Jun 25, 2025
…27505)

(cherry picked from commit 7d83bd8)

# Conflicts:
#	firefox-ios/Client/Frontend/Home/Homepage Rebuild/Redux/HomepageState.swift
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.

4 participants