fix(sidebar): show room count on collapsed-category header #136

Merged
nrupard merged 1 commit from fix/sidebar-collapsed-room-count into main 2026-05-18 18:15:18 +02:00
Owner

Bug report

User: "all rooms disappear / move to All Rooms when I collapse a category."

Root cause

Not a bug; visual confusion. The sidebar template renders a category's room <ul> only when !category.collapsed, so collapsing hides every room inside. The DB assignments persist (verified by repro test); the rooms are still in the category, just not in the DOM.

With no visual hint of "N rooms inside this collapsed category", an empty-looking header next to a populated "All rooms" section reads as "rooms relocated".

Fix

Show (N) next to the collapsed-category name so the user can see rooms are still inside. Uses category.rooms.len() which is already on SidebarCategoryGroup (phase 3 added it for the aggregate). Sits between the name and the existing unread / mention aggregate pills, in muted slate-400 so it stays quiet when the category has no unread activity.

Expanded categories don't need it - the <ul> is right there showing the rooms.

Test plan

  • just check (fmt + clippy across standalone + saas).
  • Existing 11 sidebar tests still pass (template-only change).
  • Manual: collapse a category that has rooms - verify ▸ Work (3) style label appears next to its name.
## Bug report User: "all rooms disappear / move to All Rooms when I collapse a category." ## Root cause Not a bug; visual confusion. The sidebar template renders a category's room `<ul>` only when `!category.collapsed`, so collapsing hides every room inside. The DB assignments persist (verified by repro test); the rooms are still in the category, just not in the DOM. With no visual hint of "N rooms inside this collapsed category", an empty-looking header next to a populated "All rooms" section reads as "rooms relocated". ## Fix Show `(N)` next to the collapsed-category name so the user can see rooms are still inside. Uses `category.rooms.len()` which is already on `SidebarCategoryGroup` (phase 3 added it for the aggregate). Sits between the name and the existing unread / mention aggregate pills, in muted slate-400 so it stays quiet when the category has no unread activity. Expanded categories don't need it - the `<ul>` is right there showing the rooms. ## Test plan - [x] `just check` (fmt + clippy across standalone + saas). - [x] Existing 11 sidebar tests still pass (template-only change). - [ ] Manual: collapse a category that has rooms - verify `▸ Work (3)` style label appears next to its name.
fix(sidebar): show room count on collapsed-category header
Some checks failed
Check / clippy + fmt + tests (pull_request) Failing after 7s
67f664dccf
User reported "all rooms move to All Rooms when I collapse a category". Investigation: the rooms aren't moving anywhere - they're hidden because the template only renders the room `<ul>` when `!category.collapsed`. With no visual hint of "N rooms inside this collapsed category", an empty-looking header next to a populated "All rooms" section reads as "rooms relocated".

Add `(N)` next to the collapsed-category name to make it obvious the rooms are still inside, just hidden. Uses `category.rooms.len()` which is already on `SidebarCategoryGroup`. Sits between the name and the existing unread / mention aggregate pills, in a muted slate-400 to stay quiet when the category has no unread activity.
nrupard deleted branch fix/sidebar-collapsed-room-count 2026-05-18 18:15:18 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!136
No description provided.