Skip to content

feat: add theme switcher, collapsible sidebar, markdown/highlighting, and real session history to web mode - #883

Open
Dhirenderchoudhary wants to merge 1 commit into
Nano-Collective:feat/web-modefrom
Dhirenderchoudhary:fix/628-web-mode-phase-6
Open

feat: add theme switcher, collapsible sidebar, markdown/highlighting, and real session history to web mode#883
Dhirenderchoudhary wants to merge 1 commit into
Nano-Collective:feat/web-modefrom
Dhirenderchoudhary:fix/628-web-mode-phase-6

Conversation

@Dhirenderchoudhary

Copy link
Copy Markdown
Contributor

Description

Addresses feedback on web mode (#628): #628 (comment)

  • Theme switcher — light palette added purely additively via [data-theme="light"] (higher specificity than the existing plain-class dark rules, so it can only ever apply once toggled, never affects the dark default), toggle button, prefers-color-scheme fallback, persisted.
  • Collapsible sidebar — toggle in the topbar, persisted.
  • Metadata label weight — reduced font size and opacity so it stops competing with primary message text.
  • Markdown: italics, strikethrough, and links added to the inline renderer (bold/code already existed).
  • Syntax highlighting — dependency-free regex tokenizer (keywords/strings/numbers/comments) for fenced code blocks, language tag read from the opening fence.
  • Real session history — the three hardcoded sidebar threads are gone. Two new protocol events (list_sessions/load_session) wire the browser through the same SessionManager/applySession infrastructure the CLI's /resume already uses, so switching sessions from the browser also updates the terminal's own chat state, consistent with how New Chat already behaves in both directions. History button now shows real data; Settings shows real current state (theme/sidebar) instead of a canned string.
  • Tab-switch lag — traced to scroll-behavior: smooth combined with a scrollTop write on every streamed token, queuing an animation per token that a backgrounded tab throttles and then drains all at once on refocus. Removed; a chat view auto-following streamed content has no reason to animate every micro-scroll. This is a reasoned fix from static analysis, not a live-confirmed one — no browser was available this session — flagged as such rather than claimed as verified.

Closes #628

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Changeset

  • Added a changeset (pnpm changeset) describing this change for the changelog

Testing

Automated Tests

  • New features include passing tests in .spec.ts/tsx files
  • All existing tests pass (pnpm test:all completes successfully)
  • Tests cover both success and error scenarios

Manual Testing

  • Tested with Ollama
  • Tested with OpenRouter
  • Tested with OpenAI-compatible API
  • Tested MCP integration (if applicable)

Checklist

  • If this was for an open issue, I was assigned to it
  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated (if needed)
  • No breaking changes (or clearly documented)
  • Appropriate logging added using structured logging (see CONTRIBUTING.md) — not applicable, no new logging paths in this change

@Dhirenderchoudhary
Dhirenderchoudhary marked this pull request as ready for review August 16, 2026 10:43
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