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

Add Search Bar on the New Tab Page #3409

Open
wants to merge 57 commits into
base: main
Choose a base branch
from
Open

Add Search Bar on the New Tab Page #3409

wants to merge 57 commits into from

Conversation

ayoy
Copy link
Collaborator

@ayoy ayoy commented Oct 16, 2024

Task/Issue URL: https://app.asana.com/0/72649045549333/1208262951113965/f

Description:
This change introduces alternative New Tab Page UI including a search bar.
The new UI exists alongside the original UI and will be enabled to some users as an experiment.
The NTP search bar reuses existing AddressBarTextField wrapped in an NSViewRepresentable.
There's AddressBarViewModel class created for interacting with SwiftUI views - it encapsulates
AddressBarViewController and forwards actions to it.
NTP content with search bar is now centered vertically in the view if all NTP sections are hidden
or in collapsed state.
This code is meant to be temporary and will be removed after the experiment finishes.

Steps to test this PR:

  1. Run the app
  2. Set internal user state
  3. Close the window and reopen, verify that the New Tab Page contains a search bar.
  4. Verify that the search bar works – typing queries, navigating to urls, opening search suggestions. Verify that cmd+return opens the query in a new tab.
  5. Type text in search bar so that the suggestions window is displayed. Scroll NTP and verify that suggestions window disappears.
  6. Shrink the window vertically and verify that it displays a more compact Dax logo.
  7. Focus the search bar and scroll NTP so that the search bar is not visible. Start typing and verify that NTP scrolls down to reveal the search bar.
  8. Click Customize button in the bottom-right corner of the NTP and hide all NTP sections. Verify that the search bar is (roughly) centered vertically inside the view.
  9. Show Recently Visited section and collapse it. Verify that NTP content is centered vertically. Expand Recently Visited and verify that NTP content is not centered anymore.
  10. Remove internal user state, close the window and reopen and verify that the search bar is not visible.

Definition of Done:


Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

Copy link

github-actions bot commented Oct 16, 2024

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.
Messages
📖

You seem to be updating localized strings. Make sure that you request translations and include translated strings before you ship your change. See Localization Guidelines for more information.

Generated by 🚫 dangerJS against aa11ed7

@ayoy ayoy marked this pull request as ready for review October 17, 2024 07:14
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