Add header brand wordmark with superscript unread badge#190
Add header brand wordmark with superscript unread badge#190general-lex wants to merge 4 commits into
Conversation
The header had no global indication of unread activity — users had to scan the sidebar to notice messages in rooms they weren't viewing. Adds an UnreadBadge in AppHeader backed by a pure selectUnreadTotal derivation over state.summaries (exposed via the useUnreadTotal hook). The reducer already keeps per-room unreadCount/hasMention current — incremented by MESSAGE_RECEIVED for non-active rooms, zeroed by SET_ACTIVE_ROOM — so the badge updates live (up on new messages, down on room visit) with no extra fetch, subscription, or polling. https://claude.ai/code/session_018Ji3fX1rmVci7HF1uFtbzB
CodeRabbit nitpick — assert the UnreadBadge mock renders in the AppHeader "renders user chip..." test so the integration point is guarded against accidental unwiring. Also add a component docstring to UnreadBadge documenting its conditional-render / cap / mention-variant contract (raises the PR's docstring coverage). https://claude.ai/code/session_018Ji3fX1rmVci7HF1uFtbzB
The app had no brand identity in the UI — only the browser tab title. Adds a bold accent-colored "Chat" wordmark at the top-left of the AppHeader (first flex child; the search overlay is absolutely positioned so the wordmark anchors left). Styled with existing design tokens. Render test asserts it is present. https://claude.ai/code/session_018Ji3fX1rmVci7HF1uFtbzB
Previously the badge sat as a standalone flex child pinned to the left
next to the wordmark, which read oddly ("Chat 3"). Nest it inside the
brand and absolutely position it at the wordmark's top-right corner so
it reads as an app-icon-style notification count. Standalone
.unread-badge flow styling is overridden only within .app-header-brand.
https://claude.ai/code/session_018Ji3fX1rmVci7HF1uFtbzB
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
📝 WalkthroughWalkthroughThis PR introduces a header-mounted unread message badge that aggregates unread counts and mention indicators from all chat rooms. The change flows from state selection through a context hook, component rendering, visual styling, and integration into the app header. ChangesUnread Badge Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Adds a "Chat" brand identity to the app header and a live, app-wide unread-message indicator rendered as a superscript badge on the wordmark.
selectUnreadTotal()(pure selector inreducer.js) aggregates per-roomunreadCount/hasMentioninto{ total, hasMention }; exposed via theuseUnreadTotal()hook. No fetch, no polling, no subscription — the reducer already keeps per-room counts current (MESSAGE_RECEIVEDraises non-active rooms,SET_ACTIVE_ROOMzeroes the visited one), so the badge updates live.UnreadBadgecomponent — hidden at 0, caps at99+, mention-accent variant, accessible singular/pluralaria-label. Design-token styling only.AppHeader(the search bar is an absolutely-positioned centered overlay, so the wordmark anchors left)..unread-badgeflow styling is overridden only within.app-header-brand.Test plan
selectUnreadTotalunit tests: empty, summation, mention OR, missing fields, recompute afterMESSAGE_RECEIVED/SET_ACTIVE_ROOMUnreadBadgetests: zero→null, count,99+cap, singular/plural label, mention classAppHeaderrender test asserts the wordmark + badge are presentnpm run typecheckclean, full suite green,vite buildcleannpm run dev— confirm wordmark size/color and badge superscript offsets at the "Chat" top-right cornerhttps://claude.ai/code/session_018Ji3fX1rmVci7HF1uFtbzB
Generated by Claude Code
Summary by CodeRabbit