mirror of
https://github.com/zen-browser/desktop.git
synced 2025-07-10 11:25:29 +02:00
Improve self-hosted runner script execution and enhance ZenCustomizableUI event handling for better UI responsiveness
This commit is contained in:
parent
a86bb5197d
commit
74c9923f0b
3 changed files with 16 additions and 14 deletions
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
|
@ -436,13 +436,15 @@ jobs:
|
||||||
sudo ./aws/install --update
|
sudo ./aws/install --update
|
||||||
|
|
||||||
- name: Stop self-hosted runner
|
- name: Stop self-hosted runner
|
||||||
|
if: ${{ inputs.create_release && inputs.update_branch == 'release' }}
|
||||||
run: |
|
run: |
|
||||||
echo "Stopping self-hosted runner"
|
echo "Stopping self-hosted runner"
|
||||||
echo "${{ secrets.SELF_HOSTED_RUNNER_STOP_SCRIPT }}" | base64 -d > stop.sh
|
echo "${{ secrets.SELF_HOSTED_RUNNER_STOP_SCRIPT }}" | base64 -d > stop.sh
|
||||||
sudo chmod +x stop.sh
|
sudo chmod +x stop.sh
|
||||||
bash ./stop.sh
|
bash ./stop.sh > /dev/null
|
||||||
|
|
||||||
- name: Remove self-hosted runner script
|
- name: Remove self-hosted runner script
|
||||||
|
if: always() && ${{ inputs.create_release && inputs.update_branch == 'release' }}
|
||||||
run: |
|
run: |
|
||||||
echo "Removing self-hosted runner script"
|
echo "Removing self-hosted runner script"
|
||||||
rm stop.sh || true
|
rm stop.sh || true
|
||||||
|
|
|
@ -125,5 +125,8 @@ export var ZenCustomizableUI = new (class {
|
||||||
registerToolbarNodes(window) {
|
registerToolbarNodes(window) {
|
||||||
window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-top-buttons'));
|
window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-top-buttons'));
|
||||||
window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-icons-wrapper'));
|
window.CustomizableUI.registerToolbarNode(window.document.getElementById('zen-sidebar-icons-wrapper'));
|
||||||
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
|
this._dispatchResizeEvent(window);
|
||||||
|
}, { once: true });
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs
|
diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs
|
||||||
index b953d7d2c8fa7fe2d320bd7cb7af9aeeef0abc86..bb9568158ddf53801de576af05c50ff9c0f333c6 100644
|
index b953d7d2c8fa7fe2d320bd7cb7af9aeeef0abc86..251c3a7fa624057a8eaba5c0c42ef23fe2a6ace3 100644
|
||||||
--- a/browser/components/customizableui/CustomizableUI.sys.mjs
|
--- a/browser/components/customizableui/CustomizableUI.sys.mjs
|
||||||
+++ b/browser/components/customizableui/CustomizableUI.sys.mjs
|
+++ b/browser/components/customizableui/CustomizableUI.sys.mjs
|
||||||
@@ -13,6 +13,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
@@ -13,6 +13,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
|
||||||
|
@ -124,16 +124,12 @@ index b953d7d2c8fa7fe2d320bd7cb7af9aeeef0abc86..bb9568158ddf53801de576af05c50ff9
|
||||||
/**
|
/**
|
||||||
* Add a widget to an area.
|
* Add a widget to an area.
|
||||||
* If the area to which you try to add is not known to CustomizableUI,
|
* If the area to which you try to add is not known to CustomizableUI,
|
||||||
@@ -6370,7 +6369,7 @@ class OverflowableToolbar {
|
@@ -6408,11 +6407,11 @@ class OverflowableToolbar {
|
||||||
*/
|
parseFloat(style.paddingLeft) -
|
||||||
async #getOverflowInfo() {
|
parseFloat(style.paddingRight) -
|
||||||
function getInlineSize(aElement) {
|
toolbarChildrenWidth;
|
||||||
- return aElement.getBoundingClientRect().width;
|
- targetWidth = getInlineSize(this.#target);
|
||||||
+ return aElement.getBoundingClientRect().width - ((win.gZenVerticalTabsManager._hasSetSingleToolbar && aElement.closest('#zen-sidebar-top-buttons-customization-target')) ? win.gZenVerticalTabsManager._topButtonsSeparatorElement.getBoundingClientRect().width : 0);
|
+ targetWidth = getInlineSize(this.#target) - ((win.gZenVerticalTabsManager._hasSetSingleToolbar && this.#target.id == 'zen-sidebar-top-buttons-customization-target') ? win.gZenVerticalTabsManager._topButtonsSeparatorElement.getBoundingClientRect().width : 0);
|
||||||
}
|
|
||||||
|
|
||||||
function sumChildrenInlineSize(aParent, aExceptChild = null) {
|
|
||||||
@@ -6412,7 +6411,7 @@ class OverflowableToolbar {
|
|
||||||
targetChildrenWidth =
|
targetChildrenWidth =
|
||||||
this.#target == this.#toolbar
|
this.#target == this.#toolbar
|
||||||
? toolbarChildrenWidth
|
? toolbarChildrenWidth
|
||||||
|
@ -142,16 +138,17 @@ index b953d7d2c8fa7fe2d320bd7cb7af9aeeef0abc86..bb9568158ddf53801de576af05c50ff9
|
||||||
});
|
});
|
||||||
|
|
||||||
lazy.log.debug(
|
lazy.log.debug(
|
||||||
@@ -6422,7 +6421,7 @@ class OverflowableToolbar {
|
@@ -6422,7 +6421,8 @@ class OverflowableToolbar {
|
||||||
// If the target has min-width: 0, their children might actually overflow
|
// If the target has min-width: 0, their children might actually overflow
|
||||||
// it, so check for both cases explicitly.
|
// it, so check for both cases explicitly.
|
||||||
let targetContentWidth = Math.max(targetWidth, targetChildrenWidth);
|
let targetContentWidth = Math.max(targetWidth, targetChildrenWidth);
|
||||||
- let isOverflowing = Math.floor(targetContentWidth) > totalAvailWidth;
|
- let isOverflowing = Math.floor(targetContentWidth) > totalAvailWidth;
|
||||||
|
+ if (win.gZenVerticalTabsManager._hasSetSingleToolbar && this.#toolbar == 'nav-bar') return { isOverflowing: false, targetContentWidth, totalAvailWidth };
|
||||||
+ let isOverflowing = Math.floor(targetContentWidth) + (win.gZenVerticalTabsManager._hasSetSingleToolbar ? 0.1 : 0) > totalAvailWidth;
|
+ let isOverflowing = Math.floor(targetContentWidth) + (win.gZenVerticalTabsManager._hasSetSingleToolbar ? 0.1 : 0) > totalAvailWidth;
|
||||||
return { isOverflowing, targetContentWidth, totalAvailWidth };
|
return { isOverflowing, targetContentWidth, totalAvailWidth };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6516,7 +6515,7 @@ class OverflowableToolbar {
|
@@ -6516,7 +6516,7 @@ class OverflowableToolbar {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!inserted) {
|
if (!inserted) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue