nexus/.planning/phases/21-chat-foundation/21-04-PLAN.md
Mikkel Georgsen af211e6a39 [nexus] docs(21-chat-foundation): create phase plan
4 plans across 3 waves for Chat Foundation phase.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 12:52:49 +02:00

5.5 KiB

phase plan type wave depends_on files_modified autonomous requirements must_haves
21-chat-foundation 04 execute 3
21-03
false
CHAT-02
CHAT-03
CHAT-04
CHAT-05
CHAT-06
INPUT-01
INPUT-07
HIST-01
HIST-02
HIST-03
HIST-05
HIST-06
THEME-01
THEME-02
truths artifacts key_links
All phase 21 success criteria verified visually by user
Visual and functional verification checkpoint for the complete Phase 21 chat foundation.

Purpose: Confirm the chat interface works end-to-end with correct theme integration, markdown rendering, and persistence before marking the phase complete. Output: User approval or list of issues to fix.

<execution_context> @$HOME/.claude/get-shit-done/workflows/execute-plan.md @$HOME/.claude/get-shit-done/templates/summary.md </execution_context>

@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/phases/21-chat-foundation/21-03-SUMMARY.md Task 1: Run full test suite and generate migration server/src/__tests__/chat-service.test.ts, server/src/__tests__/chat-routes.test.ts 1. Run `pnpm db:generate` to generate the migration SQL if not already done. Verify generated SQL file exists under `packages/db/src/migrations/` and contains `CREATE TABLE "chat_conversations"` and `CREATE TABLE "chat_messages"` with `ON DELETE CASCADE`.
2. Run the full test suite: `pnpm test:run`
   All tests must pass, including the new chat-service and chat-routes tests.

3. Run `pnpm --filter @paperclipai/ui build` to verify the UI compiles cleanly with all new components.

4. If the dev server is not running, start it: `pnpm dev`
cd /Volumes/UsbNvme/repos/nexus && pnpm test:run && pnpm --filter @paperclipai/ui build - `pnpm test:run` exits 0 - `pnpm --filter @paperclipai/ui build` exits 0 - Migration SQL file exists in packages/db/src/migrations/ containing "chat_conversations" and "chat_messages" Full test suite green, UI builds clean, migration SQL generated. Task 2: Visual and functional verification of chat foundation Present the running application to the user for visual verification of all Phase 21 requirements. Ensure the dev server is running at http://localhost:5173 and the database migration has been applied. User provides "approved" signal User confirms chat foundation works correctly. Complete chat foundation: right-side chat panel with conversation sidebar, markdown message rendering with syntax-highlighted code blocks and copy buttons, auto-resize input with keyboard shortcuts, theme-aware styling across all three themes, and persistent storage in PostgreSQL. 1. Open the app at http://localhost:5173 2. Click the chat icon (MessageSquare) in the top-right area of the layout — the chat panel should slide open from the right (380px wide) 3. Verify the PropertiesPanel (if visible) closes when chat opens 4. Click "New conversation" (Plus icon) — a conversation should appear in the sidebar list 5. Type "Hello, this is a test message" and press Enter — the message should appear right-aligned in the message area 6. Type a message with markdown: "Here is some **bold** and a code block:\n```typescript\nconst x: number = 42;\nconsole.log(x);\n```" and press Enter 7. Verify the code block has: - Syntax highlighting (colored keywords) - A "typescript" language label in the top-left - A copy button in the top-right (click it — should show checkmark for 2 seconds) 8. Switch themes: click the theme toggle button. For each theme (Catppuccin Mocha, Tokyo Night, Catppuccin Latte): - Verify the chat panel background matches the theme - Verify code block highlighting colors change with the theme - Verify text is readable and contrast is good 9. Test keyboard shortcuts: - Shift+Enter in the input should create a newline (not send) - Enter should send the message - Escape with text in input should clear the input - Escape with empty input should close the chat panel 10. Test conversation management: hover over a conversation in the sidebar, click the "..." menu: - Pin the conversation (should show pin icon) - Rename the conversation (should allow inline editing) - Archive the conversation (should disappear from list) - Create another conversation and delete it (should show "Delete this conversation?" confirmation) 11. Reload the page — conversations and messages should persist 12. Verify auto-resize: type multiple lines in the input — it should grow up to about 6 lines then scroll internally Type "approved" or describe any issues found Full visual and functional verification by user covering all 14 phase requirements.

<success_criteria> User approves the chat foundation as working correctly across all themes with proper markdown rendering, keyboard shortcuts, conversation CRUD, and persistence. </success_criteria>

After completion, create `.planning/phases/21-chat-foundation/21-04-SUMMARY.md`