Commit graph

2040 commits

Author SHA1 Message Date
Nexus Dev
688924a1ba docs(25-02): complete file upload UI plan — ChatFileDropZone, useChatFileUpload, ChatInput wired
- SUMMARY.md documents XHR progress pattern and backward-compatible props
- STATE.md advanced to plan 2, decisions logged, metrics recorded
- ROADMAP.md updated with 2/4 summaries complete for phase 25
- REQUIREMENTS.md marks FILE-05 complete
2026-04-04 03:55:48 +00:00
Nexus Dev
c876b9f142 feat(25-02): create ChatFileDropZone and integrate into ChatInput
- Create ChatFileDropZone component with drag-and-drop state and overlay
- Add onFilesPicked/pendingFiles/onRemoveFile props to ChatInput
- Wrap form in ChatFileDropZone for drag-and-drop support
- Add handlePaste for clipboard image paste (clipboardData.files)
- Add Paperclip icon button with hidden file input for file picker
- Show pending file chips above textarea with progress and remove button
- Add tests: renders file attach button, calls onFilesPicked, shows pending chips
2026-04-04 03:55:48 +00:00
Nexus Dev
1cf231a540 feat(25-01): create chatFileService with DB operations and deriveCategory helper
- Implement chatFileService(db) with create, getById, listByConversation, listByMessage, createReference, listReferences, attachToMessage
- Export deriveCategory() helper mapping MIME types to image/code/document/other
- Add unit tests verifying service methods and category derivation with mocked DB
2026-04-04 03:55:48 +00:00
Nexus Dev
0fe948d1d0 feat(25-02): add chatApi.uploadFile and useChatFileUpload hook
- Add uploadFile method to chatApi using XHR for progress tracking
- Add ChatFileUploadResponse to shared type imports
- Create useChatFileUpload hook with PendingFile lifecycle management
- Hook manages uploading/done/error states with progress callbacks
2026-04-04 03:55:48 +00:00
Nexus Dev
5393ba0947 docs(25-00): complete file system foundation plan — schema, types, validators, test stubs
- Create 25-00-SUMMARY.md with full plan documentation
- Update STATE.md: advance to plan 2/4, record metrics and decisions
- Update ROADMAP.md: phase 25 in progress (1/4 summaries)
- Update REQUIREMENTS.md: mark FILE-01, FILE-02, FILE-03 complete
2026-04-04 03:55:48 +00:00
Nexus Dev
f335d3762b feat(25-00): add shared types, validators, and test stubs for file system
- Add ChatFile, ChatFileReference, ChatFileUploadResponse, ChatFileListResponse interfaces to types/chat.ts
- Add optional files?: ChatFile[] field to ChatMessage interface
- Add uploadChatFileSchema and createFileReferenceSchema Zod validators to validators/chat.ts
- Re-export all new types and validators from shared/src/index.ts
- Create test stubs for chat-file-service.test.ts and chat-file-routes.test.ts with it.todo() entries
2026-04-04 03:55:48 +00:00
Nexus Dev
df88eaa56f feat(25-00): create chat_files and chat_file_references DB schema + migrations
- Add chatFiles Drizzle schema with companyId, conversationId, messageId, filename, mimeType, sizeBytes, objectKey, sha256, source, category, projectId columns
- Add chatFileReferences Drizzle schema for cross-conversation file references
- Add 0053_create_chat_files.sql migration with all columns, FKs, and indexes
- Add 0054_create_chat_file_references.sql migration with cascade deletes
- Export both tables from schema/index.ts
- Update _journal.json with entries for idx 53 and 54
2026-04-04 03:55:48 +00:00
Nexus Dev
d72c065fc7 docs(25-file-system): create phase plan — 4 plans in 3 waves
Plans cover FILE-01 through FILE-06: DB schema + shared types (wave 1),
server file service + routes and UI file upload (wave 2, parallel),
file preview components + full wiring (wave 3).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 03:55:48 +00:00
Nexus Dev
714868ab3c docs(25): auto-generated context (discuss skipped) 2026-04-04 03:55:48 +00:00
Nexus Dev
f5e1040f30 docs(phase-24): mark phase complete — 4/4 plans, gap closed inline 2026-04-04 03:55:48 +00:00
Nexus Dev
aa1bebf81b feat(24-03): add JSON export button to ChatPanel header (HIST-04 gap closure) 2026-04-04 03:55:48 +00:00
Nexus Dev
0a5af1f09d docs(24-03): complete integration wiring plan — SUMMARY, STATE, ROADMAP updated
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 03:55:48 +00:00
Nexus Dev
6551e7e1b7 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-04 03:55:48 +00:00
Nexus Dev
77132b4351 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-04 03:55:48 +00:00
Nexus Dev
d20dce57ba docs(24-02): complete UI components plan — hooks, API methods, search/bookmark/branch components 2026-04-04 03:55:48 +00:00
Nexus Dev
85bd30b6ee 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-04 03:55:48 +00:00
Nexus Dev
ac6d75ab0d 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-04 03:55:48 +00:00
Nexus Dev
505f5e2262 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-04 03:55:48 +00:00
Nexus Dev
61161a3561 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-04 03:55:48 +00:00
Nexus Dev
d56e19c7b4 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-04 03:55:48 +00:00
Nexus Dev
16833a1ea6 docs(24-00): complete foundation plan — migrations, schema, types, test stubs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 03:55:48 +00:00
Nexus Dev
dc6316cf28 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-04 03:55:48 +00:00
Nexus Dev
988514db41 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-04 03:55:48 +00:00
Nexus Dev
1e4d2be3dd docs(24-search-history-branching): create phase plan 2026-04-04 03:55:48 +00:00
Nexus Dev
502ad9c63e docs(24): research phase domain 2026-04-04 03:55:48 +00:00
Nexus Dev
a2ea035aa1 docs(24): auto-generated context (discuss skipped) 2026-04-04 03:55:48 +00:00
Nexus Dev
017e53174f docs(phase-23): mark phase complete — 4/4 plans, 13/15 must-haves verified (2 human-deferred) 2026-04-04 03:55:48 +00:00
Nexus Dev
d2834c6cf4 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-04 03:55:48 +00:00
Nexus Dev
92d0ada080 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-04 03:55:48 +00:00
Nexus Dev
71839e0032 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-04 03:55:48 +00:00
Nexus Dev
9205ee82e3 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-04 03:55:48 +00:00
Nexus Dev
b2038e1884 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-04 03:55:48 +00:00
Nexus Dev
1fe00d1798 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-04 03:55:48 +00:00
Nexus Dev
b128611058 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-04 03:55:48 +00:00
Nexus Dev
fab233e89c 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-04 03:55:47 +00:00
Nexus Dev
2542442e33 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-04 03:55:47 +00:00
Nexus Dev
fe51918ed2 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-04 03:55:47 +00:00
Nexus Dev
5671b24210 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-04 03:55:47 +00:00
Nexus Dev
a424e96dd7 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-04 03:55:47 +00:00
Nexus Dev
9ed6dd16b3 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-04 03:55:47 +00:00
Nexus Dev
c4c709cd0f docs(phase-23): add validation strategy 2026-04-04 03:55:47 +00:00
Nexus Dev
2fbad4b6c8 docs(23): research brainstormer-flow phase domain 2026-04-04 03:55:47 +00:00
Nexus Dev
e762ddd15c docs(23): fix UI-SPEC spacing — replace 6px/12px with 4px/16px grid values 2026-04-04 03:55:47 +00:00
Nexus Dev
fe61a0bc09 docs(23): UI design contract for brainstormer-flow phase
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 03:55:47 +00:00
Nexus Dev
1f5fae08e2 docs(23): auto-generated context (discuss skipped) 2026-04-04 03:55:47 +00:00
Nexus Dev
36418df0a0 docs(phase-22): mark phase complete — 6/6 plans, 28/28 must-haves verified 2026-04-04 03:55:47 +00:00
Nexus Dev
33f300bf54 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-04 03:55:47 +00:00
Nexus Dev
8edee91d26 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-04 03:55:47 +00:00
Nexus Dev
954e7819c6 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-04 03:55:47 +00:00
Nexus Dev
724e2b2bd8 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-04 03:55:47 +00:00