Commit graph

91 commits

Author SHA1 Message Date
mr. M
61190233fc
Enhance tab management by updating tab close handling and improving tab drag-and-drop functionality 2025-02-02 14:25:05 +01:00
mr. M
4975ff6fdc
Add Linux-specific padding for toolbox and clean up drag indicator calculations 2025-01-31 23:54:26 +01:00
mr. M
7b41eb753d
Refactor tab drag-and-drop functionality and enhance drag indicator styling 2025-01-31 23:02:13 +01:00
Kristijan Ribarić
384e268516 Fixes after rebase 2025-01-31 20:11:48 +01:00
Kristijan Ribarić
d3a04d043b Enhance Zen Tab Reordering: Add drag-and-drop between tab containers (normal tabs, pinned and essentials)
This commit enhances the drag-and-drop functionality in Zen, allowing users to seamlessly reorder tabs between the pinned tabs, essential tabs, and regular tab containers.  The changes include:

- Added `moveToAnotherTabContainerIfNecessary` and `applyDragoverClass` methods to `ZenPinnedTabManager` to handle tab movement and visual feedback during drag-and-drop.
- Updated `tabs.js` to integrate with the new methods, correctly handling tab pinning and unpinning, and essential tab toggling during reordering.
- Added CSS classes and styles to visually indicate the drop position (before or after) a target tab during the drag operation.  This improves user experience and clarity.
2025-01-31 17:57:46 +01:00
mr. M
d4dd298ef8
Enhance tab management by updating the toolbar on tab close and adjusting overflow behavior for the tab browser 2025-01-27 01:23:01 +01:00
mr. M
ca1e0ffdea
Refactor tab unloading logic to use explicit unload method and remove linked panel attribute 2025-01-24 17:55:31 +01:00
mr. M
c44c63d5ce
Add debug logging for pinned tab manager and ensure session store initialization 2025-01-18 21:38:12 +01:00
mr. M
9fb04e4f7c
Add shutdown check to prevent closing pinned tabs during shutdown 2025-01-17 20:30:48 +01:00
mr. M
8e783f948f
Fixed essentials and pinned tabs not being correctly restored and race conditions when starting multiple zen windows 2025-01-17 19:01:32 +01:00
mr. M
e26ff172c8
Add tab icon change handling and enhance tab background styles 2025-01-11 22:54:04 +01:00
mr. M
7dfa6d55ba
Refactor CSS and JavaScript files for consistency; clean up whitespace and formatting 2025-01-04 02:21:45 +01:00
mr. M
2ce0eae82e
Refactor pinned tab position handling to use cached pin objects for improved performance 2025-01-02 15:40:59 +01:00
mr. M
29e7df3575
Refactor ZenPinnedTabsStorage initialization and improve workspace handling 2024-12-19 20:43:07 +01:00
mr. M
947251534f
Fixed reordering pinned tabs not saving their state 2024-12-18 19:27:23 +01:00
mr. M
d3421270b1
Added a fallback link in case we fail to fetch essentials favicon 2024-12-16 23:25:38 +01:00
mr. M
a84af82740
Fixed essentials not restoring the icons after startup 2024-12-16 19:37:54 +01:00
mr. M
c8e44703d5
Update watermark preference based on build type and enhance URL bar positioning 2024-11-30 18:59:47 +01:00
Kristijan Ribarić
01c8032f20 Fix: Handle essential tabs and container-specific essentials
Refactor workspace switching logic to correctly handle
essential tabs and introduce container-specific essentials.

This change addresses issues with essential tabs not being
handled correctly during workspace switches.

The `changeWorkspace` function is refactored to improve
clarity and maintainability.  The logic for showing and
hiding tabs is streamlined, and tab selection is handled
more robustly.  A new `_shouldShowTab` function is
introduced to centralize the logic for determining tab
visibility based on workspace and container settings.  The
logic also handles pinned essential tabs in the different workspace types.

The pinned tab manager is updated to support container-
specific essentials and to refresh pinned tabs on workspace
changes.  The `_shouldShowPin` function is introduced to
manage visibility of pinned tabs in different workspaces
considering essential tabs, pinned tabs and containers.

This change also fixes a bug where the selected tab would
sometimes be changed unexpectedly when switching
workspaces.
2024-11-20 10:05:07 +01:00
mr. m 🤙
2f79e110c4
Merge pull request #3113 from kristijanribaric/fix-pinned-tabs-showing-in-wrong-workspace
(feat) Hide pinned tabs not in active workspace
2024-11-19 22:06:59 +01:00
Kristijan Ribarić
38e09d84fd (feat) Hide pinned tabs not in active workspace
When a new pinned tab is opened and it does not belong to the
currently active workspace and is not marked as essential, it
will now be hidden.  This prevents pinned tabs from cluttering
the tab bar when switching between workspaces.

The global variable for the pinned tab manager has also been
renamed from `gZenPinnedTabManager` to
`_initializePinnedTabs`.
2024-11-19 22:06:23 +01:00
mr. m 🤙
44a4ce44d4
Merge pull request #3108 from zen-browser/toolbar-redesign
Toolbar redesign
2024-11-19 17:49:00 +01:00
mr. M
032954be2b
feat: enhance zen styles for toolbar, sidebar, and tabs; adjust layout and padding 2024-11-18 23:14:50 +01:00
Kristijan Ribarić
62d5684435 Fix: Restore pinned tabs to their pinned URLs on startup if the option is checked
This change modifies the pinned tab initialization logic to restore
pinned tabs to their original pinned URLs when the browser starts.
Previously, pinned tabs would open to their last visited URL, even if the option for restoring them to the pinned URL was checked.
2024-11-15 13:35:10 +01:00
mr. m 🤙
ab7ae3f89a
Merge pull request #2879 from kristijanribaric/fix/change-order-of-tab-context-menu-items
Display Add to Essentials tab context menu item before Pin Tab
2024-11-13 23:12:41 +01:00
kristijanribaric
b323333bd1
Prevent pins deletion from database on non explicit tab closes (window closing) (#2903)
Previously, if you had multiple windows opened and you closed one, it could trigger TabClose event and delete the pins from zen_pins table. With this change the pins are deleted only on explicit tab closing from tab context menu.
2024-11-11 20:51:46 +01:00
kristijanribaric
8724d6f836
Fix pinned tab state and favicon handling (#2853)
Fixes several issues related to pinned tab restoration and
favicon display:

- Ensures pinned tabs are not loaded in private windows.
- Improves favicon caching and setting for pinned tabs.
- Fixes an issue where the tab state was not properly
  restored, leading to incorrect icons and titles.
- Uses base64 encoded favicon data to prevent issues with
  favicon loading and updates the favicon loading logic to
  be more robust.
- Adds a call to `gBrowser._updateTabBarForPinnedTabs` to
  ensure the tab bar is updated correctly after restoring
  pinned tabs, which fixes a UI issue where the tab bar
  wouldn't refresh properly until interacted with.
- Improves tab initialization by explicitly calling
  `newTab.initialize()` after restoring a pinned tab. This
  fixes an issue with tabs not rendering
  icon and label after being restored.

The changes improve the reliability of pinned tab
restoration and ensure that favicons are displayed
correctly.
2024-11-11 20:48:27 +01:00
Kristijan Ribarić
2798076bb1 Display Add to Essentials tab context menu item before Pin Tab
Add to Essentials is displayed before Pin tab context menu item so it follows the order in which the tabs are displayed in the sidebar as essentials are above pinned tabs.
2024-11-11 08:59:15 +01:00
mr. M
47fdeada01
Fix enabled property check in ZenPinnedTabManager for improved reliability 2024-11-10 18:54:46 +01:00
mr. M
c3fc7d792e
Refactor Zen tab management to improve performance and enable conditional functionality 2024-11-10 18:50:10 +01:00
mr. M
d7a48bd855
refactor: Remove redundant tab refresh during initialization and streamline workspace startup process 2024-11-08 20:07:02 +01:00
mr. M
f093228f71
feat: Update new tab button preferences and improve workspace indicator styles 2024-11-08 19:34:51 +01:00
Kristijan Ribarić
014602266b Correctly set the base pinned url and title for migrating from previous version. 2024-11-07 16:20:46 +01:00
Kristijan Ribarić
696a2148f0 (fix) Migrate pinned tabs from older Zen versions
If there are no pinned tabs in the database on startup,
assume it's a migration from an older version and save all
currently pinned tabs to the database.  Previously, Zen
would remove any pinned tabs that didn't have a `zen-pin-id`
attribute, which would occur during migration. This change
ensures that pinned tabs are preserved during upgrades.
2024-11-07 11:40:44 +01:00
mr. M
6d5dcbe89f
Adjust tab height calculations and improve icon state handling in ZenStartup and ZenPinnedTabManager 2024-11-06 20:31:20 +01:00
mr. M
a2ca9361e1
Refactor toolbar background handling and improve tab styling in compact mode 2024-11-06 19:46:21 +01:00
Kristijan Ribarić
adfcaa2f09 feat: Add new icons for essentials context items
Updted context menu item showing logic
2024-11-05 15:08:36 +01:00
Kristijan Ribarić
7ae2d6d5bb Fix: Parse user context ID correctly when pinning tabs
This commit fixes an issue where the user context ID was not being parsed correctly when pinning tabs.

Previously, the user context ID was being stored as a string, which could lead to unexpected behavior. This commit ensures that the user context ID is parsed as an integer, which is the correct data type.

This change will ensure that pinned tabs are stored and retrieved correctly.
2024-11-05 08:06:54 +01:00
Kristijan Ribarić
bf0342eb06 Ensure that when adding an essential it is saved correctly in the database. 2024-11-04 22:24:40 +01:00
mr. M
649d82425a
Added zen essentials! 2024-11-04 19:34:32 +01:00
mr. M
ec65a69496
Translated files to a single monorepo 2024-11-04 17:37:02 +01:00