mirror of
https://github.com/zen-browser/desktop.git
synced 2026-03-29 20:01:52 +00:00
chore: Drag and drop refactor, p=#11723
* feat: Full cross-window workspace syncing, b=no-bug, c=workspaces * feat: Also change icons and labels if the tab is pending, b=no-bug, c=tabs, workspaces * feat: Dont session duplicate the tabs, b=no-bug, c=workspaces * feat: Properly handle tab moves, b=no-bug, c=workspaces * feat: Start on new session restore, b=no-bug, c=no-component * Discard changes to prefs/browser.yaml * feat: Start doing out own session restore, b=no-bug, c=folders, tabs * feat: Stop using pinned manager and use zen session sidebar, b=no-bug, c=common, folders, tabs, workspaces * feat: Dont restore windows that are already initialized, b=no-bug, c=no-component * chore: Update patches to ff 145, b=no-bug, c=no-component * Discard changes to src/browser/components/sessionstore/SessionStore-sys-mjs.patch * Discard changes to src/browser/components/tabbrowser/content/tab-js.patch * Discard changes to src/browser/components/tabbrowser/content/tabbrowser-js.patch * Discard changes to src/zen/tabs/ZenPinnedTabsStorage.mjs * feat: Run session saver before opening a new winodw, b=no-bug, c=tabs * feat: Clone the previous state, b=no-bug, c=no-component * feat: Move window sync to its own JS module, b=no-bug, c=workspaces * feat: Run session saver before opening a new window, b=no-bug, c=no-component * feat: Full cross-window workspace syncing, b=no-bug, c=workspaces * feat: Also change icons and labels if the tab is pending, b=no-bug, c=tabs, workspaces * feat: Dont session duplicate the tabs, b=no-bug, c=workspaces * feat: Start on new session restore, b=no-bug, c=no-component * feat: Properly handle tab moves, b=no-bug, c=workspaces * Discard changes to prefs/browser.yaml * feat: Start doing out own session restore, b=no-bug, c=folders, tabs * feat: Stop using pinned manager and use zen session sidebar, b=no-bug, c=common, folders, tabs, workspaces * feat: Dont restore windows that are already initialized, b=no-bug, c=no-component * chore: Update patches to ff 145, b=no-bug, c=no-component * Discard changes to src/browser/components/sessionstore/SessionStore-sys-mjs.patch * Discard changes to src/browser/components/tabbrowser/content/tab-js.patch * Discard changes to src/browser/components/tabbrowser/content/tabbrowser-js.patch * Discard changes to src/zen/tabs/ZenPinnedTabsStorage.mjs * feat: Run session saver before opening a new winodw, b=no-bug, c=tabs * feat: Clone the previous state, b=no-bug, c=no-component * feat: Move window sync to its own JS module, b=no-bug, c=workspaces * feat: Run session saver before opening a new window, b=no-bug, c=no-component * feat: Start making use of IDs instead of sync identifiers, b=no-bug, c=folders * feat: Listen to new tab opens for new sync system, b=no-bug, c=common, folders, tabs * feat: Listen for more tab events and properly sync them, b=no-bug, c=common, folders, tabs * feat: Start moving browser views to the selected windows, b=no-bug, c=no-component * chore: Remove extra patch, b=no-bug, c=no-component * feat: Leave a screenshot of the page behind when switching windows or tabs, b=no-bug, c=common * feat: Run session saves right before writing and quiting, b=no-bug, c=common * fix: Fixed going back to a different window not allowing to type on inputs, b=no-bug, c=no-component * feat: Start syncing folders as well, b=no-bug, c=folders * Discard changes to src/browser/components/tabbrowser/content/tab-js.patch * chore: Update patches to ff 146, b=no-bug, c=no-component * feat: Early support for unsynced windoiws, b=no-bug, c=workspaces * fix: Move back active views when closing a window, b=no-bug, c=no-component * feat: Stop rendering sub-layers when swaping browsers, b=no-bug, c=common * feat: Improved support for unsynced windows support, b=no-bug, c=workspaces, folders * feat: Implemented 'Move To...' Button for unsynced windows, b=no-bug, c=workspaces, common * feat: Make sure to properly flush all windows when making a new one and fix removing progress listeners, b=no-bug, c=workspaces * feat: Make sure to not lose any tabs when opening from a private window, b=no-bug, c=workspaces * feat: Allow unload to run instantly and fix closing windows on mac, b=no-bug, c=no-component * feat: Make sure to always initialize an empty state with the sidebar object, b=no-bug, c=workspaces * chore: Small fixes and QA checks, b=no-bug, c=tabs, workspaces * fix: Fixed tab labels not changing on unfocused windows, b=no-bug, c=no-component * feat: Fixed closing windows on macos not returning to the original views, b=no-bug, c=no-component * chore: Turn off debug flags by default, b=no-bug, c=no-component * feat: Start implementing old pinned tab behaviour we used to have, b=no-bug, c=common, tabs * feat: Unsynced windows should always be allowed to change labels, b=no-bug, c=welcome * feat: Make sure we wait long enough before we initialize workspaces, b=no-bug, c=workspaces * feat: Dont mix remoteness when changing browser views and restore window spaces, b=no-bug, c=common, folders, workspaces * test: Fixed tests for the pinned tabs manager, b=no-bug, c=tabs, folders, tests, welcome * feat: Added partial support for split views, b=no-bug, c=split-view * chore: Finished basic support for split views, b=no-bug, c=folders, split-view * feat: Always make sure to save the last closed window to the sidebar object, b=no-bug, c=no-component * feat: Implement workspace sync store into the session file, b=closes #10857, c=common, tabs, tests, workspaces * feat: New drag and drop system, b=no-bug, c=tabs, common, folders * feat: Add support for drag-and-dropping tabs into groups, b=no-bug, c=common, folders, tabs, workspaces * feat: Add a default value for the workspace cache, b=no-bug, c=workspaces * fix: Default assign an array instead of an object to the workspaces cache, b=no-bug, c=workspaces * feat: Take into consideration win data may not have allocated spaces, b=no-bug, c=workspaces * feat: Always make sure we are assigning the correct space ID, b=no-bug, c=workspaces * feat: Make sure to initialize windows even if there are no tabs, b=no-bug, c=no-component * feat: Improved drag and drop simulation, b=no-bug, c=common, tabs * feat: Implement opacity changes to the drag image, b=no-bug, c=tabs, common, split-view * feat: Support for drag and dropping outside the window, b=no-bug, c=split-view * feat: Added transitions when reordering, b=no-bug, c=split-view, tabs * feat: Started working on drag and dropping to essentials, b=no-bug, c=no-component * Discard changes to locales/en-US/browser/browser/zen-workspaces.ftl * Discard changes to prefs/zen/view.yaml * Discard changes to prefs/zen/zen.yaml * Discard changes to src/browser/base/content/zen-assets.inc.xhtml * Discard changes to src/browser/base/content/zen-assets.jar.inc.mn * Discard changes to src/browser/base/content/zen-panels/popups.inc * Discard changes to src/browser/base/content/zen-preloaded.inc.xhtml * Discard changes to src/browser/components/places/content/editBookmark-js.patch * Discard changes to src/browser/components/sessionstore/SessionStore-sys-mjs.patch * Discard changes to src/browser/components/sessionstore/TabState-sys-mjs.patch * Discard changes to src/browser/components/tabbrowser/content/tab-js.patch * Discard changes to src/browser/components/urlbar/UrlbarProviderPlaces-sys-mjs.patch * Discard changes to src/zen/ZenComponents.manifest * Discard changes to src/browser/components/tabbrowser/content/tabbrowser-js.patch * feat: Finish migration, b=no-bug, c=no-component * feat: Add support for multi tabs dragging, b=no-bug, c=tabs * feat: Added support for essential tabs, b=no-bug, c=split-view, tabs, workspaces * feat: Added support to switch space when holding on the side of the sidebar, b=no-bug, c=common, split-view, workspaces * Discard changes to src/browser/components/tabbrowser/content/tabbrowser-js.patch * chore: Fixed merge conflicts, b=no-bug, c=no-component * feat: Added support for split views, b=no-bug, c=split-view --------- Signed-off-by: mr. m <91018726+mr-cheffy@users.noreply.github.com>
This commit is contained in:
@@ -1568,11 +1568,7 @@ class nsZenWorkspaces {
|
||||
}
|
||||
|
||||
async changeWorkspace(workspace, ...args) {
|
||||
if (
|
||||
!this.workspaceEnabled ||
|
||||
this.#inChangingWorkspace ||
|
||||
gNavToolbox.hasAttribute('movingtab')
|
||||
) {
|
||||
if (!this.workspaceEnabled || this.#inChangingWorkspace) {
|
||||
return;
|
||||
}
|
||||
this.#inChangingWorkspace = true;
|
||||
@@ -2433,7 +2429,7 @@ class nsZenWorkspaces {
|
||||
return workspaceData;
|
||||
}
|
||||
|
||||
async updateTabsContainers(target = undefined, forAnimation = false) {
|
||||
updateTabsContainers(target = undefined, forAnimation = false) {
|
||||
this.makeSureEmptyTabIsFirst();
|
||||
if (target && !target.target?.parentNode) {
|
||||
target = null;
|
||||
@@ -2443,7 +2439,7 @@ class nsZenWorkspaces {
|
||||
if (target?.type === 'TabClose' || target?.type === 'TabOpen') {
|
||||
animateContainer = target.target.pinned;
|
||||
}
|
||||
await this.onPinnedTabsResize(
|
||||
this.onPinnedTabsResize(
|
||||
// This is what happens when we join a resize observer, an event listener
|
||||
// while using it as a method.
|
||||
[{ target: (target?.target ? target.target : target) ?? this.pinnedTabsContainer }],
|
||||
@@ -2491,7 +2487,7 @@ class nsZenWorkspaces {
|
||||
}
|
||||
}
|
||||
|
||||
async onPinnedTabsResize(entries, forAnimation = false, animateContainer = false) {
|
||||
onPinnedTabsResize(entries, forAnimation = false, animateContainer = false) {
|
||||
if (
|
||||
document.documentElement.hasAttribute('inDOMFullscreen') ||
|
||||
!this._hasInitializedTabsStrip ||
|
||||
@@ -2515,9 +2511,7 @@ class nsZenWorkspaces {
|
||||
// Get all workspaces that have the same userContextId
|
||||
const activeWorkspace = this.getActiveWorkspace();
|
||||
const userContextId = activeWorkspace.containerTabId;
|
||||
const workspaces = this._workspaceCache.filter(
|
||||
(w) => w.containerTabId === userContextId && w.uuid !== originalWorkspaceId
|
||||
);
|
||||
const workspaces = this.getWorkspaces().filter((w) => w.containerTabId === userContextId);
|
||||
workspacesIds.push(...workspaces.map((w) => w.uuid));
|
||||
} else {
|
||||
workspacesIds.push(originalWorkspaceId);
|
||||
@@ -2690,7 +2684,7 @@ class nsZenWorkspaces {
|
||||
return tab;
|
||||
}
|
||||
|
||||
async changeWorkspaceShortcut(offset = 1, whileScrolling = false) {
|
||||
async changeWorkspaceShortcut(offset = 1, whileScrolling = false, disableWrap = false) {
|
||||
// Cycle through workspaces
|
||||
let workspaces = this.getWorkspaces();
|
||||
let activeWorkspace = this.getActiveWorkspace();
|
||||
@@ -2698,7 +2692,7 @@ class nsZenWorkspaces {
|
||||
|
||||
// note: offset can be negative
|
||||
let targetIndex = workspaceIndex + offset;
|
||||
if (this.shouldWrapAroundNavigation) {
|
||||
if (this.shouldWrapAroundNavigation && !disableWrap) {
|
||||
// Add length to handle negative indices and loop
|
||||
targetIndex = (targetIndex + workspaces.length) % workspaces.length;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user