This commit removes the unnecessary dependency on the `SessionStore` in the `ZenPinnedTabManager`.
The `SessionStore.promiseInitialized` was being awaited before refreshing pinned tabs, but this was not necessary. The pinned tab storage is initialized independently and does not rely on the session store.
This change improves the efficiency of the code and reduces the number of dependencies.
This commit refactors the `ZenPinnedTabManager` class to separate the initialization of pinned tabs from the handling of pinned tab events.
- **Initialization:** The `initTabs()` method is now responsible for initializing the pinned tab storage, waiting for the session store to be initialized, and then refreshing the pinned tabs.
- **Event handling:** The `init()` method focuses on setting up the event listeners and observers for pinned tabs.
This separation improves the code structure and allows for better handling of pinned tab initialization, which was previously problematic due to the asynchronous nature of the process.
Additionally, this commit includes minor fixes and improvements:
- Removed the `TabClose` event handler, as it is currently causing issues with the tab deletion process.
- Added a check to prevent duplicate pinned tab attributes.
- Improved the way favicons are set for pinned tabs.
This commit adds the Zen Essentials Toolbar to the application. The toolbar is initialized in the `ZenEssentialsToolbar` class constructor by calling the `_initInitialLayout` method. The toolbar is inserted before the `vertical-pinned-tabs-container` element and consists of a scrollable container (`EssentialsToolbarItems`) for toolbar items. The toolbar also includes event listeners for mouse events and commands.
The commit also includes a code change in the `ZenSidebarManager` class where the `toggleEssentialsAccordion` method has been removed. This method was responsible for expanding and collapsing the `EssentialsToolbarItems` content based on the state of the header element.
These changes enhance the application by adding the Zen Essentials Toolbar and removing the unnecessary `toggleEssentialsAccordion` method.
This commit introduces a new "Zen Essentials" toolbar to the sidebar, providing quick access to frequently used features.
- The toolbar is based on the `PlacesViewBase` class and uses the `PlacesUtils` API to manage bookmarks.
- It includes a dedicated folder for Zen Essentials bookmarks, ensuring they're organized and easily accessible.
- The toolbar's visibility can be controlled by the `zen.essentials.enabled` preference.
- The toolbar supports drag-and-drop functionality for organizing bookmarks.
- The toolbar items are hidden if they are in another workspace.
- The toolbar supports hover interactions, highlighting the active bookmark on mouseover.
- The toolbar items can be opened in a glance by pressing `Ctrl`, `Alt`, `Shift`, or `Meta` depending on the user's preference.
- The bookmark toolbar automatically updates if the workspace changes.
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.