This commit adds the ability to move a workspace to the end of the workspace list by dragging it to a designated drop target.
The changes include:
- Creation of a new "last position drop target" element that allows dragging a workspace to the end.
- Event listeners for dragover, dragenter, dragleave, and drop events on the drop target element.
- Implementation of `moveWorkspaceToEnd` function to update the workspace positions in storage when a workspace is moved to the end.
- Reorder mode is exited if the panel is closed.
- Updates to the workspace list to include the last position drop target.
This commit introduces the ability to reorder workspaces in the workspace manager. This adds functionality to move workspaces up and down within the list, allowing users to customize the order in which they appear.
- Added new buttons for moving workspaces up and down.
- Implemented `moveWorkspaceUp` and `moveWorkspaceDown` methods in `ZenWorkspacesStorage` to handle workspace reordering.
- Updated `ZenWorkspaces` to handle the new reorder mode and button events.
- Modified the workspace list UI to display reorder buttons and indicate when reorder mode is active.
These changes provide users with more control over their workspace organization and improve the overall usability of the workspace manager.
This commit refactors the ZenSidebarManager and ZenWorkspaces classes. In ZenSidebarManager, the _createWebPanelBrowser method now includes the userContextId when creating a new browser. Additionally, a new method createContainerTabMenu is added to handle the creation of a context menu for container tabs. The contextChangeContainerTab method is also added to handle changing the userContextId for a container tab.
In ZenWorkspaces, the ownerWindow property is now set to the window object. The _contextMenuId property is now bound to the ZenWorkspaces instance. The onclick event handler is modified to use the ownerWindow property and the changeWorkspace method is now called on the ZenWorkspaces instance.
These changes improve the functionality and maintainability of the ZenSidebarManager and ZenWorkspaces classes.
This commit introduces a new preference, `zen.workspaces.force-container-workspace`, which allows users to automatically switch to the workspace associated with a specific tab's container.
This commit modifies the `getContextIdIfNeeded` method to automatically use the active workspace context ID for external calls.
Previously, external calls would use the provided `userContextId` if it was different from the active workspace context ID. Now, if `fromExternal` is true and there's an active workspace, the method will return the active workspace context ID, ensuring consistency with the active workspace.