gh-15260: Fix essentials appearing during workspace creation (gh-15307)

Co-authored-by: mr. m <mr.m@tuta.com>
This commit is contained in:
Brandon Quon
2026-09-08 23:34:59 -07:00
committed by GitHub
parent fdf9588b7b
commit 9551444c61
2 changed files with 38 additions and 2 deletions

View File

@@ -432,8 +432,9 @@ class nsZenWorkspaces {
// Set a hidden state if the essentials section is not supposed
// to be shown on the current workspace, else remove the hidden state
if (
this.containerSpecificEssentials &&
this.getActiveWorkspaceFromCache()?.containerTabId != container
this.activeWorkspace === this.creatingWorkspaceId ||
(this.containerSpecificEssentials &&
this.getActiveWorkspaceFromCache()?.containerTabId + 0 != container)
) {
essentialsContainer.setAttribute("hidden", "true");
} else {

View File

@@ -46,3 +46,38 @@ add_task(async function test_Check_Creation() {
await gZenWorkspaces.removeWorkspace(newWorkspaceUUID);
});
add_task(async function test_Essentials_Hidden_Workspace_Creation() {
const originalWorkspace = gZenWorkspaces.getActiveWorkspace();
const essentialTab = BrowserTestUtils.addTab(gBrowser, "about:blank", {
skipAnimation: true,
userContextId: 0,
});
gZenPinnedTabManager.addToEssentials(essentialTab);
const essentialsContainer = essentialTab.parentNode;
await gZenWorkspaces.createAndSaveWorkspace(
"Empty Container Workspace",
undefined,
false,
1
);
const emptyWorkspace = gZenWorkspaces.getActiveWorkspace();
// The temporary creation workspace uses container 0, which previously
// caused the container 0 Essentials to reappear over the form.
await gZenWorkspaces.openWorkspaceCreation();
const creationForm = document.querySelector("zen-workspace-creation");
ok(creationForm, "Workspace creation form is shown");
ok(
BrowserTestUtils.isHidden(essentialsContainer),
"Essentials remain hidden while creating a workspace"
);
await creationForm.onCancelButtonCommand();
await gZenWorkspaces.changeWorkspace(originalWorkspace);
await gZenWorkspaces.removeWorkspace(emptyWorkspace.uuid);
await BrowserTestUtils.removeTab(essentialTab);
});