Skip to content

[Bug] Attaching children sometimes doesn't update counter #3913

@irvinm

Description

@irvinm

Abstract

I haven't been able to come up with a concrete way to reproduce this yet (continuing), I am seeing times where I create a new tree and the parent's count of the children remains at zero.

  • I use custom CSS to always show the counter even if tree is expanded. (I like to know the # of children regardless)
  • When this occurs, if I hide and then show the sidebar via F1, the counter works properly.
  • Even with the tree collapsed, the counter is still reported as 0.

Could this be related to #3912 ?

Steps to reproduce

  1. Enable custom CSS (not even sure this is related or not)
  2. Start with a parent tab and create some children. (Unsure if children from drag\drop or opening links from parent is unclear)
  3. Notice that some counters remain at zero until side is reloaded.
  4. Reloading the sidebar corrects the counter. (F1 toggle)

Custom CSS: (I think really just the "display: initial !important;" is relevant)

/* --------------------- Start: Counter Changes --------------------- */

tab-item[data-child-ids]:not(.subtree-collapsed) .counter {
  	display: initial !important;
	text-align: right;
    padding-bottom: 4px;
  	flex-shrink: 0;
    padding-left: 3px;
}

.counter {
    border-radius: 7px;
    margin: 2px 3px 0px 0px;
    padding-bottom: 4px;
    padding-left: 3px;
	font-size: 100%;
  	text-align: right;
    flex-shrink: 0;
    z-index: 10; /* Without this, the counter is sometimes hidden */
}

/* --------------------- End: Counter Changes --------------------- */

Expected result

Counter should always reflect the number of children.

Actual result

Example 1 - Error state

Image

Example 1 - Reloaded state

Image

Example 2 - Error state

Image

Example 2 - Reloaded state

Image

Environment

  • Platform (OS): Windows 11
  • Version of Firefox: 149.0.2
  • Version (or revision) of Tree Style Tab: 4.3.1

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions