# 汉堡菜单中分类的主题数量不正确

**URL:** <https://meta.discourse.org/t/wrong-number-of-topics-in-categories-in-the-hamburger-menu/91775>\
**Category:** Bug\
**Created:** [2018年七月7日 12:25 UTC](https://meta.discourse.org/t/wrong-number-of-topics-in-categories-in-the-hamburger-menu/91775 "2018-07-07T12:25:27Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)\
**Post date:** [2018年七月7日 12:25 UTC](https://meta.discourse.org/t/wrong-number-of-topics-in-categories-in-the-hamburger-menu/91775/1 "2018-07-07T12:25:27Z")

</div>

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:

 ![Untitled](https://global.discourse-cdn.com/meta/original/3X/9/b/9b110552bc78d901dde16d315368f32fe306ce45.png)

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.

---

<div class="post-metadata">

**Author:** ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)\
**Post date:** [2018年七月7日 12:44 UTC](https://meta.discourse.org/t/wrong-number-of-topics-in-categories-in-the-hamburger-menu/91775/2 "2018-07-07T12:44:40Z")

</div>

About this:

> [@Pad\_Pors](#):
>
> I guess the number of topics in a category should be equal to the sum of topics in all its subcategories.

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](https://global.discourse-cdn.com/meta/original/3X/4/c/4cfeaad8b68c07b59f28f801a3ad25289fb65cd7.png)  
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:

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/0/f0fa24655d68d718fc26493636640c286b9a2fd6.png)

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2018年七月9日 01:36 UTC](https://meta.discourse.org/t/wrong-number-of-topics-in-categories-in-the-hamburger-menu/91775/3 "2018-07-09T01:36:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)\
**Post date:** [2018年七月9日 05:55 UTC](https://meta.discourse.org/t/wrong-number-of-topics-in-categories-in-the-hamburger-menu/91775/4 "2018-07-09T05:55:09Z")

</div>

> [@sam](#):
>
> Hamburger shows the count of new+unread you have for the category, not the total.

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.

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/9/59c8acde88494be97a639adcbd56984c1bcbfadd.png)

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.

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2018年七月9日 05:57 UTC](https://meta.discourse.org/t/wrong-number-of-topics-in-categories-in-the-hamburger-menu/91775/5 "2018-07-09T05:57:00Z")

</div>

> [@Pad\_Pors](#):
>
> in meta, for not logged in user, you’ll see 21 topics in howto category

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.

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2018年七月9日 06:53 UTC](https://meta.discourse.org/t/wrong-number-of-topics-in-categories-in-the-hamburger-menu/91775/6 "2018-07-09T06:53:35Z")

</div>

OK fixed per:

[https://github.com/discourse/discourse/commit/d9a9682f7219f1cf3b8cc5555f8a3157803ab7b0](https://github.com/discourse/discourse/commit/d9a9682f7219f1cf3b8cc5555f8a3157803ab7b0)

---

<div class="post-metadata">

**Author:** ![Pad\_Pors](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pad_pors/32/52016_2.png) [@Pad\_Pors](https://meta.discourse.org/u/Pad_Pors)\
**Post date:** [2018年七月10日 07:24 UTC](https://meta.discourse.org/t/wrong-number-of-topics-in-categories-in-the-hamburger-menu/91775/7 "2018-07-10T07:24:37Z")

</div>

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

 ![image](https://global.discourse-cdn.com/meta/original/3X/f/3/f38417322deab71eff956014a498b29987a0a5f4.png)

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.

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2018年七月10日 07:26 UTC](https://meta.discourse.org/t/wrong-number-of-topics-in-categories-in-the-hamburger-menu/91775/8 "2018-07-10T07:26:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2018年七月10日 07:42 UTC](https://meta.discourse.org/t/wrong-number-of-topics-in-categories-in-the-hamburger-menu/91775/10 "2018-07-10T07:42:26Z")

</div>

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..

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2018年七月10日 07:43 UTC](https://meta.discourse.org/t/wrong-number-of-topics-in-categories-in-the-hamburger-menu/91775/11 "2018-07-10T07:43:47Z")

</div>

> [@codinghorror](#):
>
> The hamburger is showing unread / new counts,

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

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2018年七月10日 07:44 UTC](https://meta.discourse.org/t/wrong-number-of-topics-in-categories-in-the-hamburger-menu/91775/12 "2018-07-10T07:44:11Z")

</div>



---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2018年七月10日 07:45 UTC](https://meta.discourse.org/t/wrong-number-of-topics-in-categories-in-the-hamburger-menu/91775/13 "2018-07-10T07:45:46Z")

</div>

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

 ![image](https://global.discourse-cdn.com/meta/original/3X/7/5/75ebcac719960181cf78825959a8f52f2b9e9745.png)

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