Commit graph

473 commits

Author SHA1 Message Date
mauro-balades
cbeb9d7b68
Refactor ZenKeyboardShortcuts to add reset functionality for pinned tabs 2024-10-09 07:47:45 +02:00
mauro-balades
327380907e
Refactor ZenCommonUtils and ZenPinnedTabManager classes 2024-10-08 22:30:23 +02:00
mauro 🤙
6f9a076751
Merge pull request #43 from kristijanribaric/feature(pinned-tab-url-reset)-add-pinned-tab-url-resetting-functionality
Feature: Add pinned tab url resetting functionality
2024-10-08 21:54:14 +02:00
mauro-balades
ac2265315e
Refactor ZenKeyboardShortcuts to improve initialization and keyset handling 2024-10-08 21:23:18 +02:00
Kristijan Ribarić
4217882981 feat: Unified pinned tab close shortcut behavior
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.
2024-10-08 21:07:57 +02:00
mauro-balades
e9fb3b5c75
Refactor ZenKeyboardShortcuts to improve initialization and keyset handling 2024-10-08 20:38:18 +02:00
mauro-balades
bfb5e8fc94
Yet another attempt into fixing macos shortcuts 2024-10-08 20:31:31 +02:00
Kristijan Ribarić
e28f8e131e feat(pinned-tab-manager): Add shortcut options for closing, unloading, changing, and resetting pinned tabs 2024-10-08 17:46:35 +02:00
Kristijan Ribarić
b8938b444d feat(zen-sidebar): Add shortcut to reset pinned tabs
This commit adds a new keyboard shortcut to reset pinned tabs in the zen sidebar.

The new shortcut is grouped under "Other Zen Features" in the keybinding manager.
2024-10-08 14:58:19 +02:00
Kristijan Ribarić
2e37d6ce0b Updated zen pinned tab manager to use lazy prefs getter, added methods for setting Pinned Tab State and updating pinned tab for session restore 2024-10-08 14:14:43 +02:00
Kristijan Ribarić
dab9e1edcc fix(pinned-tabs): Always update pinned tab data with latest information
This commit ensures that pinned tab data is always updated with the latest information, and previous tab entries are cleaned up.
2024-10-07 22:56:37 +02:00
Kristijan Ribarić
89f6a07353 feat: Improve pinned tab management
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.
2024-10-07 21:02:01 +02:00
Kristijan Ribarić
1963de08e9 feat: Implement pinned tab manager
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.
2024-10-07 21:02:01 +02:00
mauro-balades
ccfbac35f3
Add ZenThemePicker class for generating gradient picker 2024-10-07 20:54:51 +02:00
mauro-balades
3ddb98ccb4
Added a cache remover for the zen themes 2024-10-07 18:27:59 +02:00
mauro-balades
5a2bf6477b
Might had fixed macos keyboard shortcuts 2024-10-07 18:09:30 +02:00
mauro 🤙
3676ca1418
Merge pull request #42 from BrhmDev/fix/rearrange-view-not-working-with-only-2-tabs
Fix rearrange view not working with only 2 tabs.
2024-10-06 19:03:08 +02:00
brahim
6b6c4c5bc8 Fix rearrange view not working with only 2 tabs. 2024-10-06 18:50:36 +02:00
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