feat: Multiselected tabs support for folders, p=#9941

* feat: Multiselected tabs support

* refactor(folders): Store active tabs as direct references in folders and better handling collapsed items

* fix: Refine tab visibility and state management

* feat:  Add ungroup for multiple selected tabs drag and drop, b=no-bug, c=folders, tabs

* fix: Fixed wrong calculation of indentation and other small refactoring, b=no-bug, c=common, folders, tabs

* fix: Fixed restoring split views, b=no-bug, c=folders, workspaces

* test: Added tests for visible tab, b=no-bug, c=folders, tests, tabs

* feat: Folder active tabs are always visible, b=no-bug, c=folders

* fix: Fixed duplicate tabs appearing on the tab search list, b=no-bug, c=folders

* feat: Added support for active folder unload, b=no-bug, c=folders

* fix: first implementation `expandToSelected`

* fix: Formatting

* fix: Some minor fixes, b=no-bug, c=folders, tabs

* fix: Improve collapse visible tab function, b=no-bug, c=folders

* test: Added folder level tests, b=no-bug, c=folders, tests

---------

Signed-off-by: mr. m <91018726+mr-cheffy@users.noreply.github.com>
Co-authored-by: mr. m <91018726+mr-cheffy@users.noreply.github.com>
Co-authored-by: Mr. M <mr.m@tuta.com>
This commit is contained in:
octaviusz
2025-08-22 19:57:12 +03:00
committed by GitHub
parent af73ce2f9c
commit 777bbfeef1
10 changed files with 522 additions and 152 deletions

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tab.js b/browser/components/tabbrowser/content/tab.js
index f261f0f2c7945cbdb41e5d1b6067a8db38bef117..32e21e1295aa508a2b8dc6b8a0ea4d678dd81594 100644
index f261f0f2c7945cbdb41e5d1b6067a8db38bef117..f126879aa9e843c74992aa751795aef3888a6a64 100644
--- a/browser/components/tabbrowser/content/tab.js
+++ b/browser/components/tabbrowser/content/tab.js
@@ -21,6 +21,7 @@
@@ -42,7 +42,7 @@ index f261f0f2c7945cbdb41e5d1b6067a8db38bef117..32e21e1295aa508a2b8dc6b8a0ea4d67
return;
}
@@ -224,9 +227,19 @@
@@ -224,9 +227,21 @@
}
get visible() {
@@ -53,9 +53,11 @@ index f261f0f2c7945cbdb41e5d1b6067a8db38bef117..32e21e1295aa508a2b8dc6b8a0ea4d67
+ return false;
+ }
+
+ // Selected tabs are always visible
+ if ((this.selected || this.multiselected || this.hasAttribute("folder-active")) && !this.hasAttribute("was-folder-active")) return true;
+ // Recursively check all parent groups
+ let currentParent = this.group;
+ while (currentParent && !this.hasAttribute("folder-active")) {
+ while (currentParent) {
+ if (currentParent.collapsed) {
+ return false;
+ }
@@ -65,7 +67,7 @@ index f261f0f2c7945cbdb41e5d1b6067a8db38bef117..32e21e1295aa508a2b8dc6b8a0ea4d67
}
get hidden() {
@@ -297,7 +310,7 @@
@@ -297,7 +312,7 @@
return false;
}
@@ -74,7 +76,7 @@ index f261f0f2c7945cbdb41e5d1b6067a8db38bef117..32e21e1295aa508a2b8dc6b8a0ea4d67
}
get lastAccessed() {
@@ -374,8 +387,11 @@
@@ -374,8 +389,11 @@
}
get group() {
@@ -88,7 +90,7 @@ index f261f0f2c7945cbdb41e5d1b6067a8db38bef117..32e21e1295aa508a2b8dc6b8a0ea4d67
}
return null;
}
@@ -469,6 +485,8 @@
@@ -469,6 +487,8 @@
this.style.MozUserFocus = "ignore";
} else if (
event.target.classList.contains("tab-close-button") ||
@@ -97,7 +99,7 @@ index f261f0f2c7945cbdb41e5d1b6067a8db38bef117..32e21e1295aa508a2b8dc6b8a0ea4d67
event.target.classList.contains("tab-icon-overlay") ||
event.target.classList.contains("tab-audio-button")
) {
@@ -523,6 +541,10 @@
@@ -523,6 +543,10 @@
this.style.MozUserFocus = "";
}
@@ -108,7 +110,7 @@ index f261f0f2c7945cbdb41e5d1b6067a8db38bef117..32e21e1295aa508a2b8dc6b8a0ea4d67
on_click(event) {
if (event.button != 0) {
return;
@@ -571,6 +593,7 @@
@@ -571,6 +595,7 @@
)
);
} else {
@@ -116,7 +118,7 @@ index f261f0f2c7945cbdb41e5d1b6067a8db38bef117..32e21e1295aa508a2b8dc6b8a0ea4d67
gBrowser.removeTab(this, {
animate: true,
triggeringEvent: event,
@@ -583,6 +606,14 @@
@@ -583,6 +608,14 @@
// (see tabbrowser-tabs 'click' handler).
gBrowser.tabContainer._blockDblClick = true;
}
@@ -131,7 +133,7 @@ index f261f0f2c7945cbdb41e5d1b6067a8db38bef117..32e21e1295aa508a2b8dc6b8a0ea4d67
}
on_dblclick(event) {
@@ -606,6 +637,8 @@
@@ -606,6 +639,8 @@
animate: true,
triggeringEvent: event,
});