This commit updates the workspace sync logic to notify the theme picker when the active workspace changes.
This ensures that the theme picker can update its state and display the correct theme for the current workspace.
This commit adds support for syncing workspace themes across devices.
The following changes were made:
- Added theme properties to the Zen workspace schema:
- `theme_type` (string): Type of theme (e.g., "gradient", "solid").
- `theme_colors` (JSON string): Array of gradient colors.
- `theme_opacity` (number): Opacity of the theme.
- `theme_rotation` (number): Rotation of the theme.
- `theme_texture` (number): Texture of the theme.
- Updated the `ZenWorkspacesSync` class to handle theme data.
- Added validation for theme properties.
- Updated the `ZenWorkspacesStorage` class to save and load workspace themes.
- Bumped the `ZenWorkspacesEngine` version to 2.
This commit adds the ability to store theme information for workspaces.
- Added `theme_type`, `theme_colors`, `theme_opacity`, `theme_rotation`, and `theme_texture` columns to the `zen_workspaces` table.
- Updated `saveWorkspace` to store the theme information when saving a workspace.
- Removed the unused `zen_workspace_themes` table.
This change allows users to save and restore the theme of their workspaces.
The `getWorkspaceTheme()` method has been removed because it is no longer necessary. The theme information is now retrieved directly from the workspace data in `getWorkspaces()`. This change simplifies the code and improves efficiency.
This commit introduces several improvements related to workspace themes:
- **Theme Persistence:** Workspaces now persist their themes in zen_workspaces table alongside other workspace data.
- **Theme Propagation:** The `_propagateWorkspaceData` function now includes an option to clear the workspace cache, preventing stale data from being used when propagating workspace data.
- **Theme Handling:** The `onWorkspaceChange` function now uses the theme from the workspace object or a passed theme, simplifying theme handling.
- **Theme Data Structure:** The `zen_workspaces` table has been updated to store theme data directly, eliminating the need for a separate `zen_workspace_themes` table.
- **Database Schema Changes:** This commit introduces new columns to the `zen_workspaces` table to store theme information, making the database schema more efficient and less redundant.
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.