photodiode / panorama-view

Add-on for Firefox letting you organize tabs and tab groups visually
https://addons.mozilla.org/firefox/addon/panorama-view/
Mozilla Public License 2.0
216 stars 30 forks source link

(1357214) interop: tab groups: Firefox parity with the tabs.group method of the chrome.tabs API in Google Chrome #73

Open grahamperrin opened 6 years ago

grahamperrin commented 6 years ago

FAO @Drive4ik @joelpt @kesselborn @maximstewart @morikko @nchevobbe @nyordanov @photodiode @saintwolf and other developers who might have an interest in extending Firefox with tab group functionality:

I imagine that basics should include:

Rationale

I don’t expect any single extension to serve all purposes.

Background

At https://discourse.mozilla.org/t/-/28533/3?u=grahamperrin (2018-05-12) @freaktechnik wrote:

These extensions could expose communication protocols of their own, like container extensions and some others do if interaction is so complicated. (Other examples for cross-extension communication can be found at https://github.com/freaktechnik/awesome-extension-apis.)

From https://github.com/Quicksaver/Tab-Groups/issues/535#issuecomment-390430344 (2018-05-19):

I'll need any group that is created by (say) Panorama View to be also manageable by (say) Tiled Tab Groups; and vice versa. Extensions should work with each other, without requiring a per-extension set of groups.

Possible?

TIA

grahamperrin commented 6 years ago

Also maybe @Bill13579

photodiode commented 6 years ago

I have been thinking about this for a while. The best case scenario would probably be to make one extension we all work on simply called "tab groups" or something. Which would be an extension needed as a base for all tab group like extensions, or at least supported by. Extension-specific things like visual group size and such would probably still be within each extension.

grahamperrin commented 6 years ago

Thanks.

Something else that might help to shape thoughts:

– although that's explicitly No Tab Groups.

Morikko commented 6 years ago

That could be a really good idea to create a main engine with a standard API messaging. Thus any other extension could offer a different experience to interact with their groups.

However, it is not that easy to do the change:

Probably, the best thing would be that the API would be integrated and supported by Firefox itself. Else, I completely support the initiative.

grahamperrin commented 6 years ago

Found:

RESOLVED DUPLICATE of bug 1384515

– but 1384515 was limited in scope (hiding and showing individual tabs).

From https://bugzilla.mozilla.org/show_bug.cgi?id=1357214#c30:

… As predicted, we have diverse implementations and conflicts. …

photodiode commented 5 years ago

Here is my first proposal for an API. I am rewriting the add-on to use this (not as part of the browser API of course...) But hopefully something similar will be added to Firefox in the future. Thoughts?

// for tab groups
browser.tabGroups.create({title, windowId});
browser.tabGroups.remove(groupIds);

browser.tabGroups.move(groupIds, windowId);

browser.tabGroups.query({active, currentWindow, windowId, title});
browser.tabGroups.update(groupId, {active, title});

browser.sessions.setTabGroupValue(groupId, key, value); // can be used for adding custom values like visual size in panorama, etc..
browser.sessions.getTabGroupValue(groupId, key);
browser.sessions.removeTabGroupValue(groupId, key);

// for tabs api
browser.tabs.query({tabGroupId: id});
browser.tabs.move(tabIds, {tabGroupId: id});
jeremymeyers commented 4 years ago

This might spark thinking on this issue? https://blog.prototypr.io/tab-sort-improving-tabs-in-firefox-9a727754e8d0 (i have nothing to do with it, just thought it was a useful display and explanation of the issue that stems from actual user research.

grahamperrin commented 3 years ago

Revisiting this after a long break …

The 2017 blog post – Tab Sort — Improving Tabs in Firefox | by Nikolas Klein | Prototypr – thanks @jeremymeyers

… sorting the tabs inside of the existing tab bar. …

Interesting, however I think that the existing tab bar is entirely unsuitable for sorting (or for viewing what might have been sorted for the user). For example:

image

– what, in the third image, conveys a sense of things being sorted by domain? I look for W towards the right only because we have been told that a sort by domain has occurred.

grahamperrin commented 3 years ago

https://github.com/photodiode/panorama-view/issues/73#issuecomment-461396248 thanks @photodiode I'd like to comment on suitability, however I'm not a developer.

https://bugzilla.mozilla.org/show_bug.cgi?id=1333837#c29 there's a plea for reopening of bug 1357214 for a Tab Groups API …

jeremymeyers commented 3 years ago

OK so my use case is that I am a person with ADHD that often has a both a ton of tabs and a ton of windows open at once.

Here's my thinking on how i try to keep organized

Personally I think there should be a broader discussion about what constitutes a "Tab Group" and how it is distinct from as well as how it can interact with the concept of Firefox Windows. I definitely think there is an opportunity to build in a lot of utility for people that have to (or choose to) have their active sessions with a lot of tabs open, and do so in a way that would be complementary with extensions like OneTab.

Is it more useful to continue the conversation here or on the bugzilla bug, @grahamperrin ?

grahamperrin commented 3 years ago

Thanks for asking,

… Is it more useful to continue the conversation here or on the bugzilla bug, @grahamperrin ?

As much as I like conversations to be not scattered, I was simply unaware of (closed) Mozilla bug 1357214 when I raised this issue in GitHub.

It's usually not good practice to make noise in a bug after a decision has been made, however https://bugzilla.mozilla.org/show_bug.cgi?id=1357214#c32 appears to be a milestone in that:

tab groups has become the only WebExtensions area where parity with Chrome is denied (or words to that effect).

I reckon, there's enough there – including a cross-reference to this issue – for Mozilla to hopefully review the design decision.

In the meantime, I might say that GitHub is ideal because comments can be edited, and so on.

HTH Graham

photodiode commented 3 years ago

I have been slowly transitioning my add-on's code to use a tabGroups like API. This API is mostly based on the one from chrome, but with the addition of tabGroups.create() and tabGroups.remove() to try and be more friendly to different use cases. tabs.group() and tabs.ungroup() are also removed in favor of doing it through tabs.move()

Here is a gist I created of the API so far.

My code uses a polyfill to add all the browser.tabGroups methods, events and hijack/insert the groupId into browser.tabs. It also includes additions for browser.sessions to add values to groups. All the actual functions are contained in the background script (addon.*)

I hope this API can help the quest for standard tab groups support in Firefox, or an addon like "multi accound containers".

photodiode commented 3 years ago

Behavior of tabs and groups

Tabs created before any group was explicitly created by the user have their groupId remain unassigned

  1. Should tabs be assigned to the first group created?
  2. Should tabs remain unassigned and groupless until moved into a group by the user?

All tabs should be assigned to the currently active group on creation, or remain unassigned if no group exists

If a user removes all groups what should happen?

  1. Will their groupId be set to unassigned until a new group is created?
  2. Will there always be a default group? (one is always created when the last is removed)