Skip to content

Commit bf6e493

Browse files
committed
feat: Add comfirmation before deleting a workspace, b=no-bug, c=common, workspaces
1 parent 75a3b82 commit bf6e493

File tree

8 files changed

+29
-9
lines changed

8 files changed

+29
-9
lines changed

l10n

Submodule l10n updated 41 files

src/browser/base/content/browser-js.patch

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
2-
index 6d664917a5a3bb1cea8a747e42e8bc0065ec999e..5059293ebfa29d646455b7a3505bd6eae408ba64 100644
2+
index 6d664917a5a3bb1cea8a747e42e8bc0065ec999e..dfacd5c40ef14319fe7398452c007f167003a583 100644
33
--- a/browser/base/content/browser.js
44
+++ b/browser/base/content/browser.js
55
@@ -33,6 +33,7 @@ ChromeUtils.defineESModuleGetters(this, {
@@ -39,3 +39,13 @@ index 6d664917a5a3bb1cea8a747e42e8bc0065ec999e..5059293ebfa29d646455b7a3505bd6ea
3939
}
4040

4141
return true;
42+
@@ -5717,6 +5722,9 @@ var ConfirmationHint = {
43+
MozXULElement.insertFTLIfNeeded("toolkit/branding/brandings.ftl");
44+
MozXULElement.insertFTLIfNeeded("browser/confirmationHints.ftl");
45+
document.l10n.setAttributes(this._message, messageId, options.l10nArgs);
46+
+ if (window.gZenUIManager?.showToast) {
47+
+ return window.gZenUIManager.showToast(messageId, options);
48+
+ }
49+
if (options.descriptionId) {
50+
document.l10n.setAttributes(this._description, options.descriptionId);
51+
this._description.hidden = false;

src/zen/common/ZenCustomizableUI.sys.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ export var ZenCustomizableUI = new (class {
107107
_initCreateNewButton(window) {
108108
const button = window.document.getElementById('zen-create-new-button');
109109
button.addEventListener('command', () => {
110-
if (button.hasAttribute('open')) {
110+
if (button.hasAttribute('zen-ignore-open')) {
111111
return;
112112
}
113113
const image = button.querySelector('image');
114114
const popup = window.document.getElementById('zenCreateNewPopup');
115-
button.setAttribute('open', 'true');
115+
button.setAttribute('zen-ignore-open', 'true');
116116
const handlePopupHidden = () => {
117-
button.removeAttribute('open');
117+
button.removeAttribute('zen-ignore-open');
118118
window.gZenUIManager.motion.animate(
119119
image,
120120
{ transform: ['rotate(45deg)', 'rotate(0deg)'] },

src/zen/common/ZenUIManager.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ var gZenUIManager = {
455455
const wrapper = document.createXULElement('hbox');
456456
const element = document.createXULElement('vbox');
457457
const label = document.createXULElement('label');
458-
document.l10n.setAttributes(label, messageId, options);
458+
document.l10n.setAttributes(label, messageId, options.l10nArgs);
459459
element.appendChild(label);
460460
if (options.descriptionId) {
461461
const description = document.createXULElement('label');

src/zen/common/styles/zen-popup.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,3 +418,7 @@ menuseparator {
418418
padding: 0 !important;
419419
min-width: unset !important;
420420
}
421+
422+
#window-modal-dialog {
423+
inset: 0;
424+
}

src/zen/common/zen-sets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ document.addEventListener(
103103
break;
104104
case 'cmd_zenReorderWorkspaces':
105105
gZenUIManager.showToast('zen-workspaces-how-to-reorder-title', {
106-
timeout: 10000,
106+
timeout: 9000,
107107
descriptionId: 'zen-workspaces-how-to-reorder-desc',
108108
});
109109
break;

src/zen/workspaces/ZenWorkspaceCreation.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
document.getElementById('nav-bar').style.visibility = 'collapse';
171171
}
172172
this.style.visibility = 'visible';
173+
this.resolveInitialized();
173174
gZenUIManager.motion
174175
.animate(
175176
this.elementsToAnimate,
@@ -188,7 +189,6 @@
188189
.then(() => {
189190
this.inputName.focus();
190191
gZenWorkspaces.workspaceElement(this.workspaceId).hidden = false;
191-
this.resolveInitialized();
192192
});
193193
});
194194
}

src/zen/workspaces/ZenWorkspaces.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2338,7 +2338,13 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
23382338
}
23392339

23402340
async contextDeleteWorkspace() {
2341-
await this.removeWorkspace(this.activeWorkspace);
2341+
const [title, body] = await document.l10n.formatValues([
2342+
{ id: 'zen-workspaces-delete-workspace-title' },
2343+
{ id: 'zen-workspaces-delete-workspace-body' },
2344+
]);
2345+
if (Services.prompt.confirm(null, title, body)) {
2346+
await this.removeWorkspace(this.activeWorkspace);
2347+
}
23422348
}
23432349

23442350
findTabToBlur(tab) {

0 commit comments

Comments
 (0)