"Scroll Lock" does not work (How to disable automatic scrolling of tab column when manually closing second-to-last tab?)
Discussed in https://github.com/piroor/treestyletab/discussions/3426
Originally posted by DavidAntliff January 4, 2024 It's of course possible to manually close a sequence of TST tabs by clicking the "X" slowly but repeatedly - the remaining tabs, below this position, will shift up one tab position, placing the next tab's "X" under the cursor. A second click then closes what was the next tab. By repeating this, a long sequence of tabs can be closed, with the user reviewing each one as it goes by. This is useful when wanting to close a large number of tabs but with the opportunity to review each one before closing (just in case it's important).
There's an issue when the vertical column of tabs is longer than the browser screen height. On closing the second-to-last tab, the entire list of tabs will scroll itself down such that the tab under the cursor when performing this sequence is NOT the next tab, but one some way above the original tab that was closed. Then the next click, without moving the cursor, closes the wrong tab. Of course if the user is paying attention, it can be restored, the mouse cursor moved, and the process begins again, but it is annoying.
Is there a way to disable the behaviour where closing the second-to-last tab suddenly causes the entire tree display to shift down?
EDIT: In my testing, it was always the second-to-last tab, but I've noticed since, in other windows, that sometimes it's the last tab, and sometimes it's a tab in the middle of the stack. It might be related to the current tab stack scroll position and the height of the tab currently being deleted - not really sure...
As I commented at https://github.com/piroor/treestyletab/discussions/3426#discussioncomment-9053658 TST should locks scroll position of the tab bar on such cases. On the reported situation the feature looks not working.
@DavidAntliff Could you collect debug logs when the problem happens? Steps to collect logs:
- Go to TST's options page.
- Configure debug logs as:
- Development => Debug mode => true (checked)
- Development => Detailed logs => sidebar/scroll => true (checked)
- Development => Detailed logs => all other checkboxes => false (unchecked)
- Go to about:debugging.
- Click "This Firefox" and find "Tree Style Tab" from the list of installed extensions.
- Click "Inspect" button of the "Tree Style Tab" item.
- Click "Console" tab to show logs.
- Prepare large number tabs enough to make the sidebar scrollable.
- Scroll down to the bottom of the sidebar.
- Click the "X" button of the second last tab.
- The sidebar should remain its scroll position and the last tab should move up to your mouse cursor. If you got a result different from this description, please collect logs in the debug console.
For example, here is logs got on my environment:
tst<Sidebar-1>: 16:35:56.381 sidebar/scroll: tryLockPosition
Array [ 173 ]
[common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.447 sidebar/scroll: canBeStickyTabs
Array [ {…} ]
[common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.449 sidebar/scroll: updateStickyTab
Array []
Object { above: [], below: [] }
[common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.450 sidebar/scroll: renderVirtualScrollViewport
Object { firstRenderableIndex: 0, firstRenderableTabIndex: 15, lastRenderableIndex: 32, lastRenderableTabIndex: 165, old: (33) […], new: (33) […], renderOperations: (1) […], scrollPosition: 478, viewPortSize: 743, allRenderableTabsSize: 1184 }
[common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.451 sidebar/scroll: 11 msec, offset = 0 [common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.465 sidebar/scroll: canBeStickyTabs
Array [ {…} ]
[common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.467 sidebar/scroll: updateStickyTab
Array []
Object { above: [], below: [] }
[common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.467 sidebar/scroll: renderVirtualScrollViewport
Object { firstRenderableIndex: 0, firstRenderableTabIndex: 15, lastRenderableIndex: 32, lastRenderableTabIndex: 165, old: (33) […], new: (33) […], renderOperations: (1) […], scrollPosition: 478, viewPortSize: 743, allRenderableTabsSize: 1184 }
[common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.468 sidebar/scroll: 3 msec, offset = 0 [common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.517 sidebar/scroll: tryFinishPositionLocking
Set [ 173 ]
mouseout { target: tab-closebox.closebox
, buttons: 0, clientX: 210, clientY: 746, layerX: 204, layerY: 2 }
[common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.522 sidebar/scroll: => ignore mouseout in the tabbar window itself [common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.539 sidebar/scroll: tryFinishPositionLocking
Set [ 173 ]
mouseout { target: tab-item-substance
, buttons: 0, clientX: 210, clientY: 746, layerX: 11, layerY: 5 }
[common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.542 sidebar/scroll: => ignore mouseout in the tabbar window itself [common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.599 sidebar/scroll: canBeStickyTabs
Array [ {…} ]
[common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.601 sidebar/scroll: updateStickyTab
Array []
Object { above: [], below: [] }
[common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.602 sidebar/scroll: renderVirtualScrollViewport
Object { firstRenderableIndex: 0, firstRenderableTabIndex: 15, lastRenderableIndex: 31, lastRenderableTabIndex: 164, old: (33) […], new: (32) […], renderOperations: (3) […], scrollPosition: 478, viewPortSize: 743, allRenderableTabsSize: 1184 }
[common.js:732:13](moz-extension://587f1195-fadf-4d36-8824-a54e514e12b9/common/common.js)
tst<Sidebar-1>: 16:35:56.603 sidebar/scroll: 4 msec, offset = 0
@piroor acknowledged, I will look to collect some logs.
This issue has been labeled as "stale" due to no response by the reporter within 1 month (and 7 days after last commented by someone). And it will be closed automatically 14 days later if not responded.
@github-actions chill...
Still on my TODO list.
This issue has been labeled as "stale" due to no response by the reporter within 1 month (and 7 days after last commented by someone). And it will be closed automatically 14 days later if not responded.
This issue has been closed due to no response within 14 days after labeled as "stale", 7 days after last reopened, and 7 days after last commented.