Commit graph

535 commits

Author SHA1 Message Date
mauro 🤙
22fc3bf858
Merge pull request #46 from BrhmDev/fix/web-panel-docshell-becoming-inactive-when-using-splitivew
Fix web panel docShell becoming inactive when using splitview.
2024-10-10 12:30:42 +02:00
brahim
1077ce8705 Move web panel to tabbox wrapper when not pinned. 2024-10-10 11:46:24 +02:00
brahim
e9adb6606d Fix web panel docShell becoming inactive when using splitview. 2024-10-10 10:35:56 +02:00
mauro 🤙
f2921d75b4
Merge pull request #45 from kristijanribaric/fix(workspaces)-change-tab-to-different-workspace-fix
Fix(workspaces) performance optimizations
2024-10-09 20:06:50 +02:00
mauro-balades
5e657e93b3
Refactor ZenCompactMode to remove unused function _fixCrossedEdge and simplify _getCrossedEdge 2024-10-09 20:02:44 +02:00
mauro-balades
43ed740d69
Made compact mode float 2024-10-09 20:01:50 +02:00
Kristijan Ribarić
b296405a45 Fix: Use integer positions for workspaces
This commit changes the `position` column in the `workspaces` table to be an `INTEGER` instead of a `REAL` data type. This change is made to ensure that workspace positions are always whole numbers, which prevents issues with floating-point precision and ensures consistent ordering of workspaces.

Additionally, it updates the logic for calculating new workspace positions to use `Math.floor` to round down to the nearest integer, ensuring that positions are always integers.

This change also adjusts the `minGap` constant used in the `shouldReorderWorkspaces` function to `1`, which reflects the minimum allowed gap between workspace positions now that they are integers.
2024-10-09 19:49:45 +02:00
Kristijan Ribarić
8ca8157e61 feat: Improve workspace ordering and changes tracking
This commit introduces improvements to workspace ordering and change tracking in the Zen Workspaces system:

- **Workspace Ordering:**
    - Uses `REAL` data type for `position` in `zen_workspaces` table, allowing for more precise and efficient ordering.
    - Introduces a new `updateWorkspaceOrder` method to update workspace positions.
    - Reorders workspaces with large increments to avoid frequent reordering, ensuring consistent ordering after changes.
    - Implements a mechanism to check for necessary reordering after position updates and reorder all workspaces if required.
- **Changes Tracking:**
    - Tracks changes to workspaces by inserting a record in `zen_workspaces_changes` for each modified workspace.
    - Adds an index on `uuid` column in `zen_workspaces_changes` table for faster querying.
    - Updates `getLastChangeTimestamp` method to return the last change timestamp from the changes tracking table, providing accurate timestamp for changes.

These changes optimize workspace management, improve accuracy of ordering, and enhance the performance of change tracking.
2024-10-09 19:38:06 +02:00
Kristijan Ribarić
24d7af3da0 Fix: Ensure tab context works after moving a tab to different workspace.
Calling to _workspaces() always gets the fresh data from db, moved caching responsibility to db for getWorkspaces().
2024-10-09 18:14:09 +02:00
mauro-balades
2b163c397c
Refactor ZenKeyboardShortcuts to optimize clearing of main keyset 2024-10-09 17:07:00 +02:00
mauro 🤙
7b518c9243
Merge pull request #44 from BrhmDev/fix/wrong-resizing-after-removing-splitview-nodes
Fix weird resizing after removing tab from split.
2024-10-09 14:28:24 +02:00
brahim
fcb9af659a Fix node having same direction as parent after removing splitNode (invalid state) 2024-10-09 12:34:13 +02:00
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