Compare commits

...

4 Commits

14 changed files with 200 additions and 19 deletions

View File

@@ -35,7 +35,7 @@ Zen is a firefox-based browser with the aim of pushing your productivity to a ne
### Firefox Versions
- [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `149.0.2`! 🚀
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 149.0`!
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 149.0.2`!
### Contributing

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/customizableui/ToolbarContextMenu.sys.mjs b/browser/components/customizableui/ToolbarContextMenu.sys.mjs
index d5fd707b98e4b163a624c97ff4a8f2574e0b0180..a3ac939aa9133a678396c16bc6746444a3f3ac1f 100644
index d5fd707b98e4b163a624c97ff4a8f2574e0b0180..b5d7e84c3567e83b95a6493e8333d3036dc88f36 100644
--- a/browser/components/customizableui/ToolbarContextMenu.sys.mjs
+++ b/browser/components/customizableui/ToolbarContextMenu.sys.mjs
@@ -183,7 +183,7 @@ export var ToolbarContextMenu = {
@@ -23,3 +23,11 @@ index d5fd707b98e4b163a624c97ff4a8f2574e0b0180..a3ac939aa9133a678396c16bc6746444
let toggleVerticalTabsItem = document.getElementById(
"toolbar-context-toggle-vertical-tabs"
@@ -267,6 +264,7 @@ export var ToolbarContextMenu = {
document.getElementById("sidebarRevampSeparator").hidden =
!showSidebarActions || isVerticalTabStripMenu;
document.getElementById("customizationMenuSeparator").hidden =
+ true ||
toolbarItem?.id == "tabbrowser-tabs" ||
(toolbarItem?.localName == "toolbarspring" &&
!CustomizationHandler.isCustomizing()) ||

View File

@@ -26,6 +26,12 @@ class nsHasPolyfill {
if (selected?.tagName?.toLowerCase() === "menu") {
return null;
}
if (selected) {
gZenCompactModeManager.log(
`Selector "${selector}" exists for: `,
element
);
}
return selected;
});
const { exists: shouldExist = true } = descendantSelectors;

View File

@@ -432,6 +432,9 @@ window.gZenUIManager = {
},
onUrlbarSearchModeChanged(event) {
if (gReduceMotion) {
return;
}
const { searchMode } = event.detail;
const input = gURLBar;
if (gURLBar.hasAttribute("breakout-extend") && !this._animatingSearchMode) {

View File

@@ -233,6 +233,7 @@
--zen-primary-color: rgb(11, 10, 11) !important;
/* Make sure its in sync with getToolbarColor */
--toolbox-textcolor: rgba(255, 255, 255, 0.8) !important;
--toolbar-color-scheme: dark !important;
}
&[zen-unsynced-window='true'] {

View File

@@ -177,7 +177,6 @@ window.gZenCompactModeManager = {
const attributes = [
"panelopen",
"open",
"opening",
"breakout-extend",
"zen-floating-urlbar",
];
@@ -186,7 +185,7 @@ window.gZenCompactModeManager = {
[
{
selector:
":where([panelopen='true'], [open='true'], [showing='true'], [breakout-extend='true'])" +
":where([panelopen='true'], [open='true'], [breakout-extend='true'])" +
":not(#urlbar[zen-floating-urlbar='true']):not(tab):not(.zen-compact-mode-ignore)",
},
],
@@ -198,7 +197,7 @@ window.gZenCompactModeManager = {
[
{
selector:
":where([panelopen='true'], [open='true'], [showing='true'], #urlbar:focus-within, [breakout-extend='true'])" +
":where([panelopen='true'], [open='true'], #urlbar:focus-within, [breakout-extend='true'])" +
":not(.zen-compact-mode-ignore)",
},
],

View File

@@ -1,6 +0,0 @@
<!--
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<svg width="1920" height="1080" viewBox="0 0 1920 1080" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_23_113)"><rect width="1920" height="1080" fill="url(#paint0_linear_23_113)"/><circle cx="960" cy="1080" r="740" stroke="#F2F0E3" stroke-width="120"/><circle cx="960" cy="1080" r="558.095" stroke="#F2F0E3" stroke-width="80"/><circle cx="960" cy="1080" r="386.19" stroke="#F2F0E3" stroke-width="60"/><circle cx="960" cy="1080" r="214.286" stroke="#F2F0E3" stroke-width="40"/></g><defs><linearGradient id="paint0_linear_23_113" x1="960" y1="0" x2="960" y2="1080" gradientUnits="userSpaceOnUse"><stop stop-color="#EA6E54"/><stop offset="1" stop-color="#D9664E"/></linearGradient><clipPath id="clip0_23_113"><rect width="1920" height="1080" fill="white"/></clipPath></defs></svg>

Before

Width:  |  Height:  |  Size: 1023 B

View File

@@ -2,7 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
content/browser/zen-images/brand-header.svg (../../zen/images/brand-header.svg)
content/browser/zen-images/layouts/collapsed.png (../../zen/images/layouts/collapsed.png)
content/browser/zen-images/layouts/multiple-toolbar.png (../../zen/images/layouts/multiple-toolbar.png)
content/browser/zen-images/layouts/single-toolbar.png (../../zen/images/layouts/single-toolbar.png)

View File

@@ -1551,7 +1551,7 @@ class nsZenWorkspaces {
!tab.hasAttribute("pending")
);
await gBrowser.explicitUnloadTabs(tabsToUnload); // TODO: unit test this
await gBrowser.explicitUnloadTabs(tabsToUnload);
}
moveTabToWorkspace(tab, workspaceID) {

View File

@@ -309,13 +309,16 @@
/* mark: workspace element */
zen-workspace {
flex-direction: column;
transition: padding-top 0.1s;
width: calc(100% + var(--zen-toolbox-padding) * 2);
position: absolute;
height: 100%;
overflow: hidden;
color: var(--toolbox-textcolor);
@media not (prefers-reduced-motion: reduce) {
transition: padding-top 0.1s;
}
:root:not([zen-sidebar-expanded='true']) & {
width: 100%;
}

View File

@@ -130,10 +130,14 @@
height: 22px;
border: none;
width: 100%;
transition:
height 0.08s ease-in-out,
padding 0.08s ease-in-out,
opacity 0.06s ease-in-out;
@media not (prefers-reduced-motion: reduce) {
transition:
height 0.08s ease-in-out,
padding 0.08s ease-in-out,
opacity 0.06s ease-in-out;
}
overflow: hidden;
position: relative;
opacity: 1;

View File

@@ -24,4 +24,6 @@ support-files = [
["browser_private_mode_startup.js"]
["browser_unload_all_other_spaces.js"]
["browser_workspace_bookmarks.js"]

View File

@@ -0,0 +1,162 @@
/* Any copyright is dedicated to the Public Domain.
https://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
add_setup(async function () {});
// verify that with only one workspace, regular tabs should remain loaded
add_task(async function test_UnloadAllOtherWorkspace_oneWorkspace() {
const workspace =
await gZenWorkspaces.createAndSaveWorkspace("Test Workspace");
const workspaceId = workspace.uuid;
await gZenWorkspaces.changeWorkspace(workspace);
const tabs = [];
for (let i = 0; i < 3; i++) {
const tab = await BrowserTestUtils.openNewForegroundTab(
window.gBrowser,
`data:text/html,<title>Hi! I am regular tab ${i}</title>`,
true,
{ skipAnimation: true }
);
tabs.push(tab);
}
for (const tab of tabs) {
ok(!tab.hasAttribute("pending"), "Tab should not be pending before unload");
ok(tab.linkedPanel, "Tab should have linked panel before unload");
}
await gZenWorkspaces.unloadAllOtherWorkspaces();
for (const tab of tabs) {
ok(!tab.hasAttribute("pending"), "Tab should not be pending after unload");
ok(tab.linkedPanel, "Tab should have linked panel after unload");
}
await gZenWorkspaces.removeWorkspace(workspaceId);
});
// with multiple workspaces, only regular tabs in other workspaces should be unloaded
add_task(async function test_UnloadAllOtherWorkspace_multipleWorkspaces() {
const inactiveWorkspace =
await gZenWorkspaces.createAndSaveWorkspace("Inactive Workspace");
const activeWorkspace =
await gZenWorkspaces.createAndSaveWorkspace("Active Workspace");
const inactiveWorkspaceId = inactiveWorkspace.uuid;
const activeWorkspaceId = activeWorkspace.uuid;
const inactiveWorkspaceTabs = [];
for (let i = 0; i < 2; i++) {
const tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
`data:text/html,<title>Regular Tab ${i} in Inactive</title>`,
true,
{ skipAnimation: true }
);
tab.setAttribute("zen-workspace-id", inactiveWorkspaceId);
inactiveWorkspaceTabs.push(tab);
}
const activeWorkspaceTabs = [];
for (let i = 0; i < 2; i++) {
const tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
`data:text/html,<title>Regular Tab ${i} in Active</title>`,
true,
{ skipAnimation: true }
);
tab.setAttribute("zen-workspace-id", activeWorkspaceId);
activeWorkspaceTabs.push(tab);
}
await gZenWorkspaces.unloadAllOtherWorkspaces();
for (const tab of activeWorkspaceTabs) {
ok(
!tab.hasAttribute("pending"),
"Tab in active workspace should not be unloaded"
);
ok(tab.linkedPanel, "Tab in active workspace should have linked panel");
}
for (const tab of inactiveWorkspaceTabs) {
ok(
tab.hasAttribute("pending"),
"Tab in inactive workspace should be unloaded"
);
ok(
!tab.linkedPanel,
"Tab in inactive workspace should not have linked panel"
);
}
await gZenWorkspaces.removeWorkspace(inactiveWorkspaceId);
await gZenWorkspaces.removeWorkspace(activeWorkspaceId);
});
// essentials in any workspace are not unloaded
add_task(async function test_UnloadAllOtherWorkspace_essentials() {
const activeWorkspace =
await gZenWorkspaces.createAndSaveWorkspace("Active Workspace");
const inactiveWorkspace =
await gZenWorkspaces.createAndSaveWorkspace("Inactive Workspace");
const activeWorkspaceId = activeWorkspace.uuid;
const inactiveWorkspaceId = inactiveWorkspace.uuid;
const activeWorkspaceTabs = [];
for (let i = 0; i < 2; i++) {
const tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
`data:text/html,<title>Essential Tab ${i} in Active</title>`,
true,
{ skipAnimation: true }
);
tab.setAttribute("zen-workspace-id", activeWorkspaceId);
tab.setAttribute("zen-essential", "true");
activeWorkspaceTabs.push(tab);
}
const inactiveWorkspaceTabs = [];
for (let i = 0; i < 2; i++) {
const tab = await BrowserTestUtils.openNewForegroundTab(
gBrowser,
`data:text/html,<title>Essential Tab ${i} in Inactive</title>`,
true,
{ skipAnimation: true }
);
gZenPinnedTabManager.addToEssentials(tab);
inactiveWorkspaceTabs.push(tab);
}
await gZenWorkspaces.unloadAllOtherWorkspaces();
for (const tab of activeWorkspaceTabs) {
ok(
!tab.hasAttribute("pending"),
"Essential Tab in active workspace should not be unloaded"
);
ok(
tab.linkedPanel,
"Essential Tab in active workspace should have linked panel"
);
}
for (const tab of inactiveWorkspaceTabs) {
ok(
!tab.hasAttribute("pending"),
"Essential Tab in inactive workspace should not be unloaded"
);
ok(
tab.linkedPanel,
"Essential Tab in inactive workspace should have linked panel"
);
}
for (const tab of inactiveWorkspaceTabs) {
gBrowser.removeTab(tab);
}
await gZenWorkspaces.removeWorkspace(inactiveWorkspaceId);
await gZenWorkspaces.removeWorkspace(activeWorkspaceId);
});

View File

@@ -20,7 +20,7 @@
"brandShortName": "Zen",
"brandFullName": "Zen Browser",
"release": {
"displayVersion": "1.19.7b",
"displayVersion": "1.19.8b",
"github": {
"repo": "zen-browser/desktop"
},