Skip to content

[iOS] New "Top Sites" picker inside New Tab Page settings screen - #39895

Open
nuo-xu wants to merge 2 commits into
masterfrom
topsites/new-tab-page-settings
Open

nuo-xu wants to merge 2 commits into
masterfrom
topsites/new-tab-page-settings

Conversation

@nuo-xu

@nuo-xu nuo-xu commented Sep 15, 2026

Copy link
Copy Markdown
Contributor
  • FavoritesSectionProvider/FavoritesOverflowSectionProvider now expose an isTopsitesHidden flag and return 0 items when hidden, the same pattern Stats/News already use.
  • Settings UI: A new picker to pick among "Frequently visited", "Favorites", "None" to replace the single "Favorites" toggle.
  • All of the above is gated behind a new kTopsitesEnabled feature flag (disabled by default, exposed at brave://flags as "Enable Top Sites"), since this introduces user-facing options for a mode that isn't implemented yet.

Note: Most Visited is not implemented yet: while the flag is on, picking "Frequently visited" currently behaves identically to "Favorites" (shows the existing Favorites tiles). Only "None" actually hides the section. The real Most Visited tile source lands in a follow-up PR.

Test:
(upgrade from a build older than v1.97.25 to a build include this PR's changes)

  1. With kTopsitesEnabled at its default (disabled):
    • Settings > New Tab Page > Widgets shows Privacy Hub and a single "Favorites" toggle — no picker.
    • Toggling Favorites off hides the Favorites tiles and the "show more" pill on the NTP; toggling back on restores them.
  2. Enable brave://flags/#topsites and relaunch:
    • The Favorites toggle is replaced by a "Top Sites" picker with Favorites / Frequently visited / None.
    • Selecting Favorites or Frequently visited shows the existing Favorites tiles; selecting None hides them and the "show more" pill.
    • Switching options updates the NTP immediately without leaving Settings.
  3. Fresh install, no favorites, flag enabled: NTP doesn't crash; picker lands on None.
  4. Regression: Privacy Hub toggle and Brave News section are
    unaffected by these changes.
simulator_screenshot_665104F0-FE42-4B6D-B63A-759988002E55

@nuo-xu
nuo-xu requested a review from a team September 15, 2026 17:37
@nuo-xu nuo-xu self-assigned this Sep 15, 2026
@nuo-xu nuo-xu added CI/skip-android Do not run CI builds for Android CI/skip-windows-x64 Do not run CI builds for Windows x64 CI/skip-macos-arm64 Do not run CI builds for macOS arm64 CI/skip-origin Do not run CI builds for Origin labels Sep 15, 2026

@EliHini EliHini left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking good. Just one question. With Top site enabled, I don't see any tiles or top sites. Where should be looking to verify this?

Image

@kylehickinson kylehickinson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As discussed in DM:

  • Reuse/refactor favorites section provider, alter what it shows inside that provider rather than mess with the section providers. Just return 0 items when no top sites/favs are visible similar to stats/news. This should significantly simplify changes and avoid weird collection view section updates.
  • Settings UI: No need to have both a switch and picker, just have "none"/"hidden"/some other language be an option
  • All of these changes should be behind a feature flag since you're introducing user facing changes for a feature that isn't implemented yet. If a user picks "top sites" like Eli saw, nothing shows up at all. We shouldn't let users see this option yet

Comment thread ios/brave-ios/Sources/Brave/Frontend/ClientPreferences.swift Outdated
Comment thread ios/brave-ios/Sources/Brave/Frontend/ClientPreferences.swift Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Chromium major version is behind target branch (153.0.8010.37 vs 154.0.8037.41). Please rebase.

@github-actions github-actions Bot added the chromium-version-mismatch The Chromium version on the PR branch does not match the version on the target branch label Sep 16, 2026
@nuo-xu
nuo-xu force-pushed the topsites/new-tab-page-settings branch from fde379a to b56e48d Compare September 16, 2026 21:05
@github-actions github-actions Bot removed the chromium-version-mismatch The Chromium version on the PR branch does not match the version on the target branch label Sep 16, 2026
@nuo-xu nuo-xu changed the title [iOS] Add "Show Top Sites" toggle to NTP settings, replacing favorites-only toggle [iOS] New "Top Sites" picker inside New Tab Page settings screen Sep 16, 2026
1. Gate NTP Top Sites settings behind a feature flag.
2. Move Favorites/Most Visited/None gating into FavoritesSectionProvider and FavoritesOverflowSectionProvider (return 0 items when hidden) instead of rebuilding NewTabPageViewController's section list on every pref change, matching how Stats/News hide themselves.
3. Collapse the settings UI to one control instead of a switch plus a picker: a plain Favorites toggle when feature flag is off, or a single Top Sites picker (Favorites/Most Visited/None) when kTopsitesEnabled is
on. The flag defaults to disabled since Most Visited tiles aren't implemented yet — picking it currently falls back to showing Favorites, called out in the PR description.
@nuo-xu
nuo-xu force-pushed the topsites/new-tab-page-settings branch from b56e48d to 070c3fb Compare September 17, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/skip-android Do not run CI builds for Android CI/skip-macos-arm64 Do not run CI builds for macOS arm64 CI/skip-origin Do not run CI builds for Origin CI/skip-windows-x64 Do not run CI builds for Windows x64

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] Update New Tab Page Settings

4 participants