-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Enable original extensions panel on hide-unified-extensions-button: false #11335
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
Open
blakegearin
wants to merge
9
commits into
zen-browser:dev
Choose a base branch
from
blakegearin:feat-og-extensions-panel
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+189
−58
Open
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
07e63bb
feat: Enable original extensions panel on hide-unified-extensions-but…
blakegearin c37eb43
Update to fix prettier issues
blakegearin 1caf0b4
Add site-data attribute for CSS usage
blakegearin 15c9b0e
Update to set gUnifiedExtensions._panel
blakegearin def1073
Update to fix prettier issues
blakegearin d715921
Set default panel on onToolbarVisibilityChange
blakegearin b4c1d52
Update panel initialization
blakegearin 31f4d4e
Remove extra char
blakegearin ab4c812
Restore unified-extensions-panel-template deletion
blakegearin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| diff --git a/browser/base/content/browser-addons.js b/browser/base/content/browser-addons.js | ||
| index f33a300eb0eed74e286da24919ad3e8505f632c3..9f400e887424693d0ecceb9db79fccf2bd5a757d 100644 | ||
| index f33a300eb0eed74e286da24919ad3e8505f632c3..8a4f3334029ac339990a93f47a1f87e1ffe97313 100644 | ||
| --- a/browser/base/content/browser-addons.js | ||
| +++ b/browser/base/content/browser-addons.js | ||
| @@ -1069,7 +1069,7 @@ var gXPInstallObserver = { | ||
|
|
@@ -10,7 +10,7 @@ index f33a300eb0eed74e286da24919ad3e8505f632c3..9f400e887424693d0ecceb9db79fccf2 | |
| + position: gZenUIManager.panelUIPosition(), | ||
| }, | ||
| }; | ||
|
|
||
| @@ -1279,7 +1279,7 @@ var gXPInstallObserver = { | ||
| hideClose: true, | ||
| timeout: Date.now() + 30000, | ||
|
|
@@ -19,15 +19,15 @@ index f33a300eb0eed74e286da24919ad3e8505f632c3..9f400e887424693d0ecceb9db79fccf2 | |
| + position: gZenUIManager.panelUIPosition(), | ||
| }, | ||
| }; | ||
|
|
||
| @@ -2211,7 +2211,7 @@ var gUnifiedExtensions = { | ||
| // If the new ID is not added in NOTIFICATION_IDS, consider handling the case | ||
| // in the "PopupNotificationsBeforeAnchor" handler elsewhere in this file. | ||
| getPopupAnchorID(aBrowser, aWindow) { | ||
| - const anchorID = "unified-extensions-button"; | ||
| + const anchorID = "zen-site-data-icon-button"; | ||
| const attr = anchorID + "popupnotificationanchor"; | ||
|
|
||
| if (!aBrowser[attr]) { | ||
| @@ -2222,7 +2222,7 @@ var gUnifiedExtensions = { | ||
| anchorID | ||
|
|
@@ -36,58 +36,112 @@ index f33a300eb0eed74e286da24919ad3e8505f632c3..9f400e887424693d0ecceb9db79fccf2 | |
| - ).firstElementChild; | ||
| + ); | ||
| } | ||
|
|
||
| return anchorID; | ||
| @@ -2646,11 +2646,7 @@ var gUnifiedExtensions = { | ||
| // Lazy load the unified-extensions-panel panel the first time we need to | ||
| // display it. | ||
| if (!this._panel) { | ||
| - let template = document.getElementById( | ||
| - "unified-extensions-panel-template" | ||
| - ); | ||
| - template.replaceWith(template.content); | ||
| - this._panel = document.getElementById("unified-extensions-panel"); | ||
| + this._panel = document.getElementById("zen-unified-site-data-panel"); | ||
| let customizationArea = this._panel.querySelector( | ||
| "#unified-extensions-area" | ||
| ); | ||
| @@ -2703,6 +2699,7 @@ var gUnifiedExtensions = { | ||
| // and no alternative content is available for display in the panel. | ||
| const policies = this.getActivePolicies(); | ||
| @@ -2391,7 +2391,7 @@ var gUnifiedExtensions = { | ||
| break; | ||
|
|
||
| case "toolbarvisibilitychange": | ||
| - this.onToolbarVisibilityChange(event.target.id, event.detail.visible); | ||
| + this.onToolbarVisibilityChange(event.target.id, event.detail.visible, panel); | ||
mr-cheffy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| break; | ||
| } | ||
| }, | ||
| @@ -2536,7 +2536,7 @@ var gUnifiedExtensions = { | ||
| requestAnimationFrame(() => this.updateAttention()); | ||
| }, | ||
|
|
||
| - onToolbarVisibilityChange(toolbarId, isVisible) { | ||
| + onToolbarVisibilityChange(toolbarId, isVisible, panel) { | ||
| // A list of extension widget IDs (possibly empty). | ||
| let widgetIDs; | ||
|
|
||
| @@ -2550,7 +2550,7 @@ var gUnifiedExtensions = { | ||
| } | ||
|
|
||
| // The list of overflowed extensions in the extensions panel. | ||
| - const overflowedExtensionsList = this.panel.querySelector( | ||
| + const overflowedExtensionsList = panel.querySelector( | ||
| "#overflowed-extensions-list" | ||
| ); | ||
|
|
||
| @@ -2681,7 +2681,7 @@ var gUnifiedExtensions = { | ||
|
|
||
| // `aEvent` and `reason` are optional. If `reason` is specified, it should be | ||
| // a valid argument to gUnifiedExtensions.recordButtonTelemetry(). | ||
| - async togglePanel(aEvent, reason) { | ||
| + async togglePanel(aEvent, reason, panel = this._panel, view, button) { | ||
| if (!CustomizationHandler.isCustomizing()) { | ||
| if (aEvent) { | ||
| if ( | ||
| + false && | ||
| policies.length && | ||
| !this.hasExtensionsInPanel(policies) && | ||
| !this.isPrivateWindowMissingExtensionsWithoutPBMAccess() && | ||
| @@ -2743,7 +2740,7 @@ var gUnifiedExtensions = { | ||
| @@ -2718,32 +2718,30 @@ var gUnifiedExtensions = { | ||
| this.blocklistAttentionInfo = | ||
| await AddonManager.getBlocklistAttentionInfo(); | ||
|
|
||
| - let panel = this.panel; | ||
| - | ||
| if (!this._listView) { | ||
| this._listView = PanelMultiView.getViewNode( | ||
| document, | ||
| - "unified-extensions-view" | ||
| + view, | ||
| ); | ||
| this._listView.addEventListener("ViewShowing", this); | ||
| this._listView.addEventListener("ViewHiding", this); | ||
| } | ||
|
|
||
| - if (this._button.open) { | ||
| + if (button.open) { | ||
| PanelMultiView.hidePopup(panel); | ||
| - this._button.open = false; | ||
| + button.open = false; | ||
| } else { | ||
| // Overflow extensions placed in collapsed toolbars, if any. | ||
| for (const toolbarId of CustomizableUI.getCollapsedToolbarIds(window)) { | ||
| // We pass `false` because all these toolbars are collapsed. | ||
| - this.onToolbarVisibilityChange(toolbarId, /* isVisible */ false); | ||
| + this.onToolbarVisibilityChange(toolbarId, /* isVisible */ false, panel); | ||
| } | ||
|
|
||
| panel.hidden = false; | ||
| this.recordButtonTelemetry(reason || "extensions_panel_showing"); | ||
| this.ensureButtonShownBeforeAttachingPanel(panel); | ||
| PanelMultiView.openPopup(panel, this._button, { | ||
| - PanelMultiView.openPopup(panel, this._button, { | ||
| - position: "bottomright topright", | ||
| + position: gZenUIManager.panelUIPosition(panel, this._button), | ||
| + PanelMultiView.openPopup(panel, button, { | ||
| + position: gZenUIManager.panelUIPosition(panel, button), | ||
| triggerEvent: aEvent, | ||
| }); | ||
| } | ||
| @@ -2930,18 +2927,20 @@ var gUnifiedExtensions = { | ||
| @@ -2830,7 +2828,7 @@ var gUnifiedExtensions = { | ||
| if ( | ||
| notInPanel || | ||
| document.querySelector("#unified-extensions-area > :first-child") | ||
| - ?.id === widgetId | ||
| + ?.id === widgetIdz | ||
|
||
| ) { | ||
| moveUp.hidden = true; | ||
| } | ||
| @@ -2930,18 +2928,20 @@ var gUnifiedExtensions = { | ||
| this._maybeMoveWidgetNodeBack(widgetId); | ||
| } | ||
|
|
||
| - this.pinToToolbar(widgetId, shouldPinToToolbar); | ||
| + await this.pinToToolbar(widgetId, shouldPinToToolbar); | ||
| }, | ||
|
|
||
| - pinToToolbar(widgetId, shouldPinToToolbar) { | ||
| + async pinToToolbar(widgetId, shouldPinToToolbar) { | ||
| let newArea = shouldPinToToolbar | ||
| ? CustomizableUI.AREA_NAVBAR | ||
| : CustomizableUI.AREA_ADDONS; | ||
| let newPosition = shouldPinToToolbar ? undefined : 0; | ||
| + await gZenVerticalTabsManager._preCustomize(); | ||
|
|
||
| CustomizableUI.addWidgetToArea(widgetId, newArea, newPosition); | ||
| // addWidgetToArea() will trigger onWidgetAdded or onWidgetMoved as needed, | ||
| // and our handlers will call updateAttention() as needed. | ||
| + await gZenVerticalTabsManager._postCustomize(); | ||
| }, | ||
|
|
||
| async moveWidget(menu, direction) { | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of removing, you should just see if the preference is enabled and then do what the patch is originally doing or firefox's addon functionality.
https://github.com/zen-browser/desktop/pull/11335/files#r2545668861