Compare commits

..

15 Commits

Author SHA1 Message Date
Ivaon
813fc16986 fix: properly collapse folder when unloading all tabs, p=#12399
* fix: properly collapse folder when unloading all tabs

* chore: fix implementation in wrong function
2026-02-16 11:29:57 +01:00
mr. m
86a9c17acd feat: Make sure to always clear dragging-out flag on each new drag event, b=no-bug, c=tabs 2026-02-16 00:11:36 +01:00
mr. m
3d0bdbc71b chore: Fixed linting and formatting, b=no-bug, c=common 2026-02-15 23:54:22 +01:00
mr. m
119bedce30 feat: Don't trim the URL if the omnibox has been opened, b=no-bug, c=common 2026-02-15 22:41:00 +01:00
mr. m
1493c6be21 Merge branch 'dev' of https://github.com/zen-browser/desktop into dev 2026-02-15 22:32:19 +01:00
mr. m
4d4d6970e3 fix: Fixed DnD indicator not showing when there are no pinned tabs, b=no-bug, c=common, tabs 2026-02-15 22:31:59 +01:00
TogiFerretFerret
3914d33968 chore: fix issue where transparent browsers have a forced-white sync, p=#12392
* chore: fix issue where transparent browsers have a forced-white sync background without breaking non-transparent browsers

* chore: fix linting issue
2026-02-15 19:44:38 +01:00
mr. m
c4f98b0cd8 fix: Fixed back/frwd buttons switching tab's state instead of space, b=closes #9157, c=workspaces 2026-02-15 14:12:02 +01:00
mr. m
6e728d0e2f feat: Remove unnecesary browser flush calls, b=bug #12152, c=no-component 2026-02-15 13:59:08 +01:00
mr. m
3bd1101f7b fix: Fixed moving tabs to different spaces in separate windows, b=closes #12235, c=tabs 2026-02-15 13:50:51 +01:00
mr. m
c55126085b chore: Fix merge conflicts, b=no-bug, c=no-component 2026-02-15 13:38:00 +01:00
mr. m
9a6db5fb86 fix: Fixed migration data not working if there where any errors, b=no-bug, c=no-component 2026-02-15 13:36:37 +01:00
Ivaon
8274718d0d ft: add shortcut to toggle Firefox Sidebar, p=#12371 2026-02-13 23:42:48 +01:00
mr. m
5511defb1e feat: Dont restore sidebar if window-sync is disabled, b=no-bug, c=no-component 2026-02-13 21:18:13 +01:00
mr. m
894fbd6a4f fix: Fixed selected space not being highlighted, b=closes #12368, c=configs, common 2026-02-13 20:22:49 +01:00
15 changed files with 112 additions and 85 deletions

View File

@@ -30,17 +30,11 @@ if test "$ZEN_RELEASE"; then
fi
# Disable DMD and ELF hacks, enable linker lld
ac_add_options --disable-dmd
ac_add_options --enable-linker=lld
ac_add_options --disable-elf-hack
ac_add_options --disable-necko-wifi
# Stripping options for release builds
ac_add_options --enable-install-strip
ac_add_options --enable-strip
export STRIP_FLAGS="--strip-debug --strip-unneeded"
fi
# Common options
ac_add_options --enable-alsa
ac_add_options --enable-pulseaudio

View File

@@ -1,5 +1,5 @@
diff --git a/browser/base/content/browser-sets.js b/browser/base/content/browser-sets.js
index 94a05a510204c027e482fda33deaf3dc0d7471c9..79d37a7c7f29739d3ad2d9f6a3b3b8d638836b10 100644
index 94a05a510204c027e482fda33deaf3dc0d7471c9..da7cda8e2708a29cf6cc3bf667240d37ef66ecfb 100644
--- a/browser/base/content/browser-sets.js
+++ b/browser/base/content/browser-sets.js
@@ -266,7 +266,7 @@ document.addEventListener(
@@ -11,3 +11,12 @@ index 94a05a510204c027e482fda33deaf3dc0d7471c9..79d37a7c7f29739d3ad2d9f6a3b3b8d6
const SIDEBAR_REVAMP_PREF = "sidebar.revamp";
const SIDEBAR_REVAMP_ENABLED = Services.prefs.getBoolPref(
SIDEBAR_REVAMP_PREF,
@@ -304,6 +304,8 @@ document.addEventListener(
panel: SidebarController.currentID,
opened: SidebarController._state.launcherExpanded,
});
+ } else {
+ SidebarController.toggle();
}
break;
case "key_gotoHistory":

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..db1c57c8eb4b3d614b5e5aa820871d66b00ec9a4 100644
index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..fda38c3f86bac694027eb3bb339047c6aac30cb9 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -398,6 +398,7 @@
@@ -470,10 +470,10 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..db1c57c8eb4b3d614b5e5aa820871d66
+ gZenWorkspaces._initialTab._shouldRemove = true;
+ }
+ }
+ }
}
+ else {
+ gZenWorkspaces._tabToRemoveForEmpty = this.selectedTab;
}
+ }
+ this._hasAlreadyInitializedZenSessionStore = true;
if (tabs.length > 1 || !tabs[0].selected) {
@@ -959,16 +959,21 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..db1c57c8eb4b3d614b5e5aa820871d66
// Clear tabs cache after moving nodes because the order of tabs may have
// changed.
this.tabContainer._invalidateCachedTabs();
@@ -6869,6 +7096,18 @@
@@ -6868,7 +7095,22 @@
* @returns {object}
* The new tab in the current window, null if the tab couldn't be adopted.
*/
adoptTab(aTab, { elementIndex, tabIndex, selectTab = false } = {}) {
- adoptTab(aTab, { elementIndex, tabIndex, selectTab = false } = {}) {
+ adoptTab(aTab, { elementIndex, tabIndex, selectTab = false, spaceId = null } = {}) {
+ if (window.gZenWorkspaces.currentWindowIsSyncing && aTab.ownerGlobal.gZenWorkspaces?.currentWindowIsSyncing) {
+ const tabId = aTab.id;
+ const thisTab = window.gZenWindowSync.getItemFromWindow(window, tabId);
+ if (thisTab) {
+ // Just move the tab to the index
+ this.moveTabTo(thisTab, { elementIndex, tabIndex });
+ if (spaceId) {
+ thisTab.setAttribute("zen-workspace-id", spaceId);
+ }
+ if (selectTab) {
+ this.selectedTab = thisTab;
+ }
@@ -978,7 +983,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..db1c57c8eb4b3d614b5e5aa820871d66
// Swap the dropped tab with a new one we create and then close
// it in the other window (making it seem to have moved between
// windows). We also ensure that the tab we create to swap into has
@@ -6910,6 +7149,8 @@
@@ -6910,6 +7152,8 @@
params.userContextId = aTab.getAttribute("usercontextid");
}
let newTab = this.addWebTab("about:blank", params);
@@ -987,7 +992,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..db1c57c8eb4b3d614b5e5aa820871d66
let newBrowser = this.getBrowserForTab(newTab);
aTab.container.tabDragAndDrop.finishAnimateTabMove();
@@ -7718,7 +7959,7 @@
@@ -7718,7 +7962,7 @@
// preventDefault(). It will still raise the window if appropriate.
break;
}
@@ -996,7 +1001,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..db1c57c8eb4b3d614b5e5aa820871d66
window.focus();
aEvent.preventDefault();
break;
@@ -7735,7 +7976,6 @@
@@ -7735,7 +7979,6 @@
}
case "TabGroupCollapse":
aEvent.target.tabs.forEach(tab => {
@@ -1004,7 +1009,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..db1c57c8eb4b3d614b5e5aa820871d66
});
break;
case "TabGroupCreateByUser":
@@ -7895,7 +8135,9 @@
@@ -7895,7 +8138,9 @@
let filter = this._tabFilters.get(tab);
if (filter) {
@@ -1014,7 +1019,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..db1c57c8eb4b3d614b5e5aa820871d66
let listener = this._tabListeners.get(tab);
if (listener) {
@@ -8698,6 +8940,7 @@
@@ -8698,6 +8943,7 @@
aWebProgress.isTopLevel
) {
this.mTab.setAttribute("busy", "true");
@@ -1022,7 +1027,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..db1c57c8eb4b3d614b5e5aa820871d66
gBrowser._tabAttrModified(this.mTab, ["busy"]);
this.mTab._notselectedsinceload = !this.mTab.selected;
}
@@ -8778,6 +9021,7 @@
@@ -8778,6 +9024,7 @@
// known defaults. Note we use the original URL since about:newtab
// redirects to a prerendered page.
const shouldRemoveFavicon =
@@ -1030,7 +1035,7 @@ index 0eaca7a58e0026237b71b2ad515efe84d9e8c779..db1c57c8eb4b3d614b5e5aa820871d66
!this.mBrowser.mIconURL &&
!ignoreBlank &&
!(originalLocation.spec in FAVICON_DEFAULTS);
@@ -9803,7 +10047,7 @@ var TabContextMenu = {
@@ -9803,7 +10050,7 @@ var TabContextMenu = {
);
contextUnpinSelectedTabs.hidden =
!this.contextTab.pinned || !this.multiselected;

View File

@@ -1,5 +1,5 @@
diff --git a/toolkit/content/widgets/arrowscrollbox.js b/toolkit/content/widgets/arrowscrollbox.js
index b80d1049bb6ae305f2ac9c4c35fe975fd508031c..0d900883d903ed48ac57863c0468ab39a6f3d98f 100644
index b80d1049bb6ae305f2ac9c4c35fe975fd508031c..9bc80194d4e35f663b5c15baae55fa48eed4ffe9 100644
--- a/toolkit/content/widgets/arrowscrollbox.js
+++ b/toolkit/content/widgets/arrowscrollbox.js
@@ -98,6 +98,7 @@
@@ -15,7 +15,7 @@ index b80d1049bb6ae305f2ac9c4c35fe975fd508031c..0d900883d903ed48ac57863c0468ab39
on_wheel(event) {
// Don't consume the event if we can't scroll.
- if (!this.overflowing) {
+ if (!this.overflowing || this.id === 'tabbrowser-arrowscrollbox' || ((event.deltaY == 0 || gZenWorkspaces._swipeState?.isGestureActive) && this.classList.contains('workspace-arrowscrollbox'))) {
+ if (!this.overflowing || this.id === 'tabbrowser-arrowscrollbox' || ((event.deltaY == 0 || window.gZenWorkspaces?._swipeState?.isGestureActive) && this.classList.contains('workspace-arrowscrollbox'))) {
return;
}

View File

@@ -222,7 +222,7 @@ window.gZenUIManager = {
"--zen-urlbar-top",
`${window.innerHeight / 2 - Math.max(kUrlbarHeight, gURLBar.getBoundingClientRect().height) / 2}px`
);
gURLBar.style.setProperty("--zen-urlbar-width", `${Math.min(window.innerWidth / 2, 700)}px`);
gURLBar.style.setProperty("--zen-urlbar-width", `${Math.min(window.innerWidth / 2, 750)}px`);
gZenVerticalTabsManager.actualWindowButtons.removeAttribute("zen-has-hover");
gZenVerticalTabsManager.recalculateURLBarHeight();
if (!this._preventToolbarRebuild) {
@@ -570,11 +570,10 @@ window.gZenUIManager = {
},
urlbarTrim(aURL) {
if (
gZenVerticalTabsManager._hasSetSingleToolbar &&
this.urlbarShowDomainOnly &&
!gURLBar.hasAttribute("breakout-extend")
) {
if (gURLBar.hasAttribute("breakout-extend")) {
return aURL;
}
if (gZenVerticalTabsManager._hasSetSingleToolbar && this.urlbarShowDomainOnly) {
let url = BrowserUIUtils.removeSingleTrailingSlashFromURL(aURL);
return url.startsWith("https://") ? url.split("/")[2] : url;
}

View File

@@ -17,7 +17,7 @@
}
.urlbar {
--urlbarView-separator-color: light-dark(hsl(0, 0%, 89%), hsl(0, 0%, 20%));
--urlbarView-separator-color: light-dark(hsl(0, 0%, 92%), hsl(0, 0%, 20%));
--urlbarView-hover-background: var(--toolbarbutton-hover-background);
--urlbarView-highlight-background: var(--toolbarbutton-hover-background);
border-radius: calc(var(--toolbarbutton-border-radius) - 2px);

View File

@@ -179,7 +179,7 @@
--toolbarbutton-border-radius: var(--tab-border-radius);
--toolbarbutton-inner-padding: 6px;
--toolbarbutton-outer-padding: 1px;
color: color-mix(in srgb, currentColor 60%, transparent);
--toolbarbutton-icon-fill: color-mix(in srgb, currentColor 70%, transparent);
transition:
background-color 0.1s,

View File

@@ -105,6 +105,7 @@
startTabDrag(event, tab, ...args) {
this.ZenDragAndDropService.onDragStart(1);
this.#isOutOfWindow = false;
gZenCompactModeManager._isTabBeingDragged = true;
super.startTabDrag(event, tab, ...args);
const dt = event.dataTransfer;
@@ -861,6 +862,7 @@
const draggedTab = dt.mozGetDataAt(TAB_DROP_TYPE, 0);
let ownerGlobal = draggedTab?.ownerGlobal;
draggedTab.style.visibility = "";
let thisFromGlobal = ownerGlobal?.gBrowser.tabContainer.tabDragAndDrop;
let currentEssenialContainer = ownerGlobal.gZenWorkspaces.getCurrentEssentialsContainer();
if (currentEssenialContainer?.essentialsPromo) {
currentEssenialContainer.essentialsPromo.remove();
@@ -870,19 +872,21 @@
ownerGlobal.gZenFolders.highlightGroupOnDragOver(null);
this.ZenDragAndDropService.onDragEnd();
super.handle_dragend(event);
this.#removeDragOverBackground();
thisFromGlobal.clearDragOverVisuals();
ownerGlobal.gZenPinnedTabManager.removeTabContainersDragoverClass();
this.#maybeClearVerticalPinnedGridDragOver();
this.originalDragImageArgs = [];
window.removeEventListener("dragenter", this.handle_windowDragEnter, { capture: true });
thisFromGlobal.originalDragImageArgs = [];
window.removeEventListener("dragenter", thisFromGlobal.handle_windowDragEnter, {
capture: true,
});
this.#isOutOfWindow = false;
if (this._browserDragImageWrapper) {
this._browserDragImageWrapper.remove();
delete this._browserDragImageWrapper;
if (thisFromGlobal._browserDragImageWrapper) {
thisFromGlobal._browserDragImageWrapper.remove();
delete thisFromGlobal._browserDragImageWrapper;
}
if (this._tempDragImageParent) {
this._tempDragImageParent.remove();
delete this._tempDragImageParent;
if (thisFromGlobal._tempDragImageParent) {
thisFromGlobal._tempDragImageParent.remove();
delete thisFromGlobal._tempDragImageParent;
}
delete ownerGlobal.gZenCompactModeManager._isTabBeingDragged;
if (dt.dropEffect !== "move") {
@@ -941,14 +945,19 @@
);
if (event.target.classList.contains("zen-workspace-empty-space") || hoveringPeriphery) {
let lastTab = gBrowser.tabs.at(-1);
dropElement =
(hoveringPeriphery && Services.prefs.getBoolPref("zen.view.show-newtab-button-top")
? this._tabbrowserTabs.ariaFocusableItems.at(
gBrowser._numVisiblePinTabsWithoutCollapsed
)
: this._tabbrowserTabs.ariaFocusableItems.at(-1)) || lastTab;
let pinnedTabsCount = gBrowser._numVisiblePinTabsWithoutCollapsed;
// Only if there are no normal tabs to drop after
showIndicatorUnderNewTabButton = lastTab.hasAttribute("zen-empty-tab");
let useLastPinnd =
(hoveringPeriphery ||
(showIndicatorUnderNewTabButton &&
!(pinnedTabsCount - gBrowser._numZenEssentials))) &&
Services.prefs.getBoolPref("zen.view.show-newtab-button-top");
dropElement =
(useLastPinnd
? this._tabbrowserTabs.ariaFocusableItems.at(pinnedTabsCount)
: this._tabbrowserTabs.ariaFocusableItems.at(-1)) || lastTab;
}
}
dropElement = elementToMove(dropElement);

View File

@@ -256,6 +256,7 @@ export class nsZenFolder extends MozTabbrowserTabGroup {
folderToUnload: this,
});
this.activeTabs = [];
this.collapsed = true;
}
on_click(event) {

View File

@@ -127,37 +127,47 @@ export class nsZenSessionManager {
const db = await PlacesUtils.promiseDBConnection();
let data = {};
let rows = await db.execute("SELECT * FROM zen_workspaces ORDER BY created_at ASC");
data.spaces = rows.map((row) => ({
uuid: row.getResultByName("uuid"),
name: row.getResultByName("name"),
icon: row.getResultByName("icon"),
containerTabId: row.getResultByName("container_id") ?? 0,
position: row.getResultByName("position"),
theme: row.getResultByName("theme_type")
? {
type: row.getResultByName("theme_type"),
gradientColors: JSON.parse(row.getResultByName("theme_colors")),
opacity: row.getResultByName("theme_opacity"),
rotation: row.getResultByName("theme_rotation"),
texture: row.getResultByName("theme_texture"),
}
: null,
}));
rows = await db.execute("SELECT * FROM zen_pins ORDER BY position ASC");
data.pins = rows.map((row) => ({
uuid: row.getResultByName("uuid"),
title: row.getResultByName("title"),
url: row.getResultByName("url"),
containerTabId: row.getResultByName("container_id"),
workspaceUuid: row.getResultByName("workspace_uuid"),
position: row.getResultByName("position"),
isEssential: Boolean(row.getResultByName("is_essential")),
isGroup: Boolean(row.getResultByName("is_group")),
parentUuid: row.getResultByName("folder_parent_uuid"),
editedTitle: Boolean(row.getResultByName("edited_title")),
folderIcon: row.getResultByName("folder_icon"),
isFolderCollapsed: Boolean(row.getResultByName("is_folder_collapsed")),
}));
try {
data.spaces = rows.map((row) => ({
uuid: row.getResultByName("uuid"),
name: row.getResultByName("name"),
icon: row.getResultByName("icon"),
containerTabId: row.getResultByName("container_id") ?? 0,
position: row.getResultByName("position"),
theme: row.getResultByName("theme_type")
? {
type: row.getResultByName("theme_type"),
gradientColors: JSON.parse(row.getResultByName("theme_colors")),
opacity: row.getResultByName("theme_opacity"),
rotation: row.getResultByName("theme_rotation"),
texture: row.getResultByName("theme_texture"),
}
: null,
}));
} catch (e) {
/* ignore errors reading spaces data, as it is not critical and we want to migrate even if we fail to read it */
console.error("Failed to read spaces data from database during migration", e);
}
try {
rows = await db.execute("SELECT * FROM zen_pins ORDER BY position ASC");
data.pins = rows.map((row) => ({
uuid: row.getResultByName("uuid"),
title: row.getResultByName("title"),
url: row.getResultByName("url"),
containerTabId: row.getResultByName("container_id"),
workspaceUuid: row.getResultByName("workspace_uuid"),
position: row.getResultByName("position"),
isEssential: Boolean(row.getResultByName("is_essential")),
isGroup: Boolean(row.getResultByName("is_group")),
parentUuid: row.getResultByName("folder_parent_uuid"),
editedTitle: Boolean(row.getResultByName("edited_title")),
folderIcon: row.getResultByName("folder_icon"),
isFolderCollapsed: Boolean(row.getResultByName("is_folder_collapsed")),
}));
} catch (e) {
/* ignore errors reading pins data, as it is not critical and we want to migrate even if we fail to read it */
console.error("Failed to read pins data from database during migration", e);
}
try {
data.recoveryData = await IOUtils.readJSON(
PathUtils.join(
@@ -187,8 +197,9 @@ export class nsZenSessionManager {
}
}
this._migrationData = data;
} catch {
} catch (e) {
/* ignore errors during migration */
console.error(e);
}
}
@@ -312,6 +323,9 @@ export class nsZenSessionManager {
* The initial session state read from the session file, possibly modified by onFileRead.
*/
onCrashCheckpoints(initialState) {
if (!lazy.gWindowSyncEnabled) {
return;
}
// When we don't have browser.startup.page set to resume session,
// we only want to restore the pinned tabs into the new windows.
if (this.#shouldRestoreOnlyPinned && !this.#shouldRestoreFromCrash && this.#sidebar?.tabs) {

View File

@@ -245,8 +245,6 @@ class nsZenWindowSync {
for (let tab of gZenWorkspaces.allStoredTabs) {
if (!tab.id) {
tab.id = this.#newTabSyncId;
// Don't call with await here to avoid blocking the loop.
this.#maybeFlushTabState(tab);
}
if (tab.pinned && !tab._zenPinnedInitialState) {
await this.setPinnedTabState(tab);
@@ -474,9 +472,6 @@ class nsZenWindowSync {
this.#maybeSyncAttributeChange(aOriginalItem, aTargetItem, "zen-workspace-id");
this.#syncItemPosition(aOriginalItem, aTargetItem, aWindow);
}
if (gBrowser.isTab(aTargetItem)) {
this.#maybeFlushTabState(aTargetItem);
}
}
/**
@@ -803,6 +798,7 @@ class nsZenWindowSync {
{
fullScale: true,
fullViewport: true,
backgroundColor: "transparent",
}
);
@@ -1151,7 +1147,6 @@ class nsZenWindowSync {
if (duringPinning && tab?.splitView) {
this.on_ZenSplitViewTabsSplit({ target: tab.group });
}
this.#maybeFlushTabState(tab);
}
on_ZenTabIconChanged(aEvent) {

View File

@@ -595,6 +595,7 @@ class nsZenPinnedTabManager extends nsZenDOMOperatedFeature {
tab = gBrowser.adoptTab(tab, {
elementIndex: newIndex,
selectTab: tab == draggedTab,
spaceId: workspaceId,
});
if (tab) {
++newIndex;

View File

@@ -1130,7 +1130,7 @@
position: absolute;
:root[zen-single-toolbar="true"] &:not(:empty) {
padding-top: 6px;
padding-top: 4px;
}
&[hidden="true"] {

View File

@@ -523,7 +523,7 @@ class nsZenWorkspaces {
_handleAppCommand(event) {
// note: Dont use this._hoveringSidebar as it's not as reliable as checking for :hover
if (!this.workspaceEnabled || !this._hoveringSidebar) {
if (!this.workspaceEnabled || !gNavToolbox.matches(":hover")) {
return;
}

View File

@@ -20,7 +20,7 @@
"brandShortName": "Zen",
"brandFullName": "Zen Browser",
"release": {
"displayVersion": "1.18.6b",
"displayVersion": "1.18.8b",
"github": {
"repo": "zen-browser/desktop"
},