Skip to content

feat(chat,examples-chat): sidenav collapse toggle + remove leftover hamburger#272

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

feat(chat,examples-chat): sidenav collapse toggle + remove leftover hamburger#272
blove merged 1 commit into
mainfrom
claude/sidenav-collapse-toggle

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 12, 2026

Summary

Replaces the leftover floating "☰" hamburger (vestige of when the sidenav was a palette-toggled drawer) with proper collapse/expand controls inside the sidenav itself.

  • New chevron toggle button in the sidenav header — flips between expanded (280px) and collapsed (56px icon-strip) modes.
  • Cmd+B / Ctrl+B keyboard shortcut (VS Code convention) toggles the same.
  • Demo-shell stores the chosen desktop mode in localStorage so the preference persists across reloads.
  • The collapsed mode's CSS was already fully wired (icon-strip width, label hiding) — this PR just adds the entry point.
  • Mobile (<1024px) still uses the drawer mode with a small floating hamburger as the open trigger. The hamburger renders only when the drawer is closed and the viewport is narrow.

Tests

  • Chat lib spec coverage for chevron states, Cmd+B accelerator, drawer-mode behavior
  • Build + lint green for chat lib and examples-chat-angular

@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 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:08am

Request Review

…amburger

Replaces the leftover floating "☰" hamburger (vestige of when the sidenav
was a palette-toggled drawer) with proper collapse/expand controls inside
the sidenav itself.

- New chevron toggle button in the sidenav header — flips between
  expanded (280px) and collapsed (56px icon-strip) modes.
- Cmd+B / Ctrl+B keyboard shortcut (VS Code convention) toggles the same.
- Demo-shell stores the chosen desktop mode in localStorage so the
  preference persists across reloads.
- Collapsed-mode CSS was already fully wired (icon-strip width, label
  hiding) — this commit just adds the entry point.
- Mobile (<1024px) still uses drawer mode with a small floating hamburger
  as the open trigger. The hamburger renders only when the drawer is
  closed and the viewport is narrow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@blove blove force-pushed the claude/sidenav-collapse-toggle branch from fd32cac to ec01e5b Compare May 13, 2026 00:03
@blove blove merged commit 856d303 into main May 13, 2026
14 checks passed
blove added a commit that referenced this pull request May 13, 2026
…trast, mobile drawer (#276)

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