Change TabBar behaviour when opening links from the last tab

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
Wezarus

Change TabBar behaviour when opening links from the last tab

Unread post by Wezarus » 2015-03-11, 20:10

Hello, since this is my first post, a big thank you is in order for your continued development of Pale Moon! I have been using it for a while and it has been a really enjoyable experience.

That being said, there is something that has been a constant source of annoyance for me. I usually have lots of tabs open and regularly use the following work flow:

1. Open enough tabs to fill the tab bar's width.
2. Select the last tab.
3. Do a search for something.
4. Open a few links from the current tab in new tabs.

The current behaviour of the Tab Bar is that the right scroll bar arrow flashes briefly, a really tiny part of the next tab is shown and the right scroll arrow lights up a little. That is all the indication that there are more tabs to the right. This is really inconvenient for me and I often end up opening some links twice, because when I look at the Tab Bar, it shows me the current tab is the last, which is no longer the case.

For this reason, I propose the following change:
  1. Whenever links are opened in new tabs from the last tab, scroll the Tab Bar to make the new tabs visible (in part like the new Opera with Blink is doing, except it decreases the width of each tab instead of scrolling). This would ideally be optional, in case someone dislikes it.
  2. If the user opens enough tabs, so that scrolling the Tab Bar would make the current tab (the source for the new tabs) fall out of view, instead do this:
    1. when there are enough new tabs, so the current tab becomes the left-most one, don't scroll the Tab Bar any more, but use the default behaviour (just flash the right scroll arrow).
Speaking of the scroll arrows, in my opinion, they currently do a very poor job of communicating to the user that there are more tabs to the left/right. The reason why is because in the default Pale Moon theme, their "disabled" state (no more tabs in the corresponding direction) is practically visually indistinguishable from their "enabled" state (there are more tabs in the corresponding direction). This makes it impossible to just glance in the general area of an arrow and immediately tell whether there are more tabs in that direction or not.

I know this is fixable by using userChrome.css to replace the arrows' background colour with one contrasting with the end result of the OS visual style and browser theme combination, but doing this, the flashing effect of the right arrow background is no longer visible, when new tabs are opened outside of the visible part of the scrollbox. Maybe the fault lies in the .CSS I'm using? Here is the code:

Code: Select all

.tabbrowser-arrowscrollbox > .scrollbutton-up:not([disabled="true"]){
   background-color: rgb(150,250,180) !important;
   opacity: .8 !important;
}

.tabbrowser-arrowscrollbox > .scrollbutton-down:not([disabled="true"]){
   background-color: rgb(150,250,180) !important;
   opacity: .8 !important;
}
Another thing regarding the right scroll arrow. When it transitions from one state to the other ("enabled" to "disabled" or vice versa), there is a short fade animation, which doesn't happen for the left arrow. The animation in question is much more visible with changed arrow background and irritating in my case, since I have turned the smooth scrolling of the Tab Bar off (toolkit.scrollbox.smoothScroll=false). Is there a way to turn it off and if yes, how?

Thank you for reading what turned out to be quite a lengthy post!

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35636
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Change TabBar behaviour when opening links from the last

Unread post by Moonchild » 2015-03-11, 20:55

Briefly (since I don't have much time right now to examine in detail) addressing your core issue:
The behavior you describe isn't what the browser is supposed to do. What should happen when opening a new tab from a link in the last tab (in the background) is:
1. The currently active tab moves left if it isn't left-most yet
2. The new tab is opened to the right of it, and is in view unless there are too many tabs already between the active tab and newly opened tab
3. When the currently active tab is left-most on the tab bar and the bar is otherwise full, the "arrow flash" as described is used because the new tab is opened "out of view"

This should all be exactly as desired already.
Perhaps what you are looking for is that the newly opened related tabs are opened adjacent to the opener, in which case you should select "insert related tab next to the current tab" in Options -> Tabs, but even if not, then the behavior as described above would apply.

The disabled and enabled state of the scroll arrows is also clearly visible in Pale Moon:
Image4.png
Image4.png (1.77 KiB) Viewed 1260 times
I'm therefore not sure where this operational issue would be coming from in your case.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Wezarus

Re: Change TabBar behaviour when opening links from the last

Unread post by Wezarus » 2015-03-11, 21:43

It seems the culprit was an about:config preference: I had "toolkit.scrollbox.smoothScroll" set to "false". This disables (after a browser restart) the smooth scrolling when you hover the mouse over the tab bar and use the mouse wheel. The very unexpected side effect is that is also disables the above-mentioned tab bar autoscrolling.

Is there a way to not have a smooth-scrolling tab bar and have it autoscroll when opening links from the last tab?

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35636
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Change TabBar behaviour when opening links from the last

Unread post by Moonchild » 2015-03-11, 21:59

The smooth scrolling is unfortunately directly tied in with the way the tab bar is automatically scrolled. Please note that disabling smoothscrolling in scrollboxes has more impact than just the tab strip, as well, since it's a global toolkit setting.

I'll see if there is a way to have both, but I'm afraid that with the current code the answer might simply be "no" because it relies on the asynchronous handling of the scrollbox with that setting enabled.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Supernova

Re: Change TabBar behaviour when opening links from the last

Unread post by Supernova » 2015-03-12, 00:35

With the official pale moon theme and the moon under the right arrow, the difference between states is not very clearly visible. But that's more a theme issue.

Locked