Skip to content

Commit

Permalink
Enhance tab grouping logic to correctly handle pinned tabs and improv…
Browse files Browse the repository at this point in the history
…e insertion behavior
  • Loading branch information
mauro-balades committed Feb 26, 2025
1 parent 9fb2e9d commit 3878dcd
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/browser/components/tabbrowser/content/tabbrowser-js.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -412,11 +412,50 @@
Expand Down Expand Up @@ -194,19 +194,16 @@ index 628aa6596627c85efe361fc1ece8fd58f7ee653e..fe746cd0e749308889173cbbb32b8a77
// Additionally send pinned tab events
if (pinned) {
this._notifyPinnedStatus(t);
@@ -2918,9 +2982,10 @@
@@ -2918,7 +2982,8 @@
id = `${Date.now()}-${Math.round(Math.random() * 100)}`;
}
let group = this._createTabGroup(id, color, false, label);
- this.tabContainer.insertBefore(
+ group.pinned = tabs.some(tab => tab.pinned);
+ (group.pinned ? this.verticalPinnedTabsContainer : this.tabContainer).insertBefore(
group,
- insertBefore?.group ?? insertBefore
+ insertBefore?.group ?? tabs[tabs.length - 1].nextElementSibling
insertBefore?.group ?? insertBefore
);
group.addTabs(tabs);

@@ -3367,6 +3432,24 @@
) {
tabWasReused = true;
Expand Down

0 comments on commit 3878dcd

Please sign in to comment.