Wrong number of topics in categories in the hamburger-menu

סיכום מבוסס בינה מלאכותית

In a bug report titled ‘Wrong number of topics in categories in the hamburger-menu,’ users discuss inconsistencies in how topic counts are displayed in Discourse’s hamburger menu versus the dropdown category selector. Pad_Pors initially notes that category topic counts don’t reflect the sum of subcategory topics, especially after moving topics into subcategories — even showing negative numbers. Canapin confirms the confusion, sharing examples where a category appears empty (0 topics) but contains subcategories with content. sam clarifies that the hamburger menu displays new/unread topic counts, not total topics — explaining the discrepancy. Pad_Pors raises concern for anonymous users, noting misleading counts (e.g., 21 topics shown for ‘howto’ while subcategories contain many more). sam agrees this is confusing for logged-out users and suggests counting subcategories in that context. A fix is implemented in commit d9a9682 sam. Later, Pad_Pors notices logged-in users see different numbers in the hamburger vs dropdown — sam and codinghorror clarify: hamburger = unread/new, dropdown = total topics — by design. sam confirms the behavior is intentional. Finally, sam highlights improvements for anonymous users, where category counts now better reflect scale by including subcategories, making the UI more intuitive.

I guess the number of topics in a category should be equal to the sum of topics in all its subcategories. but in the hamburger menu, it isn’t:

the strange minus topic number happened at some time point where we added some sub-categories to the category and moved all topics from the main category to its’ subsequent sub-category.

לייק 1

About this:

This is not the case on the other category selector either.

Though I can’t find anything from the search I’m pretty sure this has been discussed a few times (or more) and it would have been changed if they had no good reason to keep it this way.

That said I don’t really like this either as it can be somewhat confusing.
For example, I have an archive category which has 0 message:
image
This is confusing because it tells me at first glance that there is nothing to see in it. But it’s wrong!
If we click it anyway, we can notice that it is not empty and has some subcategories with messages:

לייק 1

Hamburger shows the count of new+unread you have for the category, not the total.

The negative sign there does look strange, what is the new/unread count you see when you visit the category.

2 לייקים

you are right, in fact my concern was about first-visit or not-logged in users, and the screenshots are also for anonymous user.

e.g. in meta, for not logged in user, you’ll see 21 topics in howto category, while there are lots more topics in its subcategories.

it’d be awkward if the number shows zero, as it gives the feeling that the category is empty. no number for not-logged in users would be much better.

לייק 1

It is not counting sub-categories at the moment, I guess this is a fair comment it probably should in this context cause it is confusing otherwise.

3 לייקים

OK fixed per:

https://github.com/discourse/discourse/commit/d9a9682f7219f1cf3b8cc5555f8a3157803ab7b0

5 לייקים

just noted that for logged in user, the numbers in front of categories are different in hamburger and drop down:

should it be?

p.s.: maybe one shows total number of topics and the other is for unread. as a user I just got confused.

3 לייקים

This is confusing, it does not show up like that for me… I will try to repro…

The hamburger is showing unread / new counts, the category drop down is showing raw counts. These are different things, @Pad_Pors is confused.

Note that for logged out users we have no concept of unread / new because the whole site is one big ball of new to you, the unlogged in user..

3 לייקים

Oh… I totally missed that @Pad_Pors had 404 unread for some reason I only read the 27 number there.

@Pad_Pors yes the numbers are there by design and working as expected

2 לייקים

Note, it is worth mentioning how much better this is on anonymous now:

You can properly tell the scale of the various categories, previously only counting top level totally skewed how useful the numbers were.

4 לייקים