Commit graph

1972 commits

Author SHA1 Message Date
Nexus Dev
ce037c235c feat(24-03): add bookmark toggle to ChatMessage and ChatMessageActions
- Add onBookmark/isBookmarked props to ChatMessageActions
- Render ChatMessageBookmark as last action for user and assistant messages
- Add onBookmark/isBookmarked props to ChatMessage, thread to ChatMessageActions
- System messages do not receive bookmark actions
2026-04-02 15:08:51 +00:00
Nexus Dev
0dde83b566 feat(24-03): wire search, branch selector, export, scroll-to-message into ChatPanel
- Add scrollToMessageId/setScrollToMessageId to ChatPanelContext
- Add "Search chat messages" item to CommandPalette (dispatches nexus:open-chat-search)
- Integrate ChatSearchDialog, ChatBranchSelector, ChatBookmarkList into ChatPanel
- Add export buttons (Markdown) and bookmarks panel toggle in header
- Wire branch-on-edit: branchConversation called when editing message with subsequent replies
- Add scroll-to-message support in ChatMessageList via virtualizer.scrollToIndex
- Show GitBranch icon for branch conversations in ChatConversationList
2026-04-02 15:08:51 +00:00
Nexus Dev
6b474f5d26 docs(24-02): complete UI components plan — hooks, API methods, search/bookmark/branch components 2026-04-02 15:08:51 +00:00
Nexus Dev
0ab633fc53 docs(24-01): complete search-history-branching plan 01 — service methods and routes
- SUMMARY.md: 6 service methods + 6 route handlers documented
- STATE.md: advanced to plan 3/4, recorded metrics and decisions
- ROADMAP.md: updated phase 24 progress (2/4 summaries)
2026-04-02 15:08:51 +00:00
Nexus Dev
8ab8e592d4 feat(24-02): UI components — ChatSearchDialog, ChatMessageBookmark, ChatBookmarkList, ChatBranchSelector
- ChatSearchDialog: CommandDialog with shouldFilter=false for server-side FTS, term highlighting via React components
- ChatMessageBookmark: ghost icon button with fill-current for bookmarked state, aria-label toggle
- ChatBookmarkList: scrollable list with skeleton loading, empty state, navigation callbacks
- ChatBranchSelector: horizontal branch picker bar with GitBranch icon, active branch highlight
2026-04-02 15:08:51 +00:00
Nexus Dev
2af9de913d feat(24-01): add search, bookmark, branch, and export Express route handlers
- GET /companies/:companyId/messages/search: FTS search with ZodError 400 guard
- POST /conversations/:id/bookmarks: toggle bookmark with UUID validation
- GET /companies/:companyId/bookmarks: list bookmarks with optional conversationId filter
- POST /conversations/:id/branch: branch conversation from message point
- GET /conversations/:id/branches: list child conversations
- GET /conversations/:id/export: download Markdown or JSON with Content-Disposition header
2026-04-02 15:08:51 +00:00
Nexus Dev
430588a54e feat(24-01): add searchMessages, toggleBookmark, getBookmarks, branchConversation, listBranches, exportConversation service methods
- searchMessages: tsvector FTS with ts_rank ordering, joins conversations for companyId scoping
- toggleBookmark: transactional insert-or-delete bookmark
- getBookmarks: joins bookmarks+messages+conversations, supports conversationId filter
- branchConversation: copies messages up to branch point into new child conversation
- listBranches: queries child conversations by parentConversationId
- exportConversation: LEFT JOINs agents for name resolution, produces Markdown or JSON with file headers
2026-04-02 15:08:51 +00:00
Nexus Dev
1b80631b66 feat(24-02): API client methods and React Query hooks for search, bookmarks, branches
- Add searchMessages, toggleBookmark, getBookmarks, branchConversation, listBranches, exportConversation to chatApi
- Create useChatSearch hook with debounced FTS, placeholderData, 30s staleTime
- Create useChatBookmarks and useToggleBookmark with cache invalidation for bookmarks and search queries
2026-04-02 15:08:51 +00:00
Nexus Dev
d78bdad0a9 docs(24-00): complete foundation plan — migrations, schema, types, test stubs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 15:08:51 +00:00
Nexus Dev
3eb4463cbb feat(24-00): shared types, validators, and Wave 0 test stubs for phase 24
- Add ChatMessageSearchResult, ChatMessageSearchResponse to shared types
- Add ChatBookmark, ChatBookmarkWithMessage, ChatBookmarkListResponse, ChatBookmarkToggleResponse
- Add parentConversationId + branchFromMessageId to ChatConversation and ChatConversationListItem
- Add searchMessagesSchema + branchConversationSchema to validators
- Re-export all new types and validators from shared/src/index.ts
- Add Wave 0 it.todo stubs: searchMessages, toggleBookmark, branchConversation, exportConversation
- Add Wave 0 it.todo stubs for 4 new route groups in chat-routes.test.ts
2026-04-02 15:08:51 +00:00
Nexus Dev
65f5603c23 feat(24-00): DB migrations and Drizzle schema updates for search/history/branching
- Add 0050_add_branch_columns.sql: parent_conversation_id + branch_from_message_id on chat_conversations
- Add 0051_add_message_search_vector.sql: content_search tsvector + GIN index on chat_messages
- Add 0052_create_chat_message_bookmarks.sql: new bookmarks table with company/message/conversation FK
- Update chat_conversations.ts: parentConversationId + branchFromMessageId columns + parentIdx
- Update chat_messages.ts: add comment for generated tsvector column
- Create chat_message_bookmarks.ts: Drizzle schema with indexes
- Update schema/index.ts: export chatMessageBookmarks
- Update _journal.json: entries for idx 50, 51, 52
2026-04-02 15:08:51 +00:00
Nexus Dev
009527b809 docs(24-search-history-branching): create phase plan 2026-04-02 15:08:51 +00:00
Nexus Dev
6e81c3c6f3 docs(24): research phase domain 2026-04-02 15:08:51 +00:00
Nexus Dev
7d7b31e533 docs(24): auto-generated context (discuss skipped) 2026-04-02 15:08:51 +00:00
Nexus Dev
041b382a10 docs(phase-23): mark phase complete — 4/4 plans, 13/15 must-haves verified (2 human-deferred) 2026-04-02 15:08:51 +00:00
Nexus Dev
f3f5f60cd7 docs(23-03): complete chat integration wiring plan
- SUMMARY.md for 23-03 (messageType dispatch, ChatPanel wiring, handoffSpec/postStatusUpdate)
- STATE.md: plan advanced, metrics recorded, decisions added
- ROADMAP.md: Phase 23 marked Complete (4/4 summaries)
2026-04-02 15:08:51 +00:00
Nexus Dev
bd0b79e8df feat(23-03): wire useBrainstormerDefault and handleHandoff into ChatPanel
- Import useBrainstormerDefault hook and useToast context
- Auto-select general agent for new conversations (when activeConversationId is null)
- Add handleHandoff callback: calls chatApi.handoffSpec, invalidates messages cache, shows error toast on failure
- Pass onHandoff={handleHandoff} to ChatMessageList
2026-04-02 15:08:51 +00:00
Nexus Dev
78dbfbc26b feat(23-03): add messageType dispatch, ChatMessageList propagation, and chatApi handoff methods
- ChatMessage: add messageType/conversationId/onHandoff props; dispatch to ChatSpecCard, ChatHandoffIndicator, ChatTaskCreatedBadge, ChatStatusUpdateBadge based on messageType
- ChatMessageList: propagate messageType and conversationId to ChatMessage; add onHandoff prop
- chatApi: add handoffSpec() and postStatusUpdate() methods
2026-04-02 15:08:51 +00:00
Nexus Dev
7feacb121f feat(23-01): add handoff and status-update routes to chat API
- POST /conversations/:id/handoff: resolves companyId, inserts handoff
  message, creates issue from spec, inserts task_created message
- POST /conversations/:id/status-update: inserts status_update message
- Import issueService and handoffSchema; instantiate issueSvc in chatRoutes
- Both routes use assertBoard for authentication
2026-04-02 15:08:51 +00:00
Nexus Dev
2a0c5769f3 feat(23-01): extend chat service with messageType support and addSystemMessage
- addMessage now accepts optional messageType parameter
- addSystemMessage helper inserts system-role messages with typed messageType
- Both methods bump conversation updatedAt for correct sort order
2026-04-02 15:08:51 +00:00
Nexus Dev
dac6501aab docs(23-01): complete chat service extension plan — handoff + status-update routes
- Add 23-01-SUMMARY.md with accomplishments and commit hashes
- Update STATE.md: advance to plan 4, update progress to 94%, log session
- Update ROADMAP.md: phase 23 at 3/4 summaries, In Progress
2026-04-02 15:08:51 +00:00
Nexus Dev
9796bee2b3 docs(23-02): complete UI components plan summary, update state and roadmap
- 5 new files: ChatSpecCard, ChatHandoffIndicator, ChatTaskCreatedBadge, ChatStatusUpdateBadge, useBrainstormerDefault
- Fix ChatMessageList synthetic streaming entry missing messageType field
- Progress: 15/17 plans complete (88%)
2026-04-02 15:08:51 +00:00
Nexus Dev
df83f6e43c docs(23-00): complete foundation plan summary, update state and roadmap
- 23-00-SUMMARY.md: DB migration + shared types + Wave 0 test stubs
- STATE.md: advance to plan 2/4, record metric and decision
- ROADMAP.md: update phase 23 progress (1/4 summaries)
- REQUIREMENTS.md: mark AGENT-01 through AGENT-07 and CHAT-09 complete
2026-04-02 15:08:51 +00:00
Nexus Dev
baaa2c02de test(23-00): Wave 0 test stubs for Phase 23 components and hooks
- ChatSpecCard.test.tsx — 9 it.todo() entries covering spec card behaviors
- ChatHandoffIndicator.test.tsx — 3 it.todo() entries
- ChatTaskCreatedBadge.test.tsx — 4 it.todo() entries
- ChatStatusUpdateBadge.test.tsx — 3 it.todo() entries
- useBrainstormerDefault.test.ts — 4 it.todo() entries
- All 23 todo tests found and skipped by vitest (0 failures)
2026-04-02 15:08:51 +00:00
Nexus Dev
fab74e888c feat(23-02): add ChatTaskCreatedBadge, ChatStatusUpdateBadge, useBrainstormerDefault
- ChatTaskCreatedBadge renders loading state and resolved badge with View task link
- ChatStatusUpdateBadge renders CheckCircle2 + agent completion text with task link
- useBrainstormerDefault returns general role agent ID with React Query deduplication
- Fix ChatMessageList synthetic streaming entry to include messageType: null
2026-04-02 15:08:51 +00:00
Nexus Dev
6e3387ea88 feat(23-00): DB migration and shared types for message_type
- Add message_type text column to chat_messages Drizzle schema
- Create SQL migration 0049_add_message_type.sql
- Update _journal.json with entries for idx 47, 48, 49
- Add messageType field to ChatMessage interface
- Add messageType to createMessageSchema (optional)
- Add handoffSchema and Handoff type to validators/chat.ts
- Re-export handoffSchema and Handoff from shared/src/index.ts
2026-04-02 15:08:51 +00:00
Nexus Dev
692aa9649c feat(23-02): add ChatSpecCard and ChatHandoffIndicator components
- ChatSpecCard renders 4-field spec (What/Why/Constraints/Success) with edit mode
- ChatSpecCard action row: Send to PM, Edit, Save as Draft buttons
- ChatSpecCard edit mode with aria-labels, Escape key discard, tab order
- ChatHandoffIndicator separator-style with flanking hr and aria-label
2026-04-02 15:08:51 +00:00
Nexus Dev
ce992b28f0 docs(23-brainstormer-flow): create phase plan — 4 plans across 3 waves
Plan 00 (Wave 0): DB migration for message_type, shared types/validators, test stubs
Plan 01 (Wave 1): Server — addSystemMessage, handoff route, status-update route
Plan 02 (Wave 1): UI — ChatSpecCard, ChatHandoffIndicator, ChatTaskCreatedBadge, ChatStatusUpdateBadge, useBrainstormerDefault
Plan 03 (Wave 2): Wiring — ChatMessage dispatch, ChatMessageList propagation, ChatPanel brainstormer default, chatApi handoff

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 15:08:51 +00:00
Nexus Dev
20d1ccbb56 docs(phase-23): add validation strategy 2026-04-02 15:08:51 +00:00
Nexus Dev
9f7ab07752 docs(23): research brainstormer-flow phase domain 2026-04-02 15:08:51 +00:00
Nexus Dev
b9719a8ca5 docs(23): fix UI-SPEC spacing — replace 6px/12px with 4px/16px grid values 2026-04-02 15:08:51 +00:00
Nexus Dev
6275d0d5c9 docs(23): UI design contract for brainstormer-flow phase
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02 15:08:51 +00:00
Nexus Dev
b0d830e17c docs(23): auto-generated context (discuss skipped) 2026-04-02 15:08:51 +00:00
Nexus Dev
3efbacf603 docs(phase-22): mark phase complete — 6/6 plans, 28/28 must-haves verified 2026-04-02 15:08:51 +00:00
Nexus Dev
16db157ec0 docs(22-05): complete final integration plan summary, update state and roadmap
- SUMMARY: virtualized ChatMessageList, fully wired ChatPanel and ChatInput
- STATE: plan 05 complete, phase 22 all 5 plans done, stopped_at updated
- ROADMAP: phase 22 marked Complete (6/6 summaries)
- REQUIREMENTS: PERF-03 marked complete (CHAT-01/08/10/11/12, INPUT-05/06, PERF-02 already complete)
2026-04-02 15:08:51 +00:00
Nexus Dev
9da6acad50 feat(22-05): wire ChatPanel and ChatInput with all Phase 22 features
- ChatPanel integrates useStreamingChat, ChatAgentSelector, ChatStopButton
- Agent routing via resolveAgentFromContent for slash commands and @mentions
- handleEdit: editMessage + truncateMessagesAfter + re-stream with edited content
- handleRetry: finds actual prior user message, truncates from user message onward, re-streams
- Build agentMap from agents for message identity bars
- ChatInput: slash command popover (triggered by / at start of input)
- ChatInput: @mention popover (triggered by @word pattern)
- Input disabled during streaming with 'Waiting for response...' placeholder
- Stop button shown conditionally when isStreaming
- Agent selector in header for per-conversation agent switching
- Remove ScrollArea wrapper (replaced by virtualizer's own scroll in ChatMessageList)
2026-04-02 15:08:50 +00:00
Nexus Dev
26894428a9 feat(22-05): virtualize ChatMessageList and add chat API edit/truncate methods
- Rewrite ChatMessageList with @tanstack/react-virtual useVirtualizer (estimateSize: 80, overscan: 5)
- Dynamic height measurement via measureElement ref
- Streaming message appended as synthetic __streaming__ entry
- virtualizer.measure() called on streamingContent change (Pitfall 3)
- Jump-to-bottom button when scrolled >200px from bottom
- 3 Skeleton loading placeholders
- Add editMessage, truncateMessagesAfter, deleteMessage to chatApi
- Add postMessageAndStream and savePartialMessage (were missing from prior plan)
- Fix duplicate ChatConversation type exports in packages/shared/src/index.ts (Rule 1 - Bug)
2026-04-02 15:08:50 +00:00
Nexus Dev
6c550c8227 feat(22-04): ChatMentionPopover component
- Create ChatMentionPopover (200px, opens upward, agent icon + name + role label)
- Agents filtered by query, max 5 visible, No agents found empty state
- 3 skeleton rows loading state, onOpenAutoFocus prevented for textarea focus
- Include agent-role-colors dependency for worktree build
2026-04-02 15:08:50 +00:00
Nexus Dev
a1fc8b9dab feat(22-04): slash command routing utility and ChatSlashCommandPopover
- Create ui/src/lib/slash-commands.ts with SLASH_COMMANDS (5 commands) and resolveAgentFromContent
- Create ChatSlashCommandPopover (260px, opens upward, /search greyed with Coming soon)
- Add test coverage for routing logic (slash commands, @mentions, fallback)
2026-04-02 15:08:50 +00:00
Nexus Dev
47430d0e93 docs(22-04): complete slash command and mention popover plan
- Create 22-04-SUMMARY.md
- Update STATE.md with plan completion, metrics, decisions
- Update ROADMAP.md plan progress (5/6 summaries)
- Mark requirements INPUT-05, INPUT-06 complete
2026-04-02 15:08:50 +00:00
Nexus Dev
fbfcd454cb docs(22-03): complete message action controls plan — ChatStopButton, ChatMessageActions, ChatMessage edit mode 2026-04-02 15:08:50 +00:00
Nexus Dev
4b531e3848 feat(22-03): extend ChatMessage with inline edit mode and action callbacks
- Add id, isAnyStreaming, onEdit, onRetry props to ChatMessageProps
- User messages show edit Pencil on hover via ChatMessageActions
- Edit pencil opens inline textarea with Save/Discard buttons
- Save edit calls onEdit(id, newContent), disabled when textarea empty
- Discard edit reverts to read-only bubble
- Assistant messages show retry RefreshCw via ChatMessageActions
- All edit/retry actions disabled when isAnyStreaming is true
- Update test stubs to reflect new prop surface
2026-04-02 15:08:50 +00:00
Nexus Dev
e91651caaa feat(22-03): add ChatStopButton and ChatMessageActions components
- ChatStopButton: centered outline button with Square icon and 'Stop generating' label
- ChatMessageActions: edit Pencil for user messages (absolute, group-hover)
- ChatMessageActions: retry RefreshCw for assistant messages (right-aligned, group-hover)
- Both action buttons return null when isStreaming is true
- Proper aria-labels and tooltips on all interactive elements
2026-04-02 15:08:50 +00:00
Nexus Dev
8ebfd1a8c1 feat(22-02): ChatAgentSelector component with agent dropdown and role colors
- Create ChatAgentSelector with Popover+Command dropdown
- Show active agent icon, name, and ChevronDown indicator
- 'Select agent' placeholder when no agent selected
- 'No agents configured' empty state via CommandEmpty
- Agent list shows icon, name, and role label per item
- Selection calls onAgentChange and PATCHes conversation via chatApi
- Role-specific colors from agentRoleColors applied to agent icons
- Loading state shows Skeleton placeholder
- Create chat.ts API client with updateConversation supporting agentId
- Create shared types/chat.ts with ChatMessage, ChatConversation types
- Create ChatCodeBlock prerequisite from phase-21 base
- TypeScript compiles clean
2026-04-02 15:08:50 +00:00
Nexus Dev
704e9f2406 feat(22-02): ChatMessageIdentityBar, ChatStreamingCursor, and extended ChatMessage
- Create ChatMessageIdentityBar with agent icon, name, timestamp, and streaming dot
- Create ChatStreamingCursor with animate-cursor-blink and aria-hidden
- Extend ChatMessage with agentName, agentIcon, agentRole, timestamp, isStreaming props
- Wrap assistant messages in group div for hover actions (Plan 03)
- Create agent-role-colors.ts with 11 distinct role colors (light + dark variants)
- Create ChatMarkdownMessage prerequisite from phase-21 base
- All 4 ChatMessageIdentityBar tests pass
2026-04-02 15:08:50 +00:00
Nexus Dev
8f7264a86c docs(22-01): complete SSE streaming endpoint plan 2026-04-02 15:08:50 +00:00
Nexus Dev
060fec5c6f feat(22-01): add useStreamingChat hook, chat API stream method, and unit tests
- Add postMessageAndStream and savePartialMessage to chatApi (fetch ReadableStream for POST SSE)
- Create useStreamingChat hook with startStream, stop, streamingContent, isStreaming
- startTransition wraps token updates to avoid blocking user input (PERF-02)
- AbortController used for stop functionality (CHAT-12)
- stop() saves partial content with [stopped] suffix to DB
- Add @testing-library/react devDependency to enable renderHook testing
- 5 passing unit tests: token accumulation, lifecycle, stop/abort, error, null guard
2026-04-02 15:08:50 +00:00
Nexus Dev
ea1a176b67 feat(22-01): add SSE streaming endpoint and edit/truncate service methods
- Add editMessage, truncateMessagesAfter, streamEcho methods to chatService
- Add POST /conversations/:id/stream SSE endpoint with flushHeaders before loop (PERF-02)
- Add PATCH /conversations/:id/messages/:msgId for message editing
- Add DELETE /conversations/:id/messages/after/:msgId for message truncation
- Import gt from drizzle-orm for createdAt comparison in truncateMessagesAfter
- Guard all res.write() calls with res.writable check (prevents write-after-end)
2026-04-02 15:08:50 +00:00
Nexus Dev
ab40702606 docs(22-02): complete agent identity components plan — ChatMessageIdentityBar, ChatAgentSelector, agent-role-colors 2026-04-02 15:08:50 +00:00
Nexus Dev
02abd5f8cb docs(22-00): complete Wave 0 foundation plan — migration, types, react-virtual, agent-role-colors, CSS, test stubs 2026-04-02 15:08:50 +00:00