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

[iOS] Add new browser menu UI #26805

Merged
merged 2 commits into from
Dec 12, 2024
Merged

[iOS] Add new browser menu UI #26805

merged 2 commits into from
Dec 12, 2024

Conversation

kylehickinson
Copy link
Collaborator

@kylehickinson kylehickinson commented Nov 29, 2024

This adds a new modern browser menu UI behind the feature flag brave-use-modern-browser-menu

Resolves brave/brave-browser#42836

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

Screenshots

Menu:

Visible Show All Show All Scrolled
default visible default view all default view all scrolled

Customize:

Default Scrolled
customize customize scrolled

@kylehickinson kylehickinson added CI/skip-android Do not run CI builds for Android CI/skip-macos-x64 Do not run CI builds for macOS x64 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-teamcity Do not run builds in TeamCity labels Nov 29, 2024
@kylehickinson kylehickinson self-assigned this Nov 29, 2024
@kylehickinson kylehickinson force-pushed the ios-new-menu branch 2 times, most recently from ec94c65 to 0640546 Compare November 29, 2024 21:56
Copy link
Contributor

github-actions bot commented Dec 2, 2024

Chromium major version is behind target branch (131.0.6778.85 vs 132.0.6834.15). 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 Dec 2, 2024
@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 Dec 2, 2024
@kylehickinson kylehickinson force-pushed the ios-new-menu branch 2 times, most recently from cd0ffe6 to 061e6e7 Compare December 11, 2024 20:21
@kylehickinson kylehickinson marked this pull request as ready for review December 11, 2024 20:21
@kylehickinson kylehickinson requested a review from a team as a code owner December 11, 2024 20:21
This adds a new modern browser menu UI behind the feature flag `brave-use-modern-browser-menu`
Copy link
Contributor

[puLL-Merge] - brave/brave-core@26805

Description

This PR introduces a new modern browser menu UI for the Brave iOS app. The new menu is implemented using SwiftUI and offers customizable actions, VPN status integration, and a more visually appealing design. The feature is behind a feature flag and can be toggled on/off.

Possible Issues

  1. The new menu implementation might not handle all edge cases or have feature parity with the existing menu.
  2. Performance implications of using SwiftUI for the menu, especially on older devices, should be carefully tested.

Security Hotspots

No significant security issues were identified in this change.

Changes

Changes

  1. BrowserViewController+Menu.swift:

    • Added a new presentBrowserMenu method to display the new menu.
    • Refactored existing menu-related code to support the new menu structure.
  2. BrowserMenu.swift:

    • Implemented the main SwiftUI view for the new browser menu.
  3. BrowserMenuController.swift:

    • Created a UIHostingController wrapper for the SwiftUI-based menu.
  4. BrowserMenuModel.swift:

    • Implemented the data model for the browser menu, handling action visibility and ordering.
  5. CustomizeMenuView.swift:

    • Added a view for customizing the menu actions.
  6. Identifiers.swift:

    • Defined action identifiers for menu items.
  7. features.h and features.mm:

    • Added a new feature flag kModernBrowserMenuEnabled to toggle the new menu.
  8. about_flags.mm:

    • Added the new menu feature flag to the about:flags page.
  9. Various other files:

    • Added new localizable strings, tests, and resources to support the new menu implementation.
sequenceDiagram
    participant User
    participant BrowserViewController
    participant BrowserMenuController
    participant BrowserMenuModel
    participant BrowserMenu

    User->>BrowserViewController: Taps menu button
    BrowserViewController->>BrowserMenuController: Create and present menu
    BrowserMenuController->>BrowserMenuModel: Initialize with actions
    BrowserMenuController->>BrowserMenu: Create SwiftUI view
    BrowserMenu->>User: Display menu
    User->>BrowserMenu: Interact with menu items
    BrowserMenu->>BrowserMenuModel: Update action visibility/order
    BrowserMenuModel->>BrowserMenu: Reflect changes
    User->>BrowserMenu: Dismiss menu
    BrowserMenu->>BrowserViewController: Return to main view
Loading

@kylehickinson kylehickinson merged commit 3188d47 into master Dec 12, 2024
18 checks passed
@kylehickinson kylehickinson deleted the ios-new-menu branch December 12, 2024 21:01
@github-actions github-actions bot added this to the 1.75.x - Nightly milestone Dec 12, 2024
@brave-builds
Copy link
Collaborator

Released in v1.75.97

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-macos-x64 Do not run CI builds for macOS x64 CI/skip-teamcity Do not run builds in TeamCity CI/skip-windows-x64 Do not run CI builds for Windows x64 puLL-Merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add new customizable menu UI
4 participants