Automatically Expand Tab Stack in Window Panel for Active Tab
-
The window panel's tab stack expands automatically
New feature suggestion: the tab stack where the current page is located is automatically expanded
At present, the tab stack of the window panel is not expanded by default.
to sum up:
- Automatically expand the tab stack where the current webpage is located
-
This would make sense for anyone who uses the window panel to manage tab stacks. The request would be clearer as:
Automatically Expand Tab Stack in Window Panel for Active Tab
-
@Pesala The title has been corrected
I may need to work harder to become familiar with English. I ca n’t clearly describe my thoughts in English yet
-
Question to those users who know how to do this stuff.
Is this IMO highly-desirable enhancement able to be achieved by a custom js mod [i pretty much presume that custom css is completely inapplicable here], or do we remain entirely in the hands of the V Devs & their preferences + timetable?
-
@Steffie Unfortunately the "tree views" in Vivaldi are written using some arcane form of react with a lot of nested
<div>
s. So I suspect CSS will be of no use.Even for writing a JS mod I'm not sure how I would even go about doing it, as it's not even a proper tree, the tabs you'd want to show don't even exist in the panel until a particular stack is "expanded".See below.
-
@Steffie I thought you don’t want to use any (JS) mods after this:
I stopped following all the posts on UI mods many months ago, coz i realised it was mostly just too far over my head [also, there seemed a certain Sisyphean air about it / a clever user mod would appear, then a later V/chromium change would break it].
It isn’t possible via a normal mod, but it is via a hook:
// Auto-expand window panel tree to active tab on tab switch vivaldi.jdhooks.hookClass('tabs_WindowTree', cls => { const PageStore = vivaldi.jdhooks.require('_PageStore'); class newCls extends cls { constructor(...e) { super(...e); this._onPageStoreChanged = () => { !1 === this.blockPageStoreChange && this._onFilterChange(this.props.filter, () => {}); const e = PageStore.a.getActivePage(); e.pinned && (this.lastActivePinnedId = e.id); this.refs.treeList.expandToId(e.id); } } } return newCls; });
-
-
@potmeklecbohdan said in Automatically Expand Tab Stack in Window Panel for Active Tab:
I thought
Yes & you were absolutely correct in that belief [you sly detective, you]. I definitely do not know how to do custom js myself, & tbh really do find it above my head. Yet as you saw above, earlier today i strangely asked that question anyway -- why? It's specifically a measure of my desperation / desire to have V's Window Panel become as close as possible to the superb functionality of TreeStyleTab AO in FF. During my months away from V i discovered & fell in love with TST, & really miss it now i'm back in V.
but it is via a hook
Well, i do not know them either, but i see that you provided a link. Tomorrow i shall read it & try to learn, but tonight i say... thank you!
-
@potmeklecbohdan Neat. Those links are a very nice writeup.
-
@potmeklecbohdan said in Automatically Expand Tab Stack in Window Panel for Active Tab:
It isn’t possible via a normal mod, but it is via a hook
It's taken me much of the day & evening, but finally i managed to blunder my way through grasping how to use the brilliant @den_po
Hooks
do-thingies, and how to modify the brilliant @Gwen-DragonPatchVivaldi.sh
bash script, so from now on i'll only need to run One Script To Rule Them All, each V update.So then i tried to use your innovative
// Auto-expand window panel tree to active tab on tab switch
script per above. I copied it verbatim into a text file, saved it as/opt/vivaldi/resources/vivaldi/hooks/Auto-expand-window-panel-tab-tree.js
[i'm testing all my learning-experiments first in Stable, before later intending to apply to Snapshot], then launched V-Stable. Oh, whoops! It appears with a blank window & gobbledegook in the panel instead of the proper panel content.Clearly i have misunderstood the proper way to apply your code. What should i have done pls, instead of my obviously incorrect method?
UPDATE:
It transpired that the above method does not [yet] work in Stable, but does work well in Snapshot. Yay. -
@potmeklecbohdan said in Automatically Expand Tab Stack in Window Panel for Active Tab:
const _111 = vivaldi.jdhooks.require(111);
Don't import modules by number in public mods, they may change easily. This one is small enough to copypaste its import
-
@den_po I wasn’t sure if it changes at some point. Can I safely substitute that
_111
with() => {}
?Edit: It’s really used just as a placeholder. Of course! Check first, ask afterwards! Updated the code.