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 support for controlling sections visibility on HTML New Tab Page #3551

Merged
merged 50 commits into from
Nov 19, 2024

Conversation

ayoy
Copy link
Collaborator

@ayoy ayoy commented Nov 14, 2024

Task/Issue URL: https://app.asana.com/0/0/1208644439480896/f
Tech Design URL: https://app.asana.com/0/0/1208763428292737/f

Description:
This change adds a separate webView to host HTML New Tab Page. It's got its own
User Content Controller and Navigation Delegate, loads only the NTP user script and
blocks navigations other than to the new tab page (i.e. all other URLs).
BrowserTabViewController logic is updated to swap regular webView with NTP webView
as needed to provide seamless navigation.
Another addition in this patch is the initial functionality of the HTML NTP which is
managing sections visibility (Favorites + Privacy Stats). Empty favorites and privacy stats
sets are hardcoded to verify that visibility settings work.

Steps to test this PR:

  1. Launch the app from Xcode
  2. Become internal user
  3. Enable HTML NTP via Debug Menu -> Feature Flag Overrides -> htmlNewTabPage
  4. Open 2 or more windows with NTP, open another window with Appearance Settings
  5. Try changing sections visibility from NTP context menu, Appearance Settings or Customize button on NTP
  6. Verify that in all cases settings are propagated to all views, including native Appearance Settings.
  7. On NTP, verify that you can open Developer Console

Definition of Done:


Internal references:

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

ayoy added 30 commits November 6, 2024 11:46
This reverts commit ee77f47.
Copy link
Contributor

github-actions bot commented Nov 14, 2024

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

Generated by 🚫 dangerJS against 555053c

@ayoy ayoy requested a review from SabrinaTardio November 18, 2024 17:00
@ayoy ayoy marked this pull request as ready for review November 18, 2024 17:00
@ayoy ayoy requested review from SabrinaTardio and removed request for SabrinaTardio November 18, 2024 17:02
Copy link
Collaborator

@SabrinaTardio SabrinaTardio left a comment

Choose a reason for hiding this comment

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

LGTM!
as discussed you are doing changes therefore you will add tests in the following PR.

@@ -34,6 +35,7 @@ final class MainViewController: NSViewController {
let findInPageViewController: FindInPageViewController
let fireViewController: FireViewController
let bookmarksBarViewController: BookmarksBarViewController
let featureFlagger: FeatureFlagger
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it actually used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah no, I mentioned it to you yesterday but forgot to remove it :) sorry and thanks for the reminder!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Apologies. It actually is required because it's used in MainMenuActions.swift

@ayoy ayoy merged commit 6520201 into main Nov 19, 2024
21 checks passed
@ayoy ayoy deleted the dominik/htmlntp-sections branch November 19, 2024 10:07
samsymons added a commit that referenced this pull request Nov 21, 2024
…g-error

# By Anka (5) and others
# Via GitHub (5) and Dominik Kapusta (1)
* main: (28 commits)
  Add attemptCount and maxAttempts to broker config (#3533)
  Hide continue setup cards after 1 week (#3471)
  Add expectation when checking email text field value (#3572)
  [macos] adding support for message bridge (#3558)
  Update PIR test runner (#3570)
  Add support for controlling sections visibility on HTML New Tab Page (#3551)
  Bump version to 1.115.0 (311)
  macOS 13/14 UI test compilation fix (#3569)
  macOS 13/14 UI test compilation fix (#3569)
  Fix bug where bookmarks bar prompt does not hide bar (#3553)
  Add OS version to download fail pixel (#3568)
  Remove get_tasks_in_last_internal_release (#3566)
  Bump version to 1.115.0 (310)
  Update skip-release check
  Update fastlane plugin to 0.11.6
  Bump ddg-apple-automation version for bugfix (#3565)
  PIR E2E tests GitHub actions (#3528)
  Update autoconsent to v11.5.0 (#3561)
  Bump version to 1.115.0 (309)
  Set marketing version to 1.115.0
  ...

# Conflicts:
#	DuckDuckGo.xcodeproj/project.pbxproj
#	DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
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.

2 participants