Skip to content

feat(chat,examples-chat): sidenav polish — header trim, dark mode contrast, mobile drawer#276

Merged
blove merged 1 commit into
mainfrom
claude/sidenav-polish
May 13, 2026
Merged

feat(chat,examples-chat): sidenav polish — header trim, dark mode contrast, mobile drawer#276
blove merged 1 commit into
mainfrom
claude/sidenav-polish

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 13, 2026

Summary

Three fixes identified during visual review of #272.

1. Sidenav header trim (libs/chat)

The expanded sidenav previously stacked three full-width rows (New chat, Search, Collapse) which felt heavy. A new .chat-sidenav__topbar row hosts the New chat and Collapse/Expand buttons as icon-only controls with justify-content: space-between. The Search button becomes the sole full-width row in .chat-sidenav__actions. Topbar labels are hidden in every mode so the topbar stays icon-only in expanded mode and centers in collapsed mode.

┌─────────────────────┐
│ [+]            [<]  │  ← icon-only topbar (New + Collapse)
├─────────────────────┤
│ 🔍 Search           │  ← full-width row
├─────────────────────┤
│ RECENT              │
│   thread 1          │
└─────────────────────┘

2. GenUI dark mode contrast (examples/chat/angular)

Root cause: examples/chat/angular/src/styles.css sets a dark body background but never opted the chat lib into dark tokens. --ngaf-chat-text stayed at rgb(28, 28, 28), and headings inside <chat> (including A2UI surface titles) inherited near-black on a dark background.

Fix: set data-ngaf-chat-theme="dark" on <html> in index.html. That activates the dark token block at libs/chat/src/lib/styles/chat.css:166-182 so text becomes rgb(245, 245, 245).

3. Mobile drawer fixes (libs/chat)

Root cause: drawer mode applied position: relative to the host (originally added in #272 to avoid reserving space when closed), which caused the host to stretch to its parent's full width and made the inner .chat-sidenav fill the entire viewport. The scrim was hidden behind the full-width drawer.

Fix:

  • Host is now position: fixed; top: 0; left: 0; bottom: 0; width: var(--ngaf-chat-sidenav-width-drawer) (280px), with the inner wrapper handling the translateX open/close transition.
  • A new icon-only Close (X) button is rendered in the topbar exclusively in drawer mode (aria-label="Close conversations"), wired to emit openChange(false).
  • The dark-mode fix from item 2 also resolves the drawer rendering in light mode (same root cause).

Test plan

  • npx nx test chat --testFile chat-sidenav.component.spec.ts (26 specs pass, 5 new)
  • npx nx build chat
  • npx nx lint chat
  • npx nx build examples-chat-angular
  • npm run generate-api-docs
  • Manual verification at <1024px viewport: drawer overlays 280px, scrim is visible, close button works
  • Manual verification at >=1024px: topbar shows icon-only New + Collapse; Search is the only full row
  • Manual verification GenUI surface titles are legible on dark background

…trast, mobile drawer

Three fixes identified during visual review of #272:

1. Sidenav header trim. The expanded sidenav previously stacked three
   full-width rows (New chat, Search, Collapse) which felt heavy.
   Introduce a new .chat-sidenav__topbar row that hosts the New chat and
   Collapse/Expand buttons as icon-only controls with space-between, and
   keep the Search button as the sole full-width row in
   .chat-sidenav__actions. Labels on topbar buttons are hidden in every
   mode (display: none scoped to .chat-sidenav__topbar) so the topbar
   stays icon-only in expanded mode and centers in collapsed mode.

2. GenUI dark mode contrast. examples/chat/angular sets a dark body
   background via styles.css but never opted the chat lib into dark
   tokens, so --ngaf-chat-text stayed at rgb(28, 28, 28) and headings
   inside <chat> (including A2UI surface titles) inherited near-black on
   a dark background. Setting data-ngaf-chat-theme="dark" on <html>
   activates the dark token block at libs/chat/src/lib/styles/chat.css
   so text becomes rgb(245, 245, 245) and headings are legible.

3. Mobile drawer fixes. Drawer mode incorrectly applied
   position: relative to the host (originally added in #272 to avoid
   reserving space when closed), which caused the host to stretch to its
   parent's full width and made the inner .chat-sidenav fill the entire
   viewport. The host is now position: fixed top/left/bottom with width
   set from --ngaf-chat-sidenav-width-drawer (280px), and the inner
   wrapper handles the translate-X open/close transition. A new
   icon-only Close (X) button is rendered in the topbar exclusively in
   drawer mode (aria-label "Close conversations"), wired to emit
   openChange(false). The dark-mode fix from item 2 also resolves the
   drawer rendering in light mode.

Tests:
- libs/chat/src/lib/compositions/chat-sidenav/chat-sidenav.component.spec.ts:
  5 new specs covering the topbar structure, search-row isolation, and
  the drawer-mode Close button.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 13, 2026 0:32am

Request Review

@blove blove merged commit 6ab953f into main May 13, 2026
14 checks passed
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.

1 participant