New tabs opened in incorrect position when there are some hidden tabs
B (hidden)
\-C
A has a twisty while B does not. Clicking on the twisty collapses C like expected.
\-C
B (hidden)
C should be the next tab of A
C becomes the next tab of B.
This looks a problem of "Tab Unloader for Tree Style Tab". Basically TST hides hidden tabs in its sidebar, but "Tab Unloader for Tree Style Tab" contains a code to remove the "hidden" class from TST's tab in the sidebar and makes the tab visible intentionally: https://github.com/Lej77/tab-unloader-for-tree-style-tab/commit/d55e92d3ce5c496f636881a36694637a91f1fbcb#diff-49afbade97980fbe595a4f98fa509a9eR3599
TST intentionally ignores existence of tabs hidden by other addons. To prevent problems like this, TST appends "hidden" class to such tabs and hides them in the sidebar. Appearing of tab C next to B is a designed behavior of TST - TST expects that the tab B is invisible and C looks to be opened next to A.
so its an expected result of hiding tabs, and there is no fix, because it is working as expected?
On TST side, the current behavior is by design. However, such a conflict is unexpected. So I think that there are two directions of "fix":
Anyway, revealing of hidden tabs on the current version of TST is quite unexpected, and I cannot guarantee anything on such a situation.
ok, i understand, thank you for the response, i will live with the bug, my computer is low on ram, and i have many tabs open at once, so hiding and unloading them, really allows my computer to run faster with less ram overhead from firefox and a hundred tabs open at once.
i have to say, i love your extension! it has made browsing so much better for me, specifically because of the ability to hide my tabs, but still see them. so having to reorder a child tab every now and then, doesnt really bother me any,. and on a side note, it only seems to do this for me after about an hour or so into browsing, before then i can open tabs, without them being ordered incorrectly.
but even after being miss-ordered, i can take the tab out of the group (by using the context menu "move tab to start"/"move tab to end" option), then manually dragging the tab back to the correct parent tab. it usually then stays where it is supposed to be.
I've introduced changes to determine the position to insert tabs. I hope that those changes solve this problem.
Thank you for updating!
Opening a link as a new child tab seems to work correctly on a new profile now.
But on my old profiles, some parent tabs still open link as child tabs in incorrect position. I can't reproduce this behavior in a new profile, though.
However, I have found that pressing Ctrl+T to open a new tab may open the new tab in incorrect position in some cases:
TST and Tab Unloader for Tree Style Tab.Behavior for new tab actions (other toolbar buttons, keyboard shortcuts, and others) to Open new blank tab as a child of the current tab.Tab Hiding and grant tabHide permission.A (new tab)
\-B (new tab)
\-C (new tab)
\-C (selected)
\-B
\-C (selected)
\-B (unloaded)
\-C (selected)
\-B (unloaded)
\-D (child of C)
Also reproduced this problem with TST+Hide Tabs with similar steps.
@Kenqr Thanks, the case should be fixed with the commit a55011e.
I close this because outdated.
Thank you for updating, but I was still having problem in some situations.
I didn't report this because I couldn't reproduce the problem in a new profile until today.
I am not sure if you fix bugs about changing about:config. If you do, here's the steps to reproduce the problem:
TST and Tab Unloader for Tree Style Tab.Tab Unloader for Tree Style Tab, turn on Tab Hiding and grant tabHide permission.about:config, change browser.tabs.insertAfterCurrent to true.\-B
A (selected)
\-B (unloaded)
Ctrl + TAlt+Enter.C (selected)
\-B (unloaded, child of A)
Behavior for new tab actions (other toolbar buttons, keyboard shortcuts, and others) to Open new blank tab as a child of the current tab.A (selected)
\-B (unloaded)
Ctrl+T works correctly now, but opening a new tab form address bar or bookmark still has the same problem.C (selected)
\-B (unloaded, child of A)
Tested on Firefox 67.0.1 and Tree Style Tab 3.0.15
Thanks. I hope that this has been fixed with the commit 9cdeafb. However there are some unknown regressions, so I need to do more dogfooding.
@Kenqr can you comment if this is resolved or not? If so, can you close?
I were not aware that I can close issues created by me. Thanks for reminding me.
I think the issue is resolved, thanks for updating.
But I have found another issue around new tab behavior.
Although it has nothing to do with hidden tabs, it is also about changing browser.tabs.insertAfterCurrent, so I will post it here without creating a new issue.
TST.Behavior for new tab actions (other toolbar buttons, keyboard shortcuts, and others) to Open new blank tab as a child of the current tab.about:config, change browser.tabs.insertAfterCurrent to true.Ctrl+N to create a new window and then Ctrl+T to create a new tab.\-B
B (focused)
A
Ctrl+T, and new tab C did not become a child of B as it should. (C will become a child of B correctly if browser.tabs.insertAfterCurrent is set to default value false.)C
A
@Kenqr thanks for the update. I am glad to hear the first issue is resolved.
I also use browser.tabs.insertAfterCurrent = true AND Behavior for new tab actions (other toolbar buttons, keyboard shortcuts, and others) = Open new blank tab as a child of the current tab but normally don't use CTRL+T at all.
In my brief testing of your scenario, I see something even stranger.
CTRL+T to create new TAB B. The new tab is created as a sibling, not a child for me.B
Open Link in New Tab, I get a child tab (B) as I would expect. Even without leaving TAB A, if I NOW click CTRL+T I get child TAB C. The strange behavior is that CTRL+T behaves differently (for me) depending if there is already a child tab or not.---C
---B
@Kenqr The behavior you said was an intentional result, introduced as a fix for #2054. However I've realized that TST can treat new tabs opened next to the current tab with the option of Firefox more better, with the commit 2de79a2. Now new tab opened with Ctrl-T becomes the next sibling or the first child when you set browser.tabs.insertAfterCurrent=true, even if you choose "as sibling" or "as an independent tab" for the new tab option of TST.
@Kenqr how are things with the current version of TST?
I think the previous issue is fixed. Thanks for updating.
But I found another problem (again).

Steps to reproduce:
TST and Tab Unloader for Tree Style TabTab Hiding and grant tabHide permission.A (unloaded)
\-B
\-C
A (unloaded, root)
C (another root)
\-B (child of A)
General/Startup/Restore previous sessionC
B
I have lost part of my tree structures a few times before, and I think that corrupted tree structures could be the cause of it.
@Kenqr I've confirmed that it happens when TST keeps tree structure for hidden tabs. With the commit 46d1ea2 TST allows you to attach a dropped tab to hidden parent tab, because sometimes there are hidden parent tab like your case.
I think the issue is resolved now.
Thank you for updating for those minor use cases.
I have found that tabs may appear at wrong position after drag & drop recently, probably related to recent updates.
Steps to reproduce:
TST and Tab Unloader for Tree Style TabTab Hiding and grant tabHide permission.
TST version 3.2.5
Firefox version 70.0.1
In addition to that, tab may disappear after drag & drop in my main profile, but I can't reproduce this in a new profile.
@Kenqr can you confirm if you are still seeing the problem with current Firefox and TST?
Yes, I'm still seeing this problem in TST 3.3.5 and Firefox 72.0.2.
@Kenqr Sorry for this large delay. I've introduced some changes to fix odd behaviors at cases like yours. I hope the problem goes away...
@Kenqr, have you had a chance to try out 3.3.6? Any improvement?
After testing, I think the issue is solved in 3.3.6.
Thank you for updating!
Most helpful comment
@Kenqr The behavior you said was an intentional result, introduced as a fix for #2054. However I've realized that TST can treat new tabs opened next to the current tab with the option of Firefox more better, with the commit 2de79a2. Now new tab opened with Ctrl-T becomes the next sibling or the first child when you set
browser.tabs.insertAfterCurrent=true, even if you choose "as sibling" or "as an independent tab" for the new tab option of TST.