diff --git a/locales/en-US/browser/browser/zen-general.ftl b/locales/en-US/browser/browser/zen-general.ftl index 57e1a06a7..4e6f6a259 100644 --- a/locales/en-US/browser/browser/zen-general.ftl +++ b/locales/en-US/browser/browser/zen-general.ftl @@ -132,3 +132,12 @@ zen-sidebar-notification-updated-tooltip = zen-sidebar-notification-restart-safe-mode-label = Something broke? zen-sidebar-notification-restart-safe-mode-tooltip = .title = Restart in Safe Mode + +# Section: Dialog contents + +# notification for when window sync has been enabled and +# users might want to know about it +zen-window-sync-migration-dialog-title = Keep Your Windows in Sync +zen-window-sync-migration-dialog-message = Zen now syncs windows on the same device, so changes in one window are reflected across the others instantly. +zen-window-sync-migration-dialog-learn-more = Learn More +zen-window-sync-migration-dialog-accept = Got It diff --git a/src/zen/common/sys/ZenUIMigration.sys.mjs b/src/zen/common/sys/ZenUIMigration.sys.mjs index bc1c85ad7..1c6cac68e 100644 --- a/src/zen/common/sys/ZenUIMigration.sys.mjs +++ b/src/zen/common/sys/ZenUIMigration.sys.mjs @@ -4,9 +4,15 @@ import { AppConstants } from "resource://gre/modules/AppConstants.sys.mjs"; +const lazy = {}; + +ChromeUtils.defineESModuleGetters(lazy, { + SessionStore: "resource:///modules/sessionstore/SessionStore.sys.mjs", +}); + class nsZenUIMigration { PREF_NAME = "zen.ui.migration.version"; - MIGRATION_VERSION = 5; + MIGRATION_VERSION = 6; init(isNewProfile) { if (!isNewProfile) { @@ -89,6 +95,38 @@ class nsZenUIMigration { _migrateV5() { Services.prefs.setBoolPref("zen.site-data-panel.show-callout", true); } + + _migrateV6() { + lazy.SessionStore.promiseAllWindowsRestored.then(() => { + const win = Services.wm.getMostRecentWindow("navigator:browser"); + win.setTimeout(async () => { + const [title, message, learnMore, accept] = await win.document.l10n.formatMessages([ + "zen-window-sync-migration-dialog-title", + "zen-window-sync-migration-dialog-message", + "zen-window-sync-migration-dialog-learn-more", + "zen-window-sync-migration-dialog-accept", + ]); + + // buttonPressed will be 0 for cancel, 1 for "more info" + let buttonPressed = Services.prompt.confirmEx( + win, + title.value, + message.value, + Services.prompt.BUTTON_POS_0 * Services.prompt.BUTTON_TITLE_IS_STRING + + Services.prompt.BUTTON_POS_1 * Services.prompt.BUTTON_TITLE_IS_STRING, + learnMore.value, + accept.value, + null, + null, + {} + ); + // User has clicked on "Learn More" + if (buttonPressed === 0) { + win.openTrustedLinkIn("https://docs.zen-browser.app/user-manual/window-sync", "tab"); + } + }, 1000); + }); + } } export var gZenUIMigration = new nsZenUIMigration(); diff --git a/src/zen/drag-and-drop/ZenDragAndDrop.js b/src/zen/drag-and-drop/ZenDragAndDrop.js index 1738e83c0..c136cce67 100644 --- a/src/zen/drag-and-drop/ZenDragAndDrop.js +++ b/src/zen/drag-and-drop/ZenDragAndDrop.js @@ -1243,6 +1243,9 @@ #makeDragImageEssential(event) { const dt = event.dataTransfer; const draggedTab = event.dataTransfer.mozGetDataAt(TAB_DROP_TYPE, 0); + if (draggedTab.hasAttribute("zen-essential")) { + return; + } const dragData = draggedTab._dragData; const [wrapper] = this.originalDragImageArgs; const tab = wrapper.firstElementChild;