Closed Bug 1797836 Opened 2 years ago Closed 2 years ago

Add a new CustomizableUI panel area for the Unified Extensions panel

Categories

(Firefox :: Toolbars and Customization, task, P1)

task

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: mconley, Assigned: mconley)

References

(Blocks 1 open bug)

Details

(Whiteboard: [addons-jira])

Attachments

(3 files)

We need to make it possible for users WebExtension-provided widgets to appear in this panel, even if they haven't overflowed there (bug 1797155). In fact, for newly installed addons, this will be the default home for their browser_actions. I'm going to list out some requirements as I understand them:

  1. This new area cannot have non-WebExtension widgets moved into it, ever.
  2. Newly installed WebExtension browser_action's will live here
  3. However, pre-existing WebExtensions for which the browser_actions were already in the nav-bar should keep their browser_actions in the nav-bar. Like, we shouldn't go and move any toolbar items for users when this goes out by default.
Component: General → Toolbars and Customization
Product: WebExtensions → Firefox
Depends on: 1797838

It looks like we had some kind of hard-coded assumption here that every area
in CustomizableUI was of TYPE_TOOLBAR except for AREA_FIXED_OVERFLOW_PANEL, which
was manually spliced out of the area array when initting the toolbars after
DOMContentLoaded.

A later patch in this series is adding a new area of TYPE_MENU_PANEL, and
instead of also splicing that out of the area array in DOMContentLoaded,
we now make sure to only call registerToolbarNode on areas that are
actually toolbars.

Long ago, the menu panel in was a customizable area that users could drag things into.

That changed back around 2017 in bug 1354117 when the Photon redesign was built. The
menu panel become a static menu, but we also made it possible to permanently move things
to the overflow panel of the nav-bar.

It looks like we never updated the area type constant from referring to the old menu panel
though, so it's "TYPE_MENU_PANEL", and registering a node for it happens with
registerMenuPanel. This patch changes to constant to TYPE_PANEL and updates the registration
method to registerPanelNode.

I a check around the codebase as well as GitHub looking to see if there were any
system add-ons or experimental WebExtensions that rely on TYPE_MENU_PANEL / registerMenuPanel,
but I couldn't find any.

Depends on D161077

This area doesn't have any special rules applied yet, nor can it have items moved to
it except programmatically. All of that will come later.

Depends on D161078

Attachment #9301629 - Attachment description: WIP: Bug 1797836 - Part 1: browser.js should only call registerToolbarNode on CUI areas of TYPE_TOOLBAR. r?cmkm! → Bug 1797836 - Part 1: browser.js should only call registerToolbarNode on CUI areas of TYPE_TOOLBAR. r?cmkm!
Attachment #9301630 - Attachment description: WIP: Bug 1797836 - Part 2: Update CUI to have a general TYPE_PANEL instead of TYPE_MENU_PANEL. r?Gijs! → Bug 1797836 - Part 2: Update CUI to have a general TYPE_PANEL instead of TYPE_MENU_PANEL. r?Gijs!
Attachment #9301631 - Attachment description: WIP: Bug 1797836 - Part 3: Add a new AREA_ADDONS for the Unified Extensions panel. r?Gijs! → Bug 1797836 - Part 3: Add a new AREA_ADDONS for the Unified Extensions panel. r?Gijs!
Blocks: 1798814
Blocks: 1798896
Severity: -- → N/A
Priority: -- → P1
Pushed by mconley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9aaa6d1a3568
Part 1: browser.js should only call registerToolbarNode on CUI areas of TYPE_TOOLBAR. r=cmkm
https://hg.mozilla.org/integration/autoland/rev/27236b0e40dd
Part 2: Update CUI to have a general TYPE_PANEL instead of TYPE_MENU_PANEL. r=desktop-theme-reviewers,dao,sclements
https://hg.mozilla.org/integration/autoland/rev/0739086341d5
Part 3: Add a new AREA_ADDONS for the Unified Extensions panel. r=Gijs
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: