Closed Bug 2069846 Opened 2 months ago Closed 1 month ago

[customizable-menu] Show the extensions menu item in browser screen's menu

Categories

(Firefox for Android :: Menu, task)

All
Android
task

Tracking

()

RESOLVED FIXED
159 Branch
Tracking Status
firefox159 --- fixed

People

(Reporter: petru, Assigned: petru)

References

(Depends on 2 open bugs, Blocks 1 open bug)

Details

(Whiteboard: [fxdroid][android-core])

Attachments

(2 external files, 1 obsolete file)

Needed:

  • a BrowserMenuBuilder that has a hardcoded structure of the default home menu
  • this is instantiated by the MenuStores middleware and queried for the menu configuration to use
  • the configuration is updated by the MenuStores middleware to be displayed
  • the MenuStores middleware will handle the menu item interactions

*Note: This needs also configuring all the extensions to be displayed, everything that would be shown when it is clicked to be expanded.

Assignee: nobody → petru
Status: NEW → ASSIGNED
See Also: → 2070576

WebExtensionMenuActions.kt is now the one place that maps BrowserState to what actions do installed
extensions offer for the current tab:

  • WebExtensionMenuAction - allows passing all details inside menu items and events.
  • Flow<BrowserState>.webExtensionMenuActions combines the browser-level and tab-level flows to get
    what extensions actions are available for the current tab. Icons are only loaded when the
    extensions or their tab state actually change.
  • BrowserState.findWebExtensionMenuAction resolves the same action again at click time.

ExtensionsMenuItemProvider now lists what actions are offered by installed extensions for the
current tab rather than the installed addons:

WebExtensionsMenuBinding now consumes the shared flow too — it drops to a thin mapping onto its
lambda-carrying WebExtensionMenuItem, so the two menus can't drift apart. Its existing tests
exercise the shared code unchanged.

Two deliberate differences from the old menu:

  • The per-row settings button only appears when the action belongs to an addon the user installed.
    The old menu always drew it and did nothing when there was no matching addon.
  • The click resolves the action at click time rather than capturing it when the menu was built, so
    an extension that changed in the meantime no longer runs a stale action.
Attachment #9640537 - Attachment description: WIP: Bug 2069846 - Show the extensions menu item in browser screen's menu → Bug 2069846 - Show the extensions menu item in browser screen's menu r=#android-reviewers
Attachment #9640537 - Attachment description: Bug 2069846 - Show the extensions menu item in browser screen's menu r=#android-reviewers → Bug 2069846 - part 1 - Show the extensions menu item in browser screen's menu r=#android-reviewers

WebExtensionMenuActions.kt is now the one place that maps BrowserState to what actions do installed
extensions offer for the current tab:

  • WebExtensionMenuAction - allows passing all details inside menu items and events.
  • Flow<BrowserState>.webExtensionMenuActions combines the browser-level and tab-level flows to get
    what extensions actions are available for the current tab. Icons are only loaded when the
    extensions or their tab state actually change.
  • BrowserState.findWebExtensionMenuAction resolves the same action again at click time.

ExtensionsMenuItemProvider now lists what actions are offered by installed extensions for the
current tab rather than the installed addons:

WebExtensionsMenuBinding now consumes the shared flow too — it drops to a thin mapping onto its
lambda-carrying WebExtensionMenuItem, so the two menus can't drift apart. Its existing tests
exercise the shared code unchanged.

Two deliberate differences from the old menu:

  • The per-row settings button only appears when the action belongs to an addon the user installed.
    The old menu always drew it and did nothing when there was no matching addon.
  • The click resolves the action at click time rather than capturing it when the menu was built, so
    an extension that changed in the meantime no longer runs a stale action.
Attachment #9642463 - Attachment is obsolete: true
Depends on: 2076265
Pushed by plingurar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c4e6bbefe4d1 https://hg.mozilla.org/integration/autoland/rev/13a5231ea002 part 1 - Show the extensions menu item in browser screen's menu r=android-reviewers,android-addons-reviewers,matt-tighe,robwu https://github.com/mozilla-firefox/firefox/commit/379390674d8f https://hg.mozilla.org/integration/autoland/rev/fcccf0097201 part 2 - Show installed extensions actions in the menu r=android-reviewers,android-addons-reviewers,matt-tighe,robwu
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 159 Branch
Depends on: 2078248
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: