Skip to content

Commit ce75bc1

Browse files
committed
feat: Improved workspace creation animations, b=no-bug, c=workspaces
1 parent 289e84b commit ce75bc1

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

src/zen/workspaces/ZenWorkspaceCreation.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@
8686
return;
8787
}
8888

89-
document.documentElement.setAttribute('zen-creating-workspace', 'true');
90-
9189
this.appendChild(this.constructor.fragment);
9290
this.initializeAttributeInheritance();
9391

@@ -177,6 +175,7 @@
177175
{
178176
y: [20, 0],
179177
opacity: [0, 1],
178+
filter: ['blur(2px)', 'blur(0)'],
180179
},
181180
{
182181
duration: 0.6,
@@ -197,16 +196,16 @@
197196
workspace.containerTabId = this.currentProfile;
198197
await gZenWorkspaces.saveWorkspace(workspace);
199198

199+
if (gZenVerticalTabsManager._canReplaceNewTab) {
200+
BrowserCommands.openTab();
201+
}
202+
200203
await this.#cleanup();
201204

202205
await gZenWorkspaces._organizeWorkspaceStripLocations(workspace, true);
203206
await gZenWorkspaces.updateTabsContainers();
204207

205208
gBrowser.tabContainer._invalidateCachedTabs();
206-
207-
if (gZenVerticalTabsManager._canReplaceNewTab) {
208-
BrowserCommands.openTab();
209-
}
210209
}
211210

212211
async onCancelButtonCommand() {
@@ -270,6 +269,7 @@
270269
{
271270
y: [0, 20],
272271
opacity: [1, 0],
272+
filter: ['blur(0)', 'blur(2px)'],
273273
},
274274
{
275275
duration: 0.4,

src/zen/workspaces/ZenWorkspaces.mjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,9 +1296,10 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
12961296
await this._propagateWorkspaceData();
12971297
}
12981298

1299-
async openWorkspaceCreation(event) {
1299+
async openWorkspaceCreation() {
13001300
let createForm;
13011301
const previousWorkspace = await this.getActiveWorkspace();
1302+
document.documentElement.setAttribute('zen-creating-workspace', 'true');
13021303
await this.createAndSaveWorkspace('Space', undefined, false, 0, {
13031304
beforeChangeCallback: async (workspace) => {
13041305
createForm = document.createXULElement('zen-workspace-creation');
@@ -2180,7 +2181,11 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
21802181
}
21812182

21822183
async onPinnedTabsResize(entries, forAnimation = false, animateContainer = false) {
2183-
if (!this._hasInitializedTabsStrip || (this._organizingWorkspaceStrip && !forAnimation)) {
2184+
if (
2185+
!this._hasInitializedTabsStrip ||
2186+
(this._organizingWorkspaceStrip && !forAnimation) ||
2187+
document.documentElement.hasAttribute('zen-creating-workspace')
2188+
) {
21842189
return;
21852190
}
21862191
if (document.documentElement.hasAttribute('customizing')) return;

src/zen/workspaces/create-workspace-form.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ zen-workspace-creation {
3232
flex-direction: column;
3333
width: calc(100% - 10px);
3434
margin: auto;
35-
gap: 2.2rem;
36-
margin-top: 2.2rem;
35+
gap: 3.2rem;
36+
margin-top: 1.2rem;
3737
height: 100%;
3838

3939
& .zen-workspace-creation-form {

src/zen/workspaces/zen-workspaces.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
opacity: 1;
6363
}
6464

65-
&:hover {
65+
&:hover,
66+
&[dragged='true']{
6667
background-color: var(--zen-toolbar-element-bg);
6768
}
6869

@@ -90,7 +91,7 @@
9091
%include overflow-icons.inc.css
9192
}
9293

93-
&:has(toolbarbutton:hover) toolbarbutton[active='true'] {
94+
&:has(toolbarbutton:hover) toolbarbutton[active='true']:not([dragged='true']) {
9495
%include overflow-icons.inc.css
9596
}
9697
}

0 commit comments

Comments
 (0)