From 68edc01d4486ec15d9625bac313b6cb461f08486 Mon Sep 17 00:00:00 2001 From: josedario87 Date: Sun, 15 Feb 2026 19:33:29 -0600 Subject: [PATCH] refactor: Split AgentBar into modular components with PromptBar chat flow Extract 1226-line monolithic AgentBar.vue into focused components: - types/agent.ts: shared types (Agent, AgentStatusState, ClaudeStatus, ConversationEntry) - agent/FloatBubble.vue: bubble with all status/ejecutor animations, hold detection, recording audio bars - agent/PromptBar.vue: floating panel with chat conversation, transcript, history - agent/ChatInput.vue: reusable input row (text, mic, send, history buttons) - agent/TranscriptCard.vue: typewriter transcription simulation - agent/ResponseCard.vue: thinking dots + mock response - agent/ConversationHistory.vue: scrollable mock history entries - AgentBar.vue: thin orchestrator (~290 lines) keeping WebSocket + status logic New interaction: click bubble opens PromptBar in text mode, hold opens in recording mode with audio bar animation on the bubble. Spring enter/blur exit animations on PromptBar. Text submit shows chat bubbles with mock agent responses. --- frontend/src/components/AgentBar.vue | 1091 ++--------------- frontend/src/components/agent/ChatInput.vue | 160 +++ .../components/agent/ConversationHistory.vue | 185 +++ frontend/src/components/agent/FloatBubble.vue | 572 +++++++++ frontend/src/components/agent/PromptBar.vue | 443 +++++++ .../src/components/agent/ResponseCard.vue | 142 +++ .../src/components/agent/TranscriptCard.vue | 113 ++ frontend/src/types/agent.ts | 48 + 8 files changed, 1741 insertions(+), 1013 deletions(-) create mode 100644 frontend/src/components/agent/ChatInput.vue create mode 100644 frontend/src/components/agent/ConversationHistory.vue create mode 100644 frontend/src/components/agent/FloatBubble.vue create mode 100644 frontend/src/components/agent/PromptBar.vue create mode 100644 frontend/src/components/agent/ResponseCard.vue create mode 100644 frontend/src/components/agent/TranscriptCard.vue create mode 100644 frontend/src/types/agent.ts diff --git a/frontend/src/components/AgentBar.vue b/frontend/src/components/AgentBar.vue index 0a97332..9570af0 100644 --- a/frontend/src/components/AgentBar.vue +++ b/frontend/src/components/AgentBar.vue @@ -1,57 +1,9 @@ diff --git a/frontend/src/components/agent/ChatInput.vue b/frontend/src/components/agent/ChatInput.vue new file mode 100644 index 0000000..a29fd85 --- /dev/null +++ b/frontend/src/components/agent/ChatInput.vue @@ -0,0 +1,160 @@ + + + + + diff --git a/frontend/src/components/agent/ConversationHistory.vue b/frontend/src/components/agent/ConversationHistory.vue new file mode 100644 index 0000000..a9db001 --- /dev/null +++ b/frontend/src/components/agent/ConversationHistory.vue @@ -0,0 +1,185 @@ + + + + + diff --git a/frontend/src/components/agent/FloatBubble.vue b/frontend/src/components/agent/FloatBubble.vue new file mode 100644 index 0000000..21196d0 --- /dev/null +++ b/frontend/src/components/agent/FloatBubble.vue @@ -0,0 +1,572 @@ + + + + + diff --git a/frontend/src/components/agent/PromptBar.vue b/frontend/src/components/agent/PromptBar.vue new file mode 100644 index 0000000..76bc555 --- /dev/null +++ b/frontend/src/components/agent/PromptBar.vue @@ -0,0 +1,443 @@ + + + + + diff --git a/frontend/src/components/agent/ResponseCard.vue b/frontend/src/components/agent/ResponseCard.vue new file mode 100644 index 0000000..56e2a5a --- /dev/null +++ b/frontend/src/components/agent/ResponseCard.vue @@ -0,0 +1,142 @@ + + + + + diff --git a/frontend/src/components/agent/TranscriptCard.vue b/frontend/src/components/agent/TranscriptCard.vue new file mode 100644 index 0000000..fc31eb4 --- /dev/null +++ b/frontend/src/components/agent/TranscriptCard.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/frontend/src/types/agent.ts b/frontend/src/types/agent.ts new file mode 100644 index 0000000..939d34f --- /dev/null +++ b/frontend/src/types/agent.ts @@ -0,0 +1,48 @@ +export type ClaudeStatus = + | 'idle' + | 'processing' + | 'toolUse' + | 'toolDone' + | 'reading' + | 'writing' + | 'sessionStart' + | 'subagentStart' + | 'subagentStop' + | 'notification' + | 'permissionRequest' + | 'thinking' + +export interface AgentStatusState { + isProcessing: boolean + isReading: boolean + isWriting: boolean + awaitingPermission: boolean + showToolFlash: boolean + showNotification: boolean + currentTool: string | null +} + +export interface UiConfig { + label: string + shortLabel: string + color: string + gradient: string + terminalBg: string + terminalBorder: string + enabled: boolean +} + +export interface Agent { + id: string + name: string + directory: string + uiConfig: UiConfig | null +} + +export interface ConversationEntry { + id: string + role: 'user' | 'agent' + content: string + timestamp: string + method: 'text' | 'voice' +}