This commit introduces pinned tab persistence across sessions and integrates it with workspaces.
- **Pinned Tab Storage:**
- Implements a database-based storage system for pinned tabs using PlacesUtils.
- Provides methods for saving, retrieving, deleting, and managing pinned tabs.
- Tracks changes to pinned tabs for efficient updates.
- **Workspace Integration:**
- Allows pinned tabs to be associated with specific workspaces.
- Synchronizes pinned tabs with the active workspace.
- Ensures that pinned tabs are not inadvertently moved between workspaces.
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.
This commit introduces a unified behavior for the pinned tab close shortcut, controlled by a single preference `zen.pinned-tab-manager.close-shortcut-behavior`.
The previous implementation relied on multiple separate preferences:
- `zen.pinned-tab-manager.reset-pinned-tab-on-close-shortcut`
- `zen.pinned-tab-manager.unload-pinned-tab-on-close-shortcut`
- `zen.pinned-tab-manager.change-pinned-tab-on-close-shortcut`
- `zen.pinned-tab-manager.close-pinned-tab-on-close-shortcut`
This new unified approach simplifies the configuration and offers more granular control over the desired behavior.
The new preference `zen.pinned-tab-manager.close-shortcut-behavior` accepts the following values:
- `close`: Closes the selected pinned tab.
- `reset`: Resets the selected pinned tab to its stored state.
- `unload`: Unloads the selected pinned tab.
- `switch`: Switches to the next unpinned tab.
- `reset-unload-switch`: Resets, unloads, and switches the selected pinned tab.
- `unload-switch`: Unloads and switches the selected pinned tab.
- `reset-switch`: Resets and switches the selected pinned tab.
This unified approach provides greater flexibility and simplifies the user experience.
This commit introduces several improvements to the pinned tab manager:
- **Adds icon support for pinned tabs**: Pinned tabs now store and restore their icon in addition to URL and title.
- **Adds "Replace with Current" context menu option**: A new option in the tab context menu allows replacing the URL of a pinned tab with the current page.
- **Refactors code for better readability**: Renames methods and variables for clarity, and improves code structure.
- **Fixes issues with resetting pinned tabs**: Ensures that pinned tabs are correctly reset when closed using the Ctrl+W shortcut or by using the "Reset Pinned Tab" context menu option.
- **Adds missing menu item**: Adds the missing menu item for resetting the pinned tab in the tab context menu.
These changes enhance the functionality and user experience of the pinned tab manager, making it more robust and user-friendly.
This commit introduces a new feature: a pinned tab manager.
- Adds `ZenPinnedTabsObserver` to listen for pinned/unpinned tab events.
- Implements `ZenPinnedTabManager` to handle the logic of managing pinned tabs:
- Stores pinned tab URLs and titles.
- Resets the pinned tab to its saved state when closed.
- Adds a new context menu option to manually reset a pinned tab.
- Implements a shortcut to close a pinned tab and optionally reset its state.
This feature enhances pinned tab functionality by providing a better user experience for managing and resetting them.