Skip to content

feat(ui): Add session history sidebar to default chat UI#49

Merged
ericchansen merged 2 commits intomainfrom
feat/session-history
Mar 10, 2026
Merged

feat(ui): Add session history sidebar to default chat UI#49
ericchansen merged 2 commits intomainfrom
feat/session-history

Conversation

@ericchansen
Copy link
Owner

@ericchansen ericchansen commented Mar 10, 2026

Summary

Add a persistent session history sidebar to the default chat UI, and change the default theme to dark. Closes #39.

Changes

  • Persistent sidebar — always-visible left panel (260px) showing past conversations
  • localStorage-backed — sessions saved/restored across page refreshes (max 50)
  • Session management — new chat, restore, delete with hover-reveal delete button
  • Title derivation — auto-titles from first user message (truncated at 50 chars)
  • Responsive — collapses to horizontal top panel on mobile (<640px)
  • Dark mode default — changed DEFAULT_CONFIG.ui.theme from 'system' to 'dark'
  • Server session linking — restores serverSessionId for context continuity

Files Changed

File Change
packages/wingman/src/default-ui.ts Sidebar HTML/CSS/JS, flex layout refactor, dark fallback
packages/wingman/src/config.ts Default theme 'system''dark'
packages/wingman/src/__tests__/config.test.ts Updated 2 assertions to match new default

Testing

  • All 130 tests pass (npx turbo build test — 6 tasks successful)
  • Browser-verified: dark theme, sidebar visible, send → save → refresh → restore → delete

Copilot AI review requested due to automatic review settings March 10, 2026 21:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a local, localStorage-backed session history drawer to Wingman’s built-in “default chat UI” (the HTML/CSS/JS page served when no custom frontend is provided), enabling users to persist and restore conversations across reloads.

Changes:

  • Introduces a collapsible “Chat History” sidebar + overlay, with “New chat” and per-session delete controls.
  • Persists sessions (messages + server sessionId) into localStorage with a max session cap and recency ordering.
  • Restores a prior session by re-rendering saved messages (assistant messages via the existing markdown-lite renderer) and reusing the stored sessionId.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ericchansen ericchansen force-pushed the feat/session-history branch from bc80954 to f098abb Compare March 10, 2026 21:50
Add localStorage-backed conversation history as a persistent left
sidebar in the built-in chat interface (like ChatGPT/Claude). Sessions
auto-save after each message exchange and persist across page reloads.

Features:
- Always-visible left sidebar (260px) showing conversation history
- Auto-save with title derived from first user message
- Click to restore past conversations with full message history
- New Chat button to start fresh sessions
- Delete individual sessions with hover-reveal x button
- Max 50 sessions with oldest evicted
- Responsive: collapses to top panel on mobile (<640px)

Closes #39

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ericchansen ericchansen force-pushed the feat/session-history branch from f098abb to bb85616 Compare March 10, 2026 22:01
Copilot AI review requested due to automatic review settings March 10, 2026 22:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Fix XSS: replace innerHTML string concat with DOM APIs in renderSessionList()
- Fix accessibility: add pointer-events:none + :focus-visible on delete buttons
- Fix bug: wrap saveCurrentSession() in try/catch in finally block
- Harden localStorage: add Array.isArray check in loadSessions(), try/catch in saveSessions()
- Add type=button to new-chat-btn to prevent accidental form submission
- Remove redundant renderSessionList() call (startNewChat already calls it)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ericchansen ericchansen merged commit 9861d41 into main Mar 10, 2026
2 checks passed
@ericchansen ericchansen deleted the feat/session-history branch March 10, 2026 22:15
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.

feat: add session history to default chat UI

2 participants