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.
This commit updates the pinned tab entries to include the triggering principal.
Previously, the pinned tab entries only included the URL and title of the tab. This caused issues when restoring pinned tabs, as the triggering principal was not being saved.
This commit adds the triggering principal to the pinned tab entries, ensuring that they can be restored correctly.
This fixes the issue where pinned tabs were not being restored correctly.
This commit updates the pinned tab manager to store all relevant data (URL, title, triggering principal, and icon) in a single JSON string attribute (`zen-pinned-entry`).
This simplifies the code by eliminating the need for multiple individual attributes and provides a more robust and organized approach to storing the pinned tab's state.
The following changes were made:
- Removed redundant attributes (`zen-pinned-url`, `zen-pinned-title`, `zen-pinned-triggering-principal`)
- Updated the pinned tab data structure to store all information in a single `zen-pinned-entry` attribute
- Adjusted the `resetPinnedTabData` function to handle the new data structure
- Modified the pinned tab context menu to reflect the changes in the attribute handling
This change provides a more efficient and streamlined way to manage pinned tab data, enhancing the overall maintainability and clarity of the codebase.
This commit adds the ability to store the triggering principal for pinned tabs in the session store. This allows us to correctly restore pinned tabs when a user has multiple profiles open, as the triggering principal will be used to determine which profile the pinned tab belongs to.
The following changes were made:
- Added a new attribute, "zen-pinned-triggering-principal", to pinned tabs to store the triggering principal.
- Updated the session store to store and restore the triggering principal for pinned tabs.
- Updated the `ZenPinnedTabManager` to set and get the triggering principal for pinned tabs.
This change is necessary to ensure that pinned tabs are correctly restored when reset to pinned URL.
This commit fixes an issue where weird stuff would happen if pinned tab didn't have a base url to reset to. If there is no base url, reset tab functionality won't work and it won't be visible in context menu until you click replace pinned url with current or unpin and repin the tab.