New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conflict with "Simple Tab Groups" : Tree structure flattened when opening new window #2546
Comments
Confirmed, but I think this is hard to be fixed only on TST side. I'm not familiar to the implementation how Simple Tab Groups switches groups across windows, but they addons look to break each other on this situation. The most easiest way to make they compatible is: modify STG to get/set tree structure via TST's API. TST already has APIs for such a purpose but they were undocumented. So I've written the spec of
But I cannot force it to the author of STG to use these APIs, because TST is not the only one tree addon, because there are more other similar tree addons, and the STG author needs to write compatibility codes for each... |
@Elaws I used Windows Sandbox, loaded Firefox and added TST and STG, created 4 groups, assigned a keyboard shortcut for each and was able to switch between each group of test tabs and didn't lose any of my tree hierarchy. I am wondering if it is possibly something else is interfering with your situation. Have you you tried a new profile with just TST and STG to see if that works? |
@irvinm I'm not sure if you reproduced the steps : after creating a tree structure in each of your tab groups, did you open a new Firefox window (since STG requires "Restore Firefox previous session", all your groups and tree structures should remain in this new window), switched between tabs groups and closed one of the two opened windows (steps 5 to 7) ? Please let me know if the bug does indeed happen in this situation ! |
Oh, I missed that! I'll give it a go ... |
Ok, I see what you are saying now and I can reproduce. It appears that is really has to do with the situation where STG is creating a group in a new window for the first time. In this case, STG seems to simply store and restore the set of tabs without setting the parent (openerTabId) when loading a new group in a window for the first time. This also explains why everything works fine in the initial window I saw (all the tabs had their relationships properly created in that window) and also why all of this would continue to work even if you restarted the browser (assuming "restore previous session" was enabled) if you were only dealing with one window. It would appear to me that STG would need to make changes on their end to get this to work. Tab Session Manager (session manager) had a similar issue a long time ago and had to add support for openerTabId parameter in tabs.create() in order to preserve the tree hierarchy. If the addon developer doesn't care about relationships, they can just create the group without the parent information which seems to be the case here. I don't think there is anything @piroor will be able to do for this situation. |
Thanks for your feedback @irvinm. Should have done it earlier but I will report this issue to STG's author. |
@piroor immediately after moving after ~ 200ms the call to I made a delay of 200ms before the call P.S. Thanks |
P.P.S. |
I've faced this issue as well, what I thought in my head is why not making the ability to hide/unhide and reload/unload with the ability to mark all tabs opened in a selected tree, in this addon? If it was the case then i'd just make trees for everything in the Tree Style Tab addon and remove the Simple Tab Groups addon. |
@Drive4ik Wow! That's a good news!
I'm sorry I forgot details about how TST updates treestyletab/webextensions/background/handle-tree-changes.js Lines 195 to 203 in 244b0ff
openerTabId ) and 2) restructured after all tabs are completely moved (TST sets openerTabId based on restored tree structure). The second screenshot means you are now between steps 1 and 2. Due to the bug https://bugzilla.mozilla.org/show_bug.cgi?id=1409262 modified openerTabId is not notified to addons, so we cannot know the time: when the internal openerTabId of Firefox's native tab is really updated and becomes accessible via WebExtensions API. This is the reason why you currently need to wait for 200 msec (or more/less) to get the final openerTabId value.
Anyway, we need to keep it in our mind that (And, the best way is fixing of the bug https://bugzilla.mozilla.org/show_bug.cgi?id=1409262 on Firefox side.)
I think this is a generic performance problem. Currently I can't imagine how to solve this problem. I think it possibly requires fundamental restructuring like https://addons.mozilla.org/firefox/addon/ftt/ |
@mtnjustme This is due to the project policy of TST. TST is concentrated to provide very basic tree management features, and other useful features fundamentally unrelated to "tree of tabs" should be provided by other feature-oriented addons. TST is expected that it should work with other tab related addons seamlessly. If there is no existing addon for a required feature, I sometimes develop such a helper addon by my hand. |
I seem to still be having this issue, but I'm not sure if I missed something. Just to double check @Drive4ik, did you push your fix to your addon and/or did the other bug you mentioned prevent it from working? Also, I wanted to clarify something I noticed with one of the other posts. It seems like the only factors that effect whether the trees in a group get flattened are the window the group was last opened in and whether or not that window is still opened. So, if I have two windows and I create a test group in the first window, then switch that window to a different group and open the test group in the second window it'll keep its tree structure. If I then close the second window and reopen the group in the first one, it'll have a flattened tree structure, even though it was originally from the still open window and no changes have occurred. Similarly, changing the second window to a different group, before closing it, will not change how the test group gets handled. Conversely, if I create a second test group in the second window, then open it in the first window, and then close the second window, the second test group's tree structure be just fine. This holds true even if I switch away from the second test group before closing the window. |
@Elaws is this still an outstanding issue? If not, can you close this item? |
@irvinm Sorry for this late reply. I just read the previous posts and am not sure if the issue should be solved by now ? On my side, the issue can still be reproduced. @EpsilonRose Did you have some update from Drive4ik ? |
This fix will be released with STG 4.5.2+ |
@piroor Here is my code that makes Can you take a look at it and advise how it can be improved / fixed? Unless, of course, for this you do not need to write TST Lite in the STG addon 😄 |
Hmmm... If the problem is caused from the fact "STG updates
Both solutions have merits and demerits. "A" looks robust but it needs more changes to STG. "B" is completed in TST side but I'm afraid that it can eats CPU resource periodically. |
I forgot to think about the third option:
@Drive4ik How about this idea? |
Here's what I thought, the "problem" of synchronization and determination of the parents of tabs happens on the TST side, because STG creates a tab, and only then updates the
That is, if STG creates tabs at once with the required |
@piroor Can you please check this bug on STG 4.5.5? |
@Drive4ik Thanks! I've tried Nightly 84.0a1 + TST 3.5.34 + STG 4.5.5. Sadly I've confirmed that tree structure is lost after switching of groups. On my environment, original tree is:
After they are moved to another window, they become:
After investigation, I've realized what happens.
This problem is solved when I deactivate this handler:
|
@piroor This problem persists even without the STG addon. Try to select all the tabs from the tree that you described above using Shift + Click on tabs on topbar, and move all these tabs to another open window. |
The commit 88cc871 should fix the problem I commented above. But I still see another problem triggered with session restoration and I'm investigating it... |
…for tabs when they are moved across windows #2546
Finally I've understood that TST had serious problems around restoration of the tree structure for tabs moved across windows. TST unexpectedly tried to "restore" the tree structure saved to the session data when tabs are moved across windows every time, and it can break the current tree structure constructed after they were restored (automatically by STG or manually). This unexpected behavior is now suppressed with recent commits 26be464 and 1f47265. |
@Elaws have you tried things with the latest versions of each addon? Are we at a point where this is working and you could close out this issue? |
Hi @irvinm, I can still reproduce the issue with the latest versions of each add-on : I have not tried yet on a blank Firefox profile, so if you can't reproduce it's perheaps due to options of my add-ons ! The problem is a bit different now though : the tree structure is not completely collapsed as before, but the order of the folders is mixed (and all the icons of the tree have disappeared, so you have to refresh it to get them back, as before). If I had the following structure :
I may get the following after :
For this to happen, as described in the original post :
Sidenote : If you happen to use shortcut of tab group n°1 in window 2, focus will switch to window where the tab group is already open, that is window 1 : this is a feature you may or may not want (if you open another window, you may want to keep focus in that window), but it is another subject
|
@Elaws I couldn't reproduce this case. I prepare tree with the structure and move those tabs across windows with STG, then I got the original structure as expected, even if such moving of hidden tabs happens for pending tabs for me. |
@piroor I just tried with a new blank Firefox profile and can reproduce the bug : this time, the original tree structure is completely flattened, as described in the first post. Closing the second window is an important step to reproduce the bug, along with using keyboard shortcuts to switch between tab groups.
|
@Elaws Thanks, I've seen a problem with these steps:
As described above my result is flat tabs instead of mixed tree. I've checked debug logs of TST. Logged events at the step 4 are:
Next I've tried collecting debug logs on STG. The log says that when "New tabs are opened in the W2 (by STG). They have no |
I've found why I've tried steps to reproduce with the latest TST containing the fix, and sadly I still see flattened tabs in G2 at W1 after W2 is closed. STG's debug log says that G2 tabs moved from W1 to W2 have their own id as their Safe steps to restore tabs with their structure including workarounds to update cached tab information by STG are:
|
Finally I've realized that |
Yes, this is the problem I tried to describe in the original post, perheaps not precisely enough ! I thought you had already reproduced this problem. |
@Drive4ik have you looked at the pull request yet? |
@Elaws given there isn't anything more to do on the TST for now, we are waiting for the pull request to be evaluated. Unfortunately, there hasn't been any progress on that side and no check-ins since November. Could you close this item and when the pull request is incorporated (in some form) and if it still doesn't work, we could always reopen this issue. |
@piroor there haven't been any check-ins to "Simple Tab Groups" since November 2020. Maybe it would be best to close this item and if the pull request is ever merged or discussed we can discuss it here or in a related issue. |
Hello, No news concerning the pull request to this date : is there a simple way to merge your code into the main of STG and build ourselves ? Perheaps there are better solutions nowadays than TST/STG combo, but I've yet to investigate. Thanks |
@Elaws The author does some commits at May in this year, so the project looks not stopped yet. However, if you seriously need the change I did, you need to fork the STG repository, merge my change, and build it by yourself, then you'll load it as a temporary addon via about:debugging. If you hope to install it as a regular addon, you need to upload the forked version STG as a new private extension. |
…-across-windows Keep openerTabId of tabs moved across windows piroor/treestyletab#2546 (comment)
Just a quick note to let you know that the problem is still occurring. The tree and tab group structure is regularly not restored properly on Firefox startup. In addition to that, when restored from a STG backup, trees are flattened and groups of tabs made in a tree aren't recovered. I've not found yet a better combo than TST + STG (tried sidebery lately, but you have to manually restore previous session each time), so it'd be wonderful if tree and tab group structure was not so often disorganized. I've seen some STG commits from @Drive4ik 4 days ago, so maybe some collaboration is possible if the problem is confirmed. Thanks ! Workaround for now : Manually restore a backup ( |
Short description
Tree structure is flattened when a new Firefox window is opened, with "Simple Tab Groups" extension installed.
Steps to reproduce
Folder A
-- URL i
-- URL ii
Folder B
-- URL i
--- URL ii
-- URL i
Open a new Firefox window and switch between tab groups defined in "Simple Tab Groups" using your shortcuts.
Close one of the two opened Firefox windows.
Switch between tab groups in the remaining Firefox window : one or all the trees created in TST may display the following message (it is possible that these messages are displayed at step 6) :
Expected result
The tree structure should not be modified.
Actual result
No matter which answer you choose in step 7, one or all of your trees are now flattened :
Folder A
Subfolder 1
URL i
URL ii
Folder B
Subfolder 1
URL i
URL ii
Subfolder 2
URL i
TST + "Simple Tab Groups" is very useful but since opening a new Firefox window is a frequent use case, tree structures keep getting flattened.
Environment
The text was updated successfully, but these errors were encountered: