diff --git a/src/zen/common/styles/zen-theme.css b/src/zen/common/styles/zen-theme.css index 859e08293..0baacf3c9 100644 --- a/src/zen/common/styles/zen-theme.css +++ b/src/zen/common/styles/zen-theme.css @@ -12,13 +12,12 @@ :root { /* Default values */ --zen-border-radius: 7px; - --zen-primary-color: #ffb787; + --zen-primary-color: AccentColor; --zen-background-opacity: 1; /* Branding */ --zen-branding-dark: #1d1d1d; - --zen-branding-coral: #f76f53; --zen-branding-paper: #ebebeb; --zen-branding-bg: light-dark(var(--zen-branding-paper), var(--zen-branding-dark)); diff --git a/src/zen/tabs/zen-tabs.css b/src/zen/tabs/zen-tabs.css index aa71f65a7..a195b4e44 100644 --- a/src/zen/tabs/zen-tabs.css +++ b/src/zen/tabs/zen-tabs.css @@ -36,9 +36,7 @@ * - Bookmarks toolbar is visible OR * - The container is explicitly marked to hide controls (e.g., on Linux with reversed controls) */ - :root[zen-has-bookmarks] & { -%include zen-tabs/vertical-tabs-topbar.inc.css - } + :root[zen-has-bookmarks] &, &[should-hide='true'] { %include zen-tabs/vertical-tabs-topbar.inc.css } diff --git a/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css b/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css index fede2685a..791d52044 100644 --- a/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css +++ b/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css @@ -3,6 +3,9 @@ * 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/. */ + +--zen-toolbar-height: 34px; + height: var(--zen-toolbar-height); z-index: 1; diff --git a/src/zen/tests/workspaces/browser_workspace_unload.js b/src/zen/tests/workspaces/browser_workspace_unload.js new file mode 100644 index 000000000..7f2c60f99 --- /dev/null +++ b/src/zen/tests/workspaces/browser_workspace_unload.js @@ -0,0 +1,113 @@ +/* Any copyright is dedicated to the Public Domain. + https://creativecommons.org/publicdomain/zero/1.0/ */ + +'use strict'; + +// verify that workspace unloading works +add_task(async function test_UnloadWorkspace_WithMultipleTabs() { + const workspaceId = await gZenWorkspaces.createAndSaveWorkspace('Test Workspace 1'); + const tabs = []; + for (let i = 0; i < 3; i++) { + const tab = await BrowserTestUtils.openNewForegroundTab( + window.gBrowser, + `data:text/html,Workspace Tab ${i}`, + true, + { skipAnimation: true } + ); + tab.setAttribute('zen-workspace-id', workspaceId); + 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.unloadWorkspace(); + + for (const tab of tabs) { + ok(tab.hasAttribute('pending'), 'Tab should be pending after unload'); + ok(!tab.linkedPanel, 'Tab should not have linked panel after unload'); + } + + await gZenWorkspaces.removeWorkspace(workspaceId); +}); + +// verify that essential tabs are not unloaded +add_task(async function test_UnloadWorkspace_WithEssentialTabs() { + const workspaceId = await gZenWorkspaces.createAndSaveWorkspace('Test Workspace 2'); + + const regularTab = await BrowserTestUtils.openNewForegroundTab( + window.gBrowser, + 'data:text/html,Hi! I am a Regular Tab', + true, + { skipAnimation: true } + ); + regularTab.setAttribute('zen-workspace-id', workspaceId); + + const essentialTab = await BrowserTestUtils.openNewForegroundTab( + window.gBrowser, + 'data:text/html,Hi! I am an Essential Tab', + true, + { skipAnimation: true } + ); + essentialTab.setAttribute('zen-workspace-id', workspaceId); + essentialTab.setAttribute('zen-essential', 'true'); + + await gZenWorkspaces.unloadWorkspace(); + + ok(regularTab.hasAttribute('pending'), 'Regular tab should be unloaded'); + ok(!regularTab.linkedPanel, 'Regular tab should not have linked panel'); + + ok(!essentialTab.hasAttribute('pending'), 'Essential tab should not be unloaded'); + ok(essentialTab.linkedPanel, 'Essential tab should still have linked panel'); + + await gZenWorkspaces.removeWorkspace(workspaceId); +}); + +// only tabs from the targeted workspace should be unloaded +add_task(async function test_UnloadWorkspace_TargetedWorkspaceIsolation() { + const inActiveWorkspaceId = await gZenWorkspaces.createAndSaveWorkspace( + 'Test In-Active Workspace' + ); + const activeWorkspaceId = await gZenWorkspaces.createAndSaveWorkspace('Test Active Workspace'); + + const inActiveWorkspaceTabs = []; + for (let i = 0; i < 2; i++) { + const tab = await BrowserTestUtils.openNewForegroundTab( + window.gBrowser, + `data:text/html,In-Active Workspace Tab ${i}`, + 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( + window.gBrowser, + `data:text/html,Active Workspace Tab ${i}`, + true, + { skipAnimation: true } + ); + tab.setAttribute('zen-workspace-id', activeWorkspaceId); + activeWorkspaceTabs.push(tab); + } + + await gZenWorkspaces.unloadWorkspace(); // this unloads the latest created workspace -> activeWorkspaceId + + for (const tab of activeWorkspaceTabs) { + ok(tab.hasAttribute('pending'), 'Active workspace tab should be pending after unload'); + ok(!tab.linkedPanel, 'Active workspace tab should not have linked panel after unload'); + } + + for (const tab of inActiveWorkspaceTabs) { + ok(!tab.hasAttribute('pending'), 'In-Active workspace tab should NOT be pending after unload'); + ok(tab.linkedPanel, 'In-Active workspace tab should still have linked panel after unload'); + } + + await gZenWorkspaces.removeWorkspace(inActiveWorkspaceId); + await gZenWorkspaces.removeWorkspace(activeWorkspaceId); +});