Closed Bug 566510 Opened 14 years ago Closed 6 years ago

Allow multiselect operations on tabs

Categories

(Firefox :: Tabbed Browser, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1458007

People

(Reporter: limi, Unassigned, Mentored)

References

(Blocks 2 open bugs, )

Details

(Whiteboard: [Advo])

Attachments

(12 obsolete files)

(Note: this is filed as part of the “Paper Cut” bugs — we assume that there may be multiple existing bugs on this. Please make them block this bug, and we will de-dupe if they are indeed exactly the same. Thanks!)

We should support multiselect operations (Shift for range, Cmd for individual items) on the tabs themselves, to support closing lots of tabs in one go, and dragging N selected tabs into a new window.

The interaction would look like this:
1. Select first tab
2. Hold down shift
3. Select last tab in the range
4. Get selection highlight indicator showing what tabs are now selected
5. Execute close or drag operation on selected tabs.
Component: General → Tabbed Browser
QA Contact: general → tabbed.browser
Blocks: 132674
No longer blocks: 132674
Blocks: 318544
This patch implements multiple tab selection as specified by this document:
https://wiki.mozilla.org/Multiple_tab_selection

Additionally selected tabs are currently highlighted with a bright blue background. This will of course be properly themed in the final patch.

Closing selecting tabs is not yet implemented, because this requires string changes to the tab context menu, etc.

There are a couple of minor selection bugs remaining, one of which is:
* When detaching multiple tabs, the selected tab among those tabs is not maintained.
(The selection code is written from scratch, since HTML/DOM selection code is both overkill and has known bugs that we want to avoid.)

This patch should be entirely usable, especially since it does not override or break any existing features or behavior. :)
Assignee: nobody → fyan
Status: NEW → ASSIGNED
Attached patch patch v.2 (WIP; see comment #2) (obsolete) — Splinter Review
Remaining issues:
* When detaching multiple tabs, the selected tab among those tabs is not
maintained.
* Multiple tabs cannot be moved simultaneously within a window's tab container.
* Dragging/detaching tabs deselects all tabs within all related windows.
* Closing multiple selected tabs is not yet supported. (This requires string changes and UX work.)
* Multi-selection UI indication is temporary. (Mockups are in the works.)
Attachment #450886 - Attachment is obsolete: true
Improvements since last revision:
* Completely restyled! Looks much more beautiful imho :)
* Multi-selection checks are now all O(1) instead of O(n)
* Multi-selected tabs can be moved around together within a window
* Closing multi-selected tabs is experimentally supported via ctrl/opt(mac)+middle-click on tab and ctrl/opt(mac)+click on tab close button
* 'Close other tabs' on a multi-selected tab closes only non-multi-selected tabs
* Smartly disabled tab context menu items
* Dragging tabs between windows maintains the selected tab among the dragged tabs

Remaining issues:
* When detaching multi-selected tabs, the selected tab among these is not maintained.
* Dragging multi-selected tabs between windows deselects them. (Should detaching tabs maintain multi-selection?)
* Bookmarking multi-selected tabs (via menu / D&D) is not yet supported. (Not easily undo-able.)
* Multi-selection indication UI is not final. (Mockups are in the works.)
Attachment #451445 - Attachment is obsolete: true
The remaining issues with v3 still exist, but this patch is definitely land-able. All known issues will be fixed in a followup bug after we get awesome feedback from awesome trunk users.

The design document still lives here: https://wiki.mozilla.org/Multiple_tab_selection
Attachment #451931 - Attachment is obsolete: true
Attachment #453961 - Flags: review?(gavin.sharp)
Attachment #453961 - Flags: review?(gavin.sharp)
Depends on: 449734
While bug 449734 does not block this, _shipping_ this feature without fixing that bug will cause even more unexpected plugin reloading.
No longer depends on: 449734
Will this also work for keyword shortcuts? For example, select 3 tabs and press Ctrl+W to close them.
Attached patch patch v5 (WIP for feedback) (obsolete) — Splinter Review
I'd like to get some feedback on the implementation, before I tackle the remaining minor issues.

This revision also temporarily reverts the multiselect styling to just italics, while awaiting border images from shorlander.
Attachment #453961 - Attachment is obsolete: true
Attachment #459168 - Flags: feedback?(gavin.sharp)
Does this bug also cover the context menu and tear off tabs or are split of bugs needed?
Attachment #459168 - Attachment description: patch v5 ( → patch v5 (WIP for feedback)
How do you handle theming of selected tabs on Linux? I guess moving away from GTK look tabs to the new common style would make this a lot easier for you?

Btw the "to support closing lots of tabs in one go" use case is not really valid. For this we should copy Chome (e.g. we should not resize the remaining tabs until the mouse moves away from the spot where it was clicked to allow closing the next tab by pressing on the same spot again)
Comment on attachment 459168 [details] [diff] [review]
patch v5 (WIP for feedback)

Marking patch v5 obsolete, since I made major improvements to the UI interaction design of the feature and will post a patch with those soon.
Attachment #459168 - Attachment is obsolete: true
Attachment #459168 - Flags: feedback?(gavin.sharp)
Since Horlander is busy and/or away, the edge glow styling that will indicate that a tab is part of a multi-selection will have to wait (a week or two). For now, such tabs will be indicated with labels in italics.

For reference, this patch is intended to follow the specifications of this design document: https://wiki.mozilla.org/Firefox/Projects/Tab_Multi-Selection/Design
Attachment #460077 - Flags: ui-review?(limi)
Attachment #460077 - Flags: review?(gavin.sharp)
Attachment #460077 - Flags: feedback?(dolske)
typos! yikes!
Attachment #460077 - Attachment is obsolete: true
Attachment #460078 - Flags: ui-review?(limi)
Attachment #460078 - Flags: review?(gavin.sharp)
Attachment #460078 - Flags: feedback?(dolske)
Attachment #460077 - Flags: ui-review?(limi)
Attachment #460077 - Flags: review?(gavin.sharp)
Attachment #460077 - Flags: feedback?(dolske)
Attachment #460078 - Attachment is obsolete: true
Attachment #460446 - Flags: ui-review?(limi)
Attachment #460446 - Flags: review?(gavin.sharp)
Attachment #460078 - Flags: ui-review?(limi)
Attachment #460078 - Flags: review?(gavin.sharp)
Attachment #460078 - Flags: feedback?(dolske)
This also adds the final micro-feature, which is sliding the shift+clicked / ctrl/cmd+clicked tab in view if it wasn't already.
Attachment #460446 - Attachment is obsolete: true
Attachment #461632 - Flags: ui-review?(limi)
Attachment #461632 - Flags: review?(gavin.sharp)
Attachment #460446 - Flags: ui-review?(limi)
Attachment #460446 - Flags: review?(gavin.sharp)
Frank, can you fire up some tryserver builds?
Attachment #461632 - Attachment is obsolete: true
Attachment #465184 - Flags: ui-review?(limi)
Attachment #465184 - Flags: review?(gavin.sharp)
Attachment #465184 - Flags: review?(dao)
Attachment #461632 - Flags: ui-review?(limi)
Attachment #461632 - Flags: review?(gavin.sharp)
Attachment #465184 - Attachment is obsolete: true
Attachment #465257 - Flags: ui-review?(limi)
Attachment #465257 - Flags: review?(gavin.sharp)
Attachment #465257 - Flags: review?(dao)
Attachment #465184 - Flags: ui-review?(limi)
Attachment #465184 - Flags: review?(gavin.sharp)
Attachment #465184 - Flags: review?(dao)
I also removed the references to document.popupNode in favor of aPopupMenu.triggerNode.

The final styling for this will land once we land the final tab border-images for Firefox 4.
Attachment #465257 - Attachment is obsolete: true
Attachment #465958 - Flags: ui-review?(limi)
Attachment #465958 - Flags: review?(gavin.sharp)
Attachment #465958 - Flags: review?(dao)
Attachment #465257 - Flags: ui-review?(limi)
Attachment #465257 - Flags: review?(gavin.sharp)
Attachment #465257 - Flags: review?(dao)
This is some nice additional interaction, but I'd prioritize it below the tab animation work that Frank's also got up for review. I think that there's a higher chance for regression with this work (not accusing Frank of anything, just tabs touch, like, everything) and the function will be less universally seen.

If we can get it, that's great, but we should be quick to bounce it if it causes problems, not try to fix up all the follow ups before pulling it out.
Comment on attachment 465958 [details] [diff] [review]
patch v12 (updated to tip of tree + added border image styling for win+osx)

LGTM! Can we land this as early as possible, so we can see whether it sticks? Don't want this to wait until the last day before beta5 freeze. :)
Attachment #465958 - Flags: ui-review?(limi) → ui-review+
Big patch, not a blocker, and two of the busier reviewers are tagged; please don't increase pressure, I'd rather we spend time on the blocking bugs that we have to deal with than this one.
Blocks: 356258
does this cover "move to group"?
Attachment #465958 - Flags: review?(gavin.sharp)
Attachment #465958 - Flags: review?(dao)
Should also cover DND to move selected tabs.
(In reply to comment #24)
> Should also cover DND to move selected tabs.

The patch already includes this.

(In reply to comment #23)
> does this cover "move to group"?

Not yet.
Comment on attachment 465958 [details] [diff] [review]
patch v12 (updated to tip of tree + added border image styling for win+osx)

>diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
>--- a/browser/base/content/browser.js
>+++ b/browser/base/content/browser.js
>     var menuItems = aPopupMenu.getElementsByAttribute("tbattr", "tabbrowser-multiple");
Can we add a similar attribute, for example "multiselected", for items visible for selected tabs?

>diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul
>--- a/browser/base/content/browser.xul
>+++ b/browser/base/content/browser.xul
>+      <menuitem id="context_closeSelectedTabs" label="&closeSelectedTabs.label;" accesskey="&closeSelectedTabs.accesskey;"
>+                oncommand="gBrowser.removeSelectedTabs();" hidden="true"/>
Can we reuse the close tab item but with a improved oncommand?
Whiteboard: [target-betaN]
Why is an array-like property "selectedTabs" missing? Why is the "_clearMultiselection()" method private?
(In reply to comment #27)
> Why is an array-like property "selectedTabs" missing? Why is the
> "_clearMultiselection()" method private?

Will fix in next iteration of the patch.
Is the whiteboard correct on this?
Setting bug 455694 as a dependency for design and prioritization reasons (i.e. we want to land bug 455694's patch first to make it easier to implement the visual/interaction design for this).
Depends on: 455694
Whiteboard: [target-betaN]
Comment on attachment 465958 [details] [diff] [review]
patch v12 (updated to tip of tree + added border image styling for win+osx)

Obsoleting, because this needs to be entirely rewritten once the feature in bug 455694 lands.
Attachment #465958 - Attachment is obsolete: true
No longer blocks: 356258
No longer blocks: 318544
Hi Frank,
Thanks for working to solve this issue!  The ability to "multi-select" in Tab Candy is crucial for the feature to be of any use IMO.  

I have a few quick questions:  
1)  Did the Tab Candy compatibility checkin in patch v11 add any support for "drag-select", ie: "multi-select" by drawing a rectangle?  If not, can it be added?   
2)  Will this patch work with OSX v10.5.8 + FF v3.6.8?  If not, what version(s) of FF can this patch be applied to?  or what version will this appear in?  

Thanks!
(In reply to Brian from comment #34)
This is just for normal tabs. For Tab Candy, I think Bug 588849 is closer to what you're looking for.
In addition to the previously mentioned multi-ops like reloading, closing, and DnD, has anyone mentioned the idea of bookmarking a multiset of tabs at a time? Any news on this since August?
(In reply to AL from comment #36)
> In addition to the previously mentioned multi-ops like reloading, closing,
> and DnD, has anyone mentioned the idea of bookmarking a multiset of tabs at
> a time? Any news on this since August?

I think you need to file a new bug for that. ;)
Blocks: 713036
Can I poke for a status update regarding this bug? Given the lack of global tab management in Panorama, this would be nice to have.
(In reply to Paul [sabret00the] from comment #38)
> Can I poke for a status update regarding this bug? Given the lack of global
> tab management in Panorama, this would be nice to have.

This is not a priority right now. If you'd like to see it fixed sooner rather than later, your best bet would be to find resources to put against it.
This is one of my personal pet peeves and I'd like to do a front-end patch for a change.

- Why was the last patch made obsolete?
- If I finish this patch are we willing to put resources to review and land it?
I think you should maybe ask for UX input on this. There are some unanswered questions : 
-how will drag and drop look with this (assuming bug 674925 is fixed) ?
-How will selected tabs look with the new tabstrip ?
...
You should ask Stephen Horlander to have mockups for this change.
(In reply to Benoit Girard (:BenWa) from comment #40)
> This is one of my personal pet peeves and I'd like to do a front-end patch
> for a change.

That's great! :)

> - Why was the last patch made obsolete?

We decided that it was more important to land tab direct manipulation via drag and drop (bug 674925) first, so I stopped working on this one, until that the patches there get reviewed and landed, since any patches in the bug should be written on top of the patch in that bug. For example, the visual feedback for dragging a selection of multiple tabs should be consistent with the direct manipulation style we're implementing in bug 674925 rather than creating an extra proxy image like we currently do.

> - If I finish this patch are we willing to put resources to review and land it?

I'm happy to provide as much useful feedback as I can, but I will defer to Dão for a final review.
Assignee: fryn → nobody
Status: ASSIGNED → NEW
Whiteboard: [Advo]
I've implemented basic tab multi-selection support based on patch v12 from this thread.
https://addons.mozilla.org/addon/bug-566510/
Is this dead?
Hey whats going on with this?
As you can see: nothing, literally.
It's abandoned and forgotten.
Any progress on this?
Ping.
Pong.

Since I published multi-selection addon for Firefox [1] (it really just applies the patch v12 from this thread using XBL mechanism and nothing more) I was using it to my satisfaction (stability, productivity) every day. It would be shame to let this ticket go.

[1]: https://addons.mozilla.org/addon/bug-566510
(In reply to v.ovcacik from comment #50)
> Pong.
> 
> Since I published multi-selection addon for Firefox [1] (it really just
> applies the patch v12 from this thread using XBL mechanism and nothing more)
> I was using it to my satisfaction (stability, productivity) every day. It
> would be shame to let this ticket go.
> 
> [1]: https://addons.mozilla.org/addon/bug-566510

There are also other addons that provide similar functionality, so the situation is not bad.

I use All Tabs Helper ( https://addons.mozilla.org/en-US/firefox/addon/all-tabs-helper/ )
Because in addition it allows drag and drop action on selected tabs. And the vertical view helps a lot when you have a lot of tabs, which I often do.

But I assume we'll be screwed when they remove XUL addons.
This is parity-Chrome FWIW. Not the most visible feature in the world, but super-handy nonetheless.
(In reply to avada from comment #51)
> But I assume we'll be screwed when they remove XUL addons.

Yeah, I already started to revoke support to some of my addons.
Is there a reason this never landed?
Dão is this still something we should do at some point?  It seems to be blocked on a bug that's not really being worked on...
Flags: needinfo?(dao+bmo)
Please continue to work on this. With XUL we could implement such a functionality on our own, but with WebExt it will be history.

Also implementing this natively would allow Firefox to support the WebExt tab APIs regarding multiselect and therefore make WebExt add-ons more interoperable with other browsers.
Not a priority right now but I think we'd take patches. The bug 455694 dependency was a loose one.
No longer depends on: 455694
Flags: needinfo?(dao+bmo)
Priority: -- → P3
I'd really like to see this implemented and I'd be happy to work on it if I could get a small amount of mentorship.
I too really want this feature. The "Multiple Tab Handler" add-on does not work for me because I use Vertical Tabs Reloaded.

To explain why this feature is so important to me... When I close Friefox I often have a bunch of unread tabs that I want to read another time. I don't want to leave the tabs sitting there as it is disorganised and I've found in the past that if I leave unread tabs, they start to build up and before I know it there are hundreds of tabs loading when Firefox launches. No, when I close Firefox, I want to be able to select unread tabs and quickly bookmark them.

I also wish Firefox had an option so that when you drag tabs to your bookmarks it automatically closes the tabs - and vice versa. To me, being able to quickly drag tabs to and from bookmarks is essential in keeping my Firefox well-organized. (I would like to submit this as a feature request but when I try to submit feature requests here I am not given a bug ID so I can't track it.)
Hey, can't someone mentor Matthew Wein [:mattw] who commented in comment 60 and who offered his help to do this? This feature is so useful in Chrome and really putting down your experience if you try to switch from Chrome to Firefox. :-(

Thanks!
(In reply to Robert Orzanna from comment #62)
> Hey, can't someone mentor Matthew Wein [:mattw] who commented in comment 60
> and who offered his help to do this? This feature is so useful in Chrome and
> really putting down your experience if you try to switch from Chrome to
> Firefox. :-(
> 
> Thanks!

You'd have to ask the triage owner to nominate someone.
Should either of these components apply to this bug? 

WebExtensions: Frontend
WebExtensions: General


Maybe related
=============

Change the group of multiple tabs · Issue #30 · mikeconley/multi-select-tabs
<https://github.com/mikeconley/multi-select-tabs/issues/30>

Add support for moving tabs to container · Issue #18 · mikeconley/multi-select-tabs
<https://github.com/mikeconley/multi-select-tabs/issues/18>

Change the context of multiple tabs · Issue #13 · totallymike/contextPlus
<https://github.com/totallymike/contextPlus/issues/13>

– both MultiSelect Tabs <https://addons.mozilla.org/addon/multiselect-tabs/> and Context Plus <https://addons.mozilla.org/addon/context-plus/> are compatible with Firefox 57+
Dao, would you be willing to mentor this bug? :mattw offered to work on it if you could mentor it (I talked to him and his offer is still present).
Flags: needinfo?(dao+bmo)
One more related addon: Multiple Tab Handler https://addons.mozilla.org/firefox/addon/multiple-tab-handler/
If Firefox itself provides ability to select tabs and selected tabs can be grabbed or controlled (select/unselect) via WebExtensions API, my addon can use those APIs and become more compatible to other addons.
Assignee: nobody → matthewjwein
Mentor: dao+bmo
Status: NEW → ASSIGNED
Flags: needinfo?(dao+bmo)
Assignee: matthewjwein → nobody
Status: ASSIGNED → NEW
hi,
i am interested in working on this bug as my GSoC'18 project,if you could provide with some information on where to start,that would be really helpful.
Below are some notes on this particular project.

While working on this you will become very familiar with the Browser Toolbox [1], our own "Inspector" tool for the browser user-interface, as well as writing automated tests for the new feature you're adding. Most of our tab-selection code lives within our tabbrowser.js file [2], which you can browse around if you're interested to see how some operations work.

You should download the source code and compile Firefox. We have documentation online for building Firefox [3]. Make sure to use an Artifact Build [4] since it will compile much faster and you shouldn't need to write any C++ for this project. After you have Firefox compiled locally, you should get familiar with running the tab related tests. To run them, you would run `./mach test browser/base/content/test/tabs`

You can put together a project proposal and a project schedule, breaking down the work in to small incremental chunks. Please make sure to include time for writing automated tests that cover the new functionality.

There is an old (but roughly up-to-date) design document for this project at https://wiki.mozilla.org/Firefox/Projects/Tab_Multi-Selection/Design

Please feel free to email me any questions you may have, as this bug is not a good place for a discussion since each comment will email everyone that is CC'd to the bug.

[1] https://developer.mozilla.org/en-US/docs/Tools/Browser_Toolbox
[2] https://searchfox.org/mozilla-central/source/browser/base/content/tabbrowser.js
[3] https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build#Building_Firefox_for_the_Desktop
[4] https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Artifact_builds
Duping forward to bug 1458007. This bug will now be worked on as a GSoC project, and starting with a fresh bug will remove some of the conversation about legacy add-ons that are no longer supported, as well as references to code that has significantly changed over time.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.