mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-05 09:26:34 +00:00
Enhance tab grouping logic to correctly handle pinned tabs and improve insertion behavior
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
index 628aa6596627c85efe361fc1ece8fd58f7ee653e..fe746cd0e749308889173cbbb32b8a77a1dfe10f 100644
|
index 628aa6596627c85efe361fc1ece8fd58f7ee653e..dc1bf702844ab60eb781c12dd59d29e839577cdb 100644
|
||||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
@@ -412,11 +412,50 @@
|
@@ -412,11 +412,50 @@
|
||||||
@@ -194,7 +194,7 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..fe746cd0e749308889173cbbb32b8a77
|
|||||||
// Additionally send pinned tab events
|
// Additionally send pinned tab events
|
||||||
if (pinned) {
|
if (pinned) {
|
||||||
this._notifyPinnedStatus(t);
|
this._notifyPinnedStatus(t);
|
||||||
@@ -2918,9 +2982,10 @@
|
@@ -2918,7 +2982,8 @@
|
||||||
id = `${Date.now()}-${Math.round(Math.random() * 100)}`;
|
id = `${Date.now()}-${Math.round(Math.random() * 100)}`;
|
||||||
}
|
}
|
||||||
let group = this._createTabGroup(id, color, false, label);
|
let group = this._createTabGroup(id, color, false, label);
|
||||||
@@ -202,11 +202,8 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..fe746cd0e749308889173cbbb32b8a77
|
|||||||
+ group.pinned = tabs.some(tab => tab.pinned);
|
+ group.pinned = tabs.some(tab => tab.pinned);
|
||||||
+ (group.pinned ? this.verticalPinnedTabsContainer : this.tabContainer).insertBefore(
|
+ (group.pinned ? this.verticalPinnedTabsContainer : this.tabContainer).insertBefore(
|
||||||
group,
|
group,
|
||||||
- insertBefore?.group ?? insertBefore
|
insertBefore?.group ?? insertBefore
|
||||||
+ insertBefore?.group ?? tabs[tabs.length - 1].nextElementSibling
|
|
||||||
);
|
);
|
||||||
group.addTabs(tabs);
|
|
||||||
|
|
||||||
@@ -3367,6 +3432,24 @@
|
@@ -3367,6 +3432,24 @@
|
||||||
) {
|
) {
|
||||||
tabWasReused = true;
|
tabWasReused = true;
|
||||||
|
Reference in New Issue
Block a user