ReDEnergy / SessionSync

SessionSync
Mozilla Public License 2.0
296 stars 31 forks source link

Add support for Tree Style Tab #43

Open 3d73a4a412 opened 6 years ago

3d73a4a412 commented 6 years ago

First, great addon, thank you so much for being a viable alternative to the venerable session manager. Second, I wanted to "second" some of the items you already have on your todo list:

Full save support for pinned tabs - YES!
Support Firefox containers - YES
Better support for multi-windows sessions
    Option to merge windows when saving - Would be nice
Improved configuration for auto-saving
    Rolling buffer instead of overwriting the same session slot
Improved active-session management
    Drag and drop to organize tabs (order, move to a new window) - Would be nice
    Merge widows using drag-n-drop
    Automatically discard tabs after a certain time (should be configurable)

I would like to request something that has been critical for me and so far no sesison managers handle it cleanly, support for Tree Style's trees. That is if I have a few tabs stacked in a "tree", I was able to restore that tree (without extraneous new tabs appearing which one of the session managers that kind of remembers a tree structure does) with Session manager. One of the things I love about your addon is it uses bookmarks so is easier to manage and much more portable so I am really really really hoping that tree style integration can be done.

ReDEnergy commented 6 years ago

Hi, thanks for feedback. How do you actually stack tabs in tree style? Are you using Tree Style Tab ? From what I know Firefox itself does not support the concept of tree tabs. The only think you can know is which tab opened a certain tab. This can provide you the information required to recreate the tree structure but from this point all features and behaviors are simply implemented by the developer.

What that means... well if I try to provide this feature, I won't be able to know any change that another addon does to his own tree structure representation. The only way this might work is only if I provide a full featured tree style tab implementation inside my addon and you will only use that one for various operations such as (reorganizing the tree)

So basically... I might be able to do that, I can't know for sure how hard is for me to implement It does create a few issues:

krakentoa commented 6 years ago

Tab session manager ( https://github.com/sienori/Tab-Session-Manager ) is an addon that is compatible with Tree Style Tabs ( https://github.com/piroor/treestyletab ). However it does not sync across devices. The API seems simple when saving bookmarks... https://piro.sakura.ne.jp/xul/_treestyletab.html.en#api-bookmarks There is some discussion of how TST restores state here : https://github.com/piroor/treestyletab/issues/1662#issuecomment-361626926 It appears it would be sufficient to restore/save the field openerID (i.e. an id for the parent of the tab in the tree) on each tab, and reopen the tabs by order (which will open parents before children). Opening by order seems to be more problematic, since apparently there is a configurable delay so that TST can catch up. Here's a bit of code from TSM: https://github.com/sienori/Tab-Session-Manager/blob/e4a4aaf5ab5b0136d357222f828c7c6ad2a446f2/Tab-Session-Manager/background/open.js#L178

let openDelay = 0;
    if (S.get().ifSupportTst) {
      if (BrowserVersion >= 57) createOption.openerTabId = tabList[property.openerTabId];
      openDelay = S.get().tstDelay;
}
ReDEnergy commented 6 years ago

Mmm... thanks for pointing out all those resources. As for the request to support Tree Style Tab... as long as the addon knows this information just from how I open the tabs then this should be fairly straight-forward I would say (in reality nothing is that simple) but I think that it should be possible. I will try to have this in mind and investigate how TST works exactly. I might be able to prototype something and if it works I will definitely add the feature. (Can't really promise right now when I will do that but I might be able to test the idea this week)

TehCorwiz commented 5 years ago

Hi @ReDEnergy! I wanted to thank you for making this extension.

I wish I had more to add, but I really just came here explicitly to request this feature. :sweat_smile:

As an aside, I was reading through the reviews on the Firefox extension page while deciding which extension to use and I was impressed with how you responded to questions and problems. In fact, it's what made me choose this one above the others. Keep being awesome. :1st_place_medal:

ReDEnergy commented 5 years ago

@TehCorwiz Thanks for using the addon. As regarding the request, I feel pretty bad when I see how times goes on (so fast) and so many features I want to add are still missing. I would love to have this implemented but sincerely I have no idea when I will be able to do so. I would say there are a few others that have been waiting for far longer and have a higher priority. At the same I do really hope to have a little more time in the near feature since the last few months were packed 150% for me and had little time to invest into the addon.

TehCorwiz commented 5 years ago

@ReDEnergy I've been there and completely understand. No worries at all. I have the utmost respect for people who volunteer their time or release their own tools. If I get some time maybe I'll hack on it myself. Are you open to PRs if someone else were to get it working?

ReDEnergy commented 5 years ago

PRs are welcomed. Of course, that being said, I wouldn't say that the code is really hard to read, but when you don't have comments, the 20K of vanilla JavaScript with HTML purely generated from JavaScript and half of the DOM in position absolute can get pretty complicated :). Of course, If you ask me, I had to do all this in order to achieve the target performance as well as to implement all the features that the addon does right now.

lesar commented 3 years ago

Me too use "Tab session manager" integration on "Tree Style Tab" and they work great together.
"Tree Style Tab" help to divide a problem in sub problem or show manual index page and show all opened sub page, ...
I like the idea behind SessionSync and it will be wonderful if SessionSync can be work together "Tree Style Tab"