Jarvis Chat Overlay (persistent, always available) #42

Closed
opened 2026-01-29 18:23:09 +00:00 by jason.woltje · 1 comment
Owner

Overview

Add a persistent Jarvis chat overlay that is always available from any view in the HUD.

Background

From L-012 in jarvis-brain EVOLUTION.md:

Working across multiple Jarvis platform areas (Kanban, tasks, projects, logs) requires context switching. No persistent Jarvis chat session accessible across all views. Need to navigate away from work to ask Jarvis questions.

Jarvis should be "just there all the time." The chat is integrated. Users need access at all times for questions, ideas, etc.

Requirements

UI Components

Chat Overlay

  • Position: Fixed sidebar or floating panel
  • States: Minimized (icon only), Collapsed (header only), Expanded (full chat)
  • Persistence: Maintains position/state across navigation
  • Responsive: Adapts to mobile (slide-out drawer)

Chat Interface

  • Message history (scrollable)
  • Input field with send button
  • Typing indicator
  • Message timestamps
  • Support for markdown rendering
  • Code block syntax highlighting
  • PDA-friendly response formatting

Context Awareness

  • Chat knows what view user is on
  • Can reference current task/project/event
  • Deep linking: Jarvis can suggest "View task X" with clickable link
  • Real-time updates reflect in current view

Integration with ClawdBot

// WebSocket connection to ClawdBot gateway
interface JarvisMessage {
  id: string;
  role: "user" | "assistant";
  content: string;
  timestamp: Date;
  context?: {
    view: string;      // Current view (tasks, calendar, etc.)
    entityType?: string; // TASK, EVENT, PROJECT
    entityId?: string;   // Current entity being viewed
  };
}

// Send message with context
async function sendMessage(content: string, context: ViewContext): Promise<void>;

// Receive streaming response
function onMessage(callback: (message: JarvisMessage) => void): void;

API Endpoints

  • POST /api/chat/message — Send message to Jarvis
  • GET /api/chat/history — Get recent chat history
  • WebSocket /ws/chat — Real-time chat stream

Keyboard Shortcuts

  • Cmd/Ctrl + K — Focus chat input
  • Escape — Minimize chat
  • Cmd/Ctrl + Shift + J — Toggle chat panel

State Management

interface ChatState {
  isOpen: boolean;
  isMinimized: boolean;
  messages: JarvisMessage[];
  isTyping: boolean;
  currentContext: ViewContext;
}

Acceptance Criteria

  • Chat overlay component with minimize/expand
  • Persists across navigation (React context or state manager)
  • WebSocket connection to ClawdBot
  • Send/receive messages
  • Markdown rendering in responses
  • Context passed with messages (current view, entity)
  • Keyboard shortcuts
  • Mobile responsive (drawer)
  • PDA-friendly response display
  • Chat history persisted (last N messages)

Design Notes

Position Options

  1. Right sidebar (default) — Always visible, can collapse
  2. Floating panel — Draggable, can minimize to icon
  3. Bottom drawer — Slide up, like mobile chat

Recommend starting with right sidebar for desktop, bottom drawer for mobile.

Performance

  • Lazy load chat history
  • Virtual scrolling for long histories
  • Debounce typing indicator
  • Reconnect WebSocket on disconnect
## Overview Add a **persistent Jarvis chat** overlay that is always available from any view in the HUD. ## Background From L-012 in jarvis-brain EVOLUTION.md: > Working across multiple Jarvis platform areas (Kanban, tasks, projects, logs) requires context switching. No persistent Jarvis chat session accessible across all views. Need to navigate away from work to ask Jarvis questions. Jarvis should be "just there all the time." The chat is integrated. Users need access at all times for questions, ideas, etc. ## Requirements ### UI Components #### Chat Overlay - **Position:** Fixed sidebar or floating panel - **States:** Minimized (icon only), Collapsed (header only), Expanded (full chat) - **Persistence:** Maintains position/state across navigation - **Responsive:** Adapts to mobile (slide-out drawer) #### Chat Interface - Message history (scrollable) - Input field with send button - Typing indicator - Message timestamps - Support for markdown rendering - Code block syntax highlighting - PDA-friendly response formatting #### Context Awareness - Chat knows what view user is on - Can reference current task/project/event - Deep linking: Jarvis can suggest "View task X" with clickable link - Real-time updates reflect in current view ### Integration with ClawdBot ```typescript // WebSocket connection to ClawdBot gateway interface JarvisMessage { id: string; role: "user" | "assistant"; content: string; timestamp: Date; context?: { view: string; // Current view (tasks, calendar, etc.) entityType?: string; // TASK, EVENT, PROJECT entityId?: string; // Current entity being viewed }; } // Send message with context async function sendMessage(content: string, context: ViewContext): Promise<void>; // Receive streaming response function onMessage(callback: (message: JarvisMessage) => void): void; ``` ### API Endpoints - `POST /api/chat/message` — Send message to Jarvis - `GET /api/chat/history` — Get recent chat history - `WebSocket /ws/chat` — Real-time chat stream ### Keyboard Shortcuts - `Cmd/Ctrl + K` — Focus chat input - `Escape` — Minimize chat - `Cmd/Ctrl + Shift + J` — Toggle chat panel ### State Management ```typescript interface ChatState { isOpen: boolean; isMinimized: boolean; messages: JarvisMessage[]; isTyping: boolean; currentContext: ViewContext; } ``` ## Acceptance Criteria - [ ] Chat overlay component with minimize/expand - [ ] Persists across navigation (React context or state manager) - [ ] WebSocket connection to ClawdBot - [ ] Send/receive messages - [ ] Markdown rendering in responses - [ ] Context passed with messages (current view, entity) - [ ] Keyboard shortcuts - [ ] Mobile responsive (drawer) - [ ] PDA-friendly response display - [ ] Chat history persisted (last N messages) ## Design Notes ### Position Options 1. **Right sidebar** (default) — Always visible, can collapse 2. **Floating panel** — Draggable, can minimize to icon 3. **Bottom drawer** — Slide up, like mobile chat Recommend starting with right sidebar for desktop, bottom drawer for mobile. ### Performance - Lazy load chat history - Virtual scrolling for long histories - Debounce typing indicator - Reconnect WebSocket on disconnect
jason.woltje added this to the M4-LLM (0.0.4) milestone 2026-01-29 18:25:33 +00:00
Author
Owner

Completed in PR #307

Implemented persistent Jarvis chat overlay with keyboard shortcuts, state management, and comprehensive tests.

All quality checks passing (490 tests, lint, build).

Completed in PR #307 Implemented persistent Jarvis chat overlay with keyboard shortcuts, state management, and comprehensive tests. All quality checks passing (490 tests, lint, build).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaic/stack#42