piroor / treestyletab

Tree Style Tab, Show tabs like a tree.
http://piro.sakura.ne.jp/xul/treestyletab/
Other
3.48k stars 279 forks source link

Tab counter is broken in latest update #3540

Closed HighCommander4 closed 4 months ago

HighCommander4 commented 5 months ago

Steps to reproduce

  1. Update to today's TST version (4.0.14)
  2. Use the steps at https://github.com/piroor/treestyletab/wiki/Code-snippets-for-custom-style-rules#tab-numbering-and-counting to show a tab count, for example:
#tabbar {
  counter-reset: vtabs atabs tabs;
  /* vtabs tracks visible tabs, atabs tracks active tabs, tabs tracks all tabs */
}
tab-item:not(.collapsed):not(.discarded) {
  counter-increment: vtabs atabs tabs;
}
tab-item:not(.collapsed) {
  counter-increment: vtabs tabs;
}
tab-item:not(.discarded) {
  counter-increment: atabs tabs;
}
tab-item {
  counter-increment: tabs;
}

:root.simulate-svg-context-fill .newtab-button::after {
  content: var(--tab-count-text);
  pointer-events: none;

  width: 100%;
  /* TST 2.4.0 - Fix for Issue #1664 */
  background: transparent !important;
  mask: none !important;
}

.newtab-button {
  --tab-count-text: counter(tabs) " tabs";
}

Expected result

Total tab count is shown in the new tab button.

Actual result

A smaller number is shown, and it changes as you scroll.

Environment


I assume the CSS needs to be updated to reflect a change in the add-on, but I'm not sure what the update should be.

piroor commented 5 months ago

This is a known restriction of TST 4.0 and later. https://github.com/piroor/treestyletab/blob/trunk/history.en.md

  • 4.0 (2024.3.7)
    • Improved performance on cases with large number of tabs. Now tabs only in the viewport are rendered. (snip)
    • Due to this design change, customization with CSS counter won't be work as expected anymore. You'll need to create something helper addon to do such customizations.
piroor commented 5 months ago

As described at the changelog, CSS's counter customization no longer available, so you need to develop something helper addon to provide effective counter.

github-actions[bot] commented 4 months ago

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.

rixx commented 3 months ago

FWIW, I built an addon that adds a tab count to the "new tab" button, if that helps.