Skip to content

fix(desktop): add unread dot to workspace rail for channel unreads#1637

Merged
wpfleger96 merged 1 commit into
mainfrom
duncan/workspace-rail-unread-dot
Jul 8, 2026
Merged

fix(desktop): add unread dot to workspace rail for channel unreads#1637
wpfleger96 merged 1 commit into
mainfrom
duncan/workspace-rail-unread-dot

Conversation

@wpfleger96

Copy link
Copy Markdown
Collaborator

What

Adds a plain unread dot to the workspace rail for workspaces that have regular channel unreads but no mentions. Previously, the rail only badged workspaces for mentions — hasUnread was computed correctly by the data layer but the render layer never read it.

Two-tier indicator system (matching the rest of the app)

  • Numeric badge (existing, unchanged) — mention/thread-reply count.
  • Dot (new) — h-2 w-2 rounded-full bg-primary ring-2 ring-sidebar at -bottom-0.5 -right-0.5, testid workspace-rail-unread-dot-${id}, sr-only "unread" label.

The two indicators are mutually exclusive by construction: showDot = observed && hasUnread && !showBadge. Both are gated on state === "ready" — non-ready observations render neither.

Tooltip updated for the dot state: "<name> — unread".

Changes

  • WorkspaceRail.tsx: workspaceRailIndicators returns a new showDot field; WorkspaceButton renders the dot in the showBadge ? <badge> : showDot ? <dot> : null chain.
  • WorkspaceRail.test.mjs: adds showDot assertions for all four branches (unread+no-mention → dot; mention → badge, no dot; no-unread → neither; non-ready → neither). Updates test name for the previously bug-enshrining case.

The workspace rail only badged other workspaces for mentions, never for
regular channel unreads. `workspaceRailIndicators` computed `showBadge`
exclusively from `mentionCount > 0` and never consulted `unread.hasUnread`,
so a workspace with channel activity but no mentions showed nothing.

Add a two-tier indicator matching the rest of the app:
- Numeric mention badge (existing) — unchanged.
- Plain `h-2 w-2` unread dot when `hasUnread && !showBadge`, positioned at
  `-bottom-0.5 -right-0.5` with `ring-2 ring-sidebar` to read against the
  rail, testid `workspace-rail-unread-dot-${id}`, sr-only "unread" label.

Both indicators are gated on `state === "ready"` — non-ready observations
never surface either affordance. `showBadge` and `showDot` are mutually
exclusive by construction.

Tooltip also updated: dot state reads "<name> — unread" to match app tone.

Tests updated: the case that previously enshrined the missing affordance
(`hasUnread: true, state: "ready"` → `showBadge: false`) now also asserts
`showDot: true`. New `showDot` assertions added for all branches.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
@wpfleger96 wpfleger96 merged commit f968601 into main Jul 8, 2026
46 of 47 checks passed
@wpfleger96 wpfleger96 deleted the duncan/workspace-rail-unread-dot branch July 8, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants