Skip to content
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

[Bug] Tab numbering is incorrect (remains static) above a certain tab count #3486

Closed
Decohero opened this issue Mar 14, 2024 · 4 comments
Closed

Comments

@Decohero
Copy link

Abstract

This bug affects the tab numbers displayed on the tabs when the CSS contains a tab counter as shown in the documentation example, which has worked for many years without modification.

When there are more than a certain number of tabs (in my case, 133 on one system and 113 an another), scrolling the tab list beyond the point where that tab number is at the bottom will cause TST to redraw the tab numbers such that the bottom tab always has that same number (e.g. 133), and the rest of the tabs above it descend sequentially.

So for example, if you have 1000 tabs, scrolling to the bottom of the list should show tabs 950-1000, numbered 950-1000, but they are instead shown numbered 64-113. The correct numbers appear while scrolling, but are quickly redrawn with the incorrect numbers.

Steps to reproduce

If needed, add the tab numbering CSS to the tab display field in the config panel:

#tabbar {
  counter-reset: vtabs atabs tabs;
  /* vtabs tracks visible tabs, atabs tracks active tabs, tabs tracks all tabs */
}
.tab:not(.collapsed):not(.discarded) {
  counter-increment: vtabs atabs tabs;
}
.tab:not(.collapsed) {
  counter-increment: vtabs tabs;
}
.tab:not(.discarded) {
  counter-increment: atabs tabs;
}
.tab {
  counter-increment: tabs;
}

.tab::after {
  background: black;
  color: Orange;
  opacity: .7;
  content: counter(tabs);
  font-size: xx-small;
  right: .1em;
  padding: 0.1em;
  pointer-events: none;
  position: absolute;
  bottom: 0.1em;
  z-index: 200;
}

.tab .active-marker::before {
  background: Highlight;
  color: HighlightText;
  content: counter(vtabs);
  font-size: x-small;
  right: 0.2em;
  padding: 0.2em;
  pointer-events none;
  position: absolute;
  bottom: 0.2em;
}

Then create enough tabs to observe the bug. It would seem that the number of tabs needed to show the bug is dependent on how many tabs are visible on your screen (i.e. tab height). 150 tabs should be plenty.

Then scroll the tab list to see if the tab numbers stop incrementing after a point.

Expected result

Properly-numbered tabs.

Actual result

Improperly-numbered tabs (which stop incrementing after a point).

Environment

I suspect that this behavior appeared with a recent Firefox update. Both affected systems are running the current TST: 4.0.3 (2024.3.13) and the current Firefox (115.8.0esr). One system is Mac OS 12.6.2 (Monterey), and the other is Windows 10 22H2 (19045.3448). The previous version of TST was also affected.

@piroor
Copy link
Owner

piroor commented Mar 14, 2024

In short: CSS counter hack is not available anymore and we need to use a helper addon. See also the discussion: #3472

Copy link

This issue has been closed due to no response within 7 days after labeled as "wontfix", 7 days after last reopened, and 7 days after last commented.

@Decohero
Copy link
Author

Decohero commented Jun 1, 2024

I had been expecting a tab counter extension based on the TST API to appear, but I never saw one. The absence of an accurate tab count has been so disruptive to my workflow that I tried creating one myself. It's not perfect, but for those few who may require this feature, it seems to work well enough:

Plugin here:
https://addons.mozilla.org/en-US/firefox/addon/tst-tabcount/

Code here:
https://github.com/Decohero/tst-tabcount

@roman-orekhov
Copy link

@Decohero
Thank you!
The tab count hides folded tabs count, close button and muted tab signs however (which all appear on the far right of the tab). Is there an easy fix one can make in background_script.js to overcome this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants