aminomancer / uc.css.js

A dark indigo CSS theme for Firefox and a large collection of privileged scripts to add new buttons, menus, and behaviors and eliminate nuisances. The theme is similar to other userChrome stylesheets, but it's intended for use with an autoconfig loader like fx-autoconfig, since it uses JavaScript to implement its more functional features.
Other
326 stars 27 forks source link

[FR] Draggable Pinned Tabs #69

Closed EstherMoellman closed 1 year ago

EstherMoellman commented 1 year ago

Hi @aminomancer!

Please, if possible, we would like to request you a Feature Request: Draggable Pinned Tabs. Our request is not related to any problem. I use "we" because we are part of a group of Nightly users, we love CSS customizations, and also we are hard users of several of your magnificent JS codes. The reason of our request is because we need the Draggable Pinned Tabs, we googled the subject, and we couldn't find any Draggable Pinned Tabs (nor JS code, neither add-ons).

The main concept of our request is:

  1. Remove Pinned Tabs from TabBar
  2. Make Pinned Tabs draggable (capable to be moved at any part of the NavBar - or as an alternative after the UrlBar)

The logic behind the concept above, is to take advantage of empty space at the NavBar, while freeing space for more tabs at the TabBar. Most of the users have lot of unused space at the NavBar, or they have an unnecessary long UrlBar. All these wasted space at the NavBar can be used for Pinned Tabs. In addition to that, users that need lot of of tabs and normally have Tab Manager add-ons, they always will prefer Pinned Tabs on NavBar, simple because Tabs usually are "grouped" (and tab groups may change), but Pinned Tabs always need to be seen (are not necessarily grouped and they don't necessarily need to change group). And for those users with lot of Pinned tabs, it'll be great to move them to the NavBar, so the TabBar will be clean and ready for new unpinned tabs.

Over the past years we saw lot of users asking for Draggable Pinned Tabs, so we believe our request here will be useful for them, and who knows, we hope also will be useful for your current uc.css.js project.

If by chance you can build that feature, please, feel totally free to build it whenever you want or you can.

Thank you!

aminomancer commented 1 year ago

Unfortunately I think there are some significant technical problems with this idea. Tabs are something that only exist in one window. The nav-bar is a customizable area, so it has a state which is basically a list of all the items placed in it, and that state is global. i.e., it is the same in all windows. In order to keep it the same, changes to one window's customization state will affect the customization state in every other window. So the fact that window 1's pinned tabs only exist in window 1 is a problem. There needs to be some logic to decide what to do with them.

Then there's the problem of identification. The positions of your customizable widgets in your toolbars, panels, etc. are saved in ID lists. So, Firefox remembers those positions between sessions because the widgets have static IDs. It knows where to put back-button because of its position in a list of IDs. But how does that work for pinned tabs? Pinned tabs don't have static IDs. They don't have IDs at all. They can't really be given static IDs either, because nothing about them is permanent or static. Their titles change, their URLs change, etc. The only thing that's permanent is the permanentKey to which the tab state is keyed between sessions, but this is an object, not a string.

It would be possible to refactor much of the session restore code so that it stores a permanent string ID with each tab, so that when tabs are restored, they could be restored as toolbar widgets (whose IDs are remembered between sessions). But that is far beyond the capabilities of an autoconfig script.

It does sound like a useful feature, but autoconfig is really for minor quality of life improvements and custom standalone products. This is more of a dramatic change to how tab pinning works. So it's better suited for an enhancement request for Firefox itself. But I think it's unlikely to get a lot of attention, since it's a huge amount of work for not that much of a benefit. The use case you described is already mostly fulfilled by the bookmarks toolbar. Of course the behavior is not quite the same, but it works okay for most users.

EstherMoellman commented 1 year ago

Thank you @aminomancer for such great explanation.

I also learned a lot.

Yeah, from the outside I thought it was something very easy to be done. But after your explanation, now I understand the complexity. Your explanation also might be the reason why we are not seeing add-ons or JS codes with this kind of Draggable Pinned Tabs.

But it'll be nice to see in the future a browser with Dragable Pinned Tabs.

Thank you once again!