Commit graph

505 commits

Author SHA1 Message Date
mauro-balades
7d54599ba3
Added toast notification when enabling split view rearanging 2024-10-06 18:15:18 +02:00
mauro 🤙
8213592bb2
Merge pull request #41 from kristijanribaric/fix(workspaces-migration-sync)-make-sure-migrated-workspaces-are-synced
fix(workspaces): Migrate workspaces from JSON to the new storage after sync engine has been registered.
2024-10-06 17:08:59 +02:00
mauro 🤙
82e3309310
Update ZenWorkspaces.mjs 2024-10-06 17:08:41 +02:00
mauro 🤙
86f01d9343
Merge pull request #40 from BrhmDev/feature/rearrange-split-view
Fully customizable splitview using drag and drop
2024-10-06 15:21:14 +02:00
brahim
c8e3885110 Rename tabSwitchView to tabRearrangeView 2024-10-06 15:05:13 +02:00
brahim
e5502d1a9b Add pref for rearrange-edge-hover-size 2024-10-06 14:46:46 +02:00
brahim
c906ddca10 Fix docShell of selected tab being deactivated when unsplitting. 2024-10-06 14:39:52 +02:00
mauro-balades
2d62e7d9be
Tried to fix macos shortcuts 2024-10-06 14:03:17 +02:00
brahim
d6787fd2fd Only reset splitView if gridType was changed or no new tab was added. 2024-10-06 13:58:36 +02:00
brahim
fdf81f2fe9 Make it impossible to drop splitview tab on itself, lower opacity of tab being dragged. Fix splitters not being cleared after browser drop. 2024-10-06 13:38:28 +02:00
brahim
3c8006df0e Resize other splitNodes evenly when removing node 2024-10-06 13:30:33 +02:00
mauro-balades
e8eb4a41cf
Fix extension buttons remaining when switching to compact mode 2024-10-06 11:32:16 +02:00
Kristijan Ribarić
9abd2d9cc1 feat(workspaces): Migrate workspaces from JSON to the new storage after sync engine has been registered. 2024-10-06 08:35:53 +02:00
mauro-balades
775b5288fb
Fixed workspaces dialog 2024-10-05 23:25:26 +02:00
mauro 🤙
7ebaed73c0
Merge pull request #37 from kristijanribaric/feature(workspace-sync)-add-workspace-sync-engine
Feature Sync Workspaces to Services-Sync
2024-10-05 22:23:05 +02:00
Kristijan Ribarić
d3ac1895e5 feat(workspaces): Improve workspace change notification and handling
This commit improves the notification and handling of workspace changes by:

- **Introducing a dedicated observer notification system:** The `ZenWorkspacesStorage` now uses a private helper method (`_notifyWorkspacesChanged`) to notify observers with a list of changed workspace UUIDs. This provides a more efficient and flexible notification system.
- **Updating `ZenWorkspacesTracker` to parse UUIDs:** The `ZenWorkspacesTracker` now correctly parses the JSON stringified array of UUIDs received from the observer, allowing it to handle multiple workspace changes in a single notification.
- **Refactoring `saveWorkspace`, `removeWorkspace`, `setDefaultWorkspace`, and `updateWorkspaceOrder`:** These methods now consistently collect and notify observers about changed UUIDs.
- **Removing unnecessary code:** The previous approach of notifying observers individually for each change has been removed, leading to code simplification and reduced complexity.

This commit ensures that workspace changes are more reliably and efficiently tracked, leading to a smoother and more responsive workspace management experience.
2024-10-05 22:09:54 +02:00
Kristijan Ribarić
86578cb4d3 feat(workspace): Move observer notifications to workspaces storage 2024-10-05 21:16:07 +02:00
Kristijan Ribarić
863dcfa705 feat(workspaces): remove unused used field from workspaces
This commit removes the `used` field from the Workspaces database table and Zen Workspace objects.

The `used` field was originally intended to track whether a workspace was currently being used, but it turned out to be unnecessary. This change simplifies the data model and removes redundant information.
2024-10-05 20:16:20 +02:00
Kristijan Ribarić
b28ca11e57 fix(workspaces): Ensure ZenWorkspacesEngine is registered only once
This commit prevents multiple registrations of the `ZenWorkspacesEngine`.

Previously, the `ZenWorkspacesEngine` was registered unconditionally every time `ZenWorkspaces` was initialized. This could lead to issues if the engine was already registered.

This commit adds a check to ensure that the engine is only registered if it is not already present. This prevents multiple registrations and ensures that the engine is only initialized once.
2024-10-05 19:54:08 +02:00
Kristijan Ribarić
0d161326ef feat: Add workspace ordering and changes tracking
This commit introduces workspace ordering and a new mechanism for tracking changes to workspaces.

**Changes:**

- **Workspace Ordering:** Workspaces can now be ordered using a `position` field. This allows for user-defined ordering of workspaces, improving usability.
- **Changes Tracking:** A new `zen_workspaces_changes` table is added to track changes to workspaces. This allows for more efficient sync operations and improved error handling.

**Benefits:**

- **Improved Workspace Management:** Users can now customize the order of their workspaces.
- **More Efficient Sync:** Changes tracking enables faster and more accurate synchronization of workspaces across devices.
- **Enhanced Error Handling:** Changes tracking helps to identify and resolve conflicts during sync.

**Notes:**

- This change requires deleting the zen_workspaces table in places db
2024-10-05 19:20:19 +02:00
mauro-balades
9f32f780ca
Fixed internal keyboard shortcuts for macos 2024-10-05 18:42:24 +02:00
brahim
9186c24c79 Merge remote-tracking branch 'origin/main' into feature/rearrange-split-view 2024-10-05 17:54:08 +02:00
brahim
eca3ecd04c Fix splitview drag and drop wrong size 2024-10-05 15:55:13 +02:00
brahim
a5db255ab7 Add splitview drag and drop functionality 2024-10-05 15:24:34 +02:00
brahim
694cbc9d89 Refactor: remove redundant height AND widthInParent from splitNode, fix weird splitTabs behaviour 2024-10-05 14:10:13 +02:00
brahim
cde3c6a48b Animate splitview panels 2024-10-05 10:40:38 +02:00
brahim
6578992a11 Render dropZone when dragging. 2024-10-05 03:30:23 +02:00
brahim
54ce8ff5a7 Fix duplicate field declaration after merge 2024-10-05 00:34:47 +02:00
Kristijan Ribarić
1c7bc5c501 Fix: Remove unnecessary workspace close after saving
This commit removes a call to `this.closeWorkspacesSubView()` after saving a workspace.

The previous behavior caused an error to be thrown because main view was already closed.
2024-10-04 22:40:11 +02:00
Kristijan Ribarić
e366e624d1 Fix: Ensure only one workspace is marked as default
This commit ensures that only one workspace can be marked as default. Previously, multiple workspaces could be marked as default, leading to unexpected behavior.

The commit introduces a transaction to update all workspaces, setting `is_default` to `0` for all workspaces except the one being saved as default. This prevents multiple workspaces from being marked as default.
2024-10-04 22:40:09 +02:00
Kristijan Ribarić
f1f547fe69 fix(zen-workspaces): Correctly emit workspace update notification
The previous implementation of the workspace update notification was using `workspaceData.uuid`, which is incorrect. This commit fixes the issue by using `workspace.uuid` instead, ensuring the correct workspace identifier is sent to observers.
2024-10-04 22:37:35 +02:00
Kristijan Ribarić
4a54adea9a feat(workspaces): Refresh workspace strip after sync completion
This commit adds an observer for the `weave:engine:sync:finish` event and clears the workspace cache when the workspace sync is complete. This ensures that the workspace strip is updated with the latest data after a sync.
2024-10-04 22:37:35 +02:00
Kristijan Ribarić
187dece11c feat: Sync Workspaces to Services-Sync
This commit adds a new feature to synchronize workspaces to the Services-Sync framework.

- **ZenWorkspacesSync.mjs:** A new file that defines a custom engine for syncing workspaces.
- **ZenWorkspaces.mjs:** Modified to register the ZenWorkspacesEngine with the Service engine manager and to update its state using services-sync's notification system.

This feature enables users to sync their workspaces across devices and seamlessly switch between them using the services-sync mechanism.
2024-10-04 22:37:35 +02:00
mauro-balades
fc7f08c827
Prevent loading mutliple times the same feature 2024-10-04 19:18:57 +02:00
brahim
2ee7350abc Merge remote-tracking branch 'origin/main' into feature/rearrange-split-view
# Conflicts:
#	src/ZenViewSplitter.mjs
2024-10-04 18:44:55 +02:00
mauro-balades
83b672d981
Added pictureinpicture as a prevention from tab unloading 2024-10-04 18:38:11 +02:00
mauro-balades
0590f35751
Refactor: Rename ZenKeyboardShortcutsManager to gZenKeyboardShortcutsManager 2024-10-04 18:22:40 +02:00
mauro-balades
76d22a1f15
Made the code look cleaner 2024-10-04 18:21:39 +02:00
brahim
d046938e41 Fix split/unsplit logic 2024-10-04 17:20:49 +02:00
brahim
39b876f701 Fix splitview can't activate when tab unloaded, autoload tab when activating split. 2024-10-04 15:07:29 +02:00
brahim
894d856282 Fix split/unsplit logic 2024-10-04 14:39:23 +02:00
brahim
422adbb896 Fix split update logic, fix add tab to split 2024-10-04 10:40:23 +02:00
brahim
e349aee50c Fix splitview resizing. 2024-10-04 10:40:23 +02:00
brahim
5fb767ef72 splitView Tabremove fixes. 2024-10-04 10:40:23 +02:00
brahim
ae18457baa Add tabRemove functionality for reworked splitview. 2024-10-04 10:40:23 +02:00
brahim
5020e59f8e Fix splitview wrong size bug 2024-10-04 10:40:23 +02:00
brahim
28baa2f9d4 Reimplement splitview resize for treelayout splitview. 2024-10-04 10:40:23 +02:00
brahim
a102dd4c37 Insert splitters in right location for splitview. 2024-10-04 10:40:23 +02:00
brahim
d853a8d08d Fixes for splitview with layoutTree, working gridmode 2024-10-04 10:40:23 +02:00
brahim
966ada7f0d Use layoutTree to construct splitview. No longer make use of a grid. 2024-10-04 10:40:23 +02:00