feat(floating-ai): step 1 — extract shared useAIChat hook
Refactor AIChatPanel to consume the existing useAIChat hook instead of managing chat state inline. Removes duplicate ChatMessage interface, inline state (messages, input, isStreaming, streamingContent), and the 65-line handleSend callback, replacing them with a single useAIChat() call and a thin briefLoading guard wrapper. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ This document is designed to be consumed **one step at a time across multiple Cl
|
||||
|
||||
### Workflow Protocol for Each Step
|
||||
|
||||
1. **Start a new chat** and say: _"Read `docs/floating-ai-integration-guide.md` and implement Step X"_
|
||||
1. **Start a new chat** and say: _"Implement Step [X] from `docs/floating-ai-integration-guide.md`. Use a subagent to extract the general rules and only the data relevant to Step [X], completely ignoring the other steps."_
|
||||
2. **Before writing any code**, the agent MUST:
|
||||
- Read ALL files listed in the step's "Files to Read First" section
|
||||
- Read the project's `CLAUDE.md` for build/lint commands and conventions
|
||||
@@ -31,7 +31,7 @@ Steps MUST be implemented in order. Each step lists its prerequisites.
|
||||
|
||||
| Step | Title | Status |
|
||||
|------|-------|--------|
|
||||
| 1 | Extract shared `useAIChat` hook | [ ] |
|
||||
| 1 | Extract shared `useAIChat` hook | [x] 2026-02-27 |
|
||||
| 2 | Create section registry + `FloatingChatContext` | [ ] |
|
||||
| 3 | Create double-click hook | [ ] |
|
||||
| 4 | Build `FloatingChat` component | [ ] |
|
||||
@@ -56,7 +56,7 @@ A partial implementation of Step 1 already exists:
|
||||
|
||||
## Step 1: Extract Shared `useAIChat` Hook
|
||||
|
||||
**Status**: [ ]
|
||||
**Status**: [x] 2026-02-27
|
||||
**Prerequisites**: None
|
||||
**Creates**: Nothing new (hook file already exists at `src/renderer/hooks/useAIChat.ts`)
|
||||
**Modifies**: `src/renderer/components/ai/AIChatPanel.tsx`
|
||||
|
||||
Reference in New Issue
Block a user