test: Fixed tests for welcome page and fixed QA issues, b=bug #10666, c=common, tabs, tests, welcome, workspaces

This commit is contained in:
Mr. M
2025-10-15 03:30:12 +02:00
parent c06de3372d
commit b1e860dea2
9 changed files with 60 additions and 21 deletions

View File

@@ -1470,9 +1470,15 @@
gradient
);
const isDarkModeWindow = browser.gZenThemePicker.isDarkMode;
const docElement = browser.document.documentElement;
if (isDefaultTheme) {
docElement.setAttribute('zen-default-theme', 'true');
} else {
docElement.removeAttribute('zen-default-theme');
}
if (dominantColor) {
const primaryColor = this.getAccentColorForUI(dominantColor);
browser.document.documentElement.style.setProperty('--zen-primary-color', primaryColor);
docElement.style.setProperty('--zen-primary-color', primaryColor);
// Should be set to `this.isLegacyVersion` but for some reason it is set to undefined if we open a private window,
// so instead get the pref value directly.
@@ -1483,10 +1489,10 @@
if (!isDefaultTheme && !this.isLegacyVersion) {
// Check for the primary color
isDarkMode = browser.gZenThemePicker.shouldBeDarkMode(dominantColor);
browser.document.documentElement.setAttribute('zen-should-be-dark-mode', isDarkMode);
docElement.setAttribute('zen-should-be-dark-mode', isDarkMode);
browser.gZenThemePicker.panel.removeAttribute('invalidate-controls');
} else {
browser.document.documentElement.removeAttribute('zen-should-be-dark-mode');
docElement.removeAttribute('zen-should-be-dark-mode');
if (!this.isLegacyVersion) {
browser.gZenThemePicker.panel.setAttribute('invalidate-controls', 'true');
}

View File

@@ -2181,6 +2181,13 @@ var gZenWorkspaces = new (class extends nsZenMultiWindowFeature {
return true; // Always show glance tabs
}
// See https://github.com/zen-browser/desktop/issues/10666, we should never
// show closing tabs and consider them as not part of any workspace. This will
// invalidate the `lastSelectedTab[previousWorkspaceId]` logic in `_handleTabSelection`
if (tab.closing) {
return false; // Never show closing tabs
}
// Handle essential tabs
if (isEssential) {
if (!this.containerSpecificEssentials) {