Skip to content

V7 — Right Sidebar: Agents Panel + Agent Chat #338

@Luis85

Description

@Luis85

Parent epic: #326 · Depends on: F2, F3, F4 · Stories: US-043, US-044, US-040

Problem

Agent visibility and chat are the differentiator of the workspace. Without them, the user can't see what agents are doing, can't intervene mid-task, and can't open a direct conversation with a running agent.

Solution

AgentsList.vue — right-panel content when right === 'agents'

  • Header: ← Tasks back button (returns right = 'tasks') + "Agents" label
  • Two groups: Running (status dot green pulse) and Queued (amber)
  • Row: gradient avatar (7px radius, square) + Name + Role + current task (truncated) + status dot
  • Row click → right = 'agent', agentId = id (US-040)

AgentChat.vue — right-panel content when right === 'agent'

  • Header: ← Agents back button + agent avatar + Name + Role + status (● Running / ● Queued)
  • Message log with four types (per the design brief):
    • sys — purple-tinted background, monospace, for system instructions
    • agent — blue-tinted background, prose
    • tool — dark background, monospace, shows tool call + result
    • user — subtle border, right-aligned, user intent
  • Typing indicator: three dots with staggered opacity animation, shown when agent.live === true
  • Textarea at bottom: Enter sends (Shift+Enter newline); Send button activates when text is present
  • New messages append to the log; container scrolls to bottom on send and on new arrivals
  • Subscribed to AgentRuntimePort.subscribeToAgent(agentId, …) while right === 'agent'; unsubscribe on view leave (cleanup in onBeforeUnmount)
  • Read agent chat log (US-043) and send messages (US-044)

Use cases

  • GetAgentsUseCase — initial list via AgentRuntimePort.listAgents
  • GetAgentDetailsUseCase — single agent + recent messages
  • SendAgentMessageUseCase — send via AgentRuntimePort.sendMessage; optimistic append to chat log

Empty / disconnected states

  • If AgentRuntimePort is mock-only (agent runtime endpoint not configured in F5): banner at top of AgentsList: "Agent runtime not configured. Showing demo agents. Configure in Settings."
  • If a subscription drops mid-chat: persistent notice "Agent disconnected — reconnecting…"; auto-retry every 5s

Acceptance criteria

  • AgentsList renders Running first, then Queued; row click switches to chat (US-040)
  • AgentChat renders the four message types with correct styling
  • Typing indicator only appears when agent.live === true
  • Enter submits, Shift+Enter inserts newline, send button activates conditionally (US-044)
  • User message appears optimistically; agent reply arrives via subscription and appends without re-render (US-043)
  • Back button returns to AgentsList
  • Subscription cleaned up on leave (verified by a test that unmounts the view and asserts no further callbacks fire)
  • Empty state banner shown when agent runtime not configured
  • Disconnect banner + retry loop on subscription drop
  • PageObject tests cover: agent list click → chat, message type rendering, send + receive flow, back navigation, disconnect retry
  • Storybook: empty agents list, mixed running/queued agents, agent chat with all message types, agent chat with typing indicator, disconnect state
  • A11y: role="log" + aria-live="polite" on message container; messages added without focus jump; Tab moves between back button, message log, textarea, send button
  • npm run typecheck, npm run lint, npm run test, npm run test:storybook pass

Out of scope

  • The ContextualAIInput atom routing to a real model (Phase 2)
  • Agent process management (spawn / kill) — Phase 2
  • History scrolling / pagination for huge chat logs (Phase 2)

Affected files

File Action
src/ui/components/right/AgentsList.vue New
src/ui/components/right/AgentChat.vue New
src/ui/components/right/AgentMessage.vue New (per-type message component)
src/application/agent/GetAgentsUseCase.ts New
src/application/agent/GetAgentDetailsUseCase.ts New
src/application/agent/SendAgentMessageUseCase.ts New
tests/application/agent/*.test.ts New
tests/ui/components/right/AgentsList.test.ts + .po.ts New
tests/ui/components/right/AgentChat.test.ts + .po.ts New
stories/right/AgentsList.stories.ts, AgentChat.stories.ts New

References

  • inputs/specorator-mvp-design-2026-05/Specorator_Design_Brief.html §"Agents Panel" + §"Agent Detail — Chat Log"
  • inputs/specorator-mvp-design-2026-05/Specorator_Handoff.html §"AgentRuntimePort"
  • User stories US-040, US-043, US-044

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions