mirror of
https://github.com/zen-browser/desktop.git
synced 2026-09-10 07:15:34 +00:00
gh-15260: Fix essentials appearing during workspace creation (gh-15307)
Co-authored-by: mr. m <mr.m@tuta.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user