feat: Add FilesPanel component#41
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
📝 WalkthroughWalkthroughAdds assistant management across backend, IPC, UI, hooks, types, and context providers; introduces mode persistence and switching, assistant/file CRUD via a new AssistantService, UI panels for assistants/files, and new Electron APIs for dialog and preferred mode. Changes
Sequence DiagramsequenceDiagram
participant UI as UI Component
participant Context as Mode/Selection Context
participant Hook as React-Query Hook
participant IPC as IPC Handler (main)
participant Service as AssistantService
participant SDK as Pinecone SDK
UI->>Context: read mode / active assistant
Context-->>UI: current mode / selection
UI->>Hook: query assistants (profileId)
Hook->>IPC: invoke 'assistant:list' (profileId)
IPC->>Service: listAssistants()
Service->>SDK: client.assistants.list()
SDK-->>Service: assistants[]
Service-->>IPC: mapped assistants[]
IPC-->>Hook: { success, data }
Hook-->>UI: render assistants
Note over UI,Hook: File upload flow
UI->>IPC: invoke 'dialog:showOpenDialog'
IPC-->>UI: { filePaths }
UI->>Hook: upload mutation (filePaths)
Hook->>IPC: invoke 'assistant:files:upload'
IPC->>Service: uploadFile(...)
Service->>SDK: client.assistants.files.upload(...)
SDK-->>Service: AssistantFile
Service-->>IPC: mapped file
IPC-->>Hook: { success, data }
Hook->>Hook: invalidate files query (polling 5s while processing)
Hook-->>UI: updated file list/status
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
electron/pinecone-service.ts (1)
40-60:⚠️ Potential issue | 🟡 MinorConsider clearing
assistantServiceon disconnect.The
assistantServicefield is lazily initialized ingetAssistantService(), but it's not cleared in thedisconnect()method (Lines 92-98). This could lead to a staleAssistantServiceinstance holding a reference to the old Pinecone client after reconnection.🔧 Proposed fix
disconnect(): void { this.client = null this.embeddingService = null + this.assistantService = null this.profile = null this.indexCache.clear() this.indexInfoCache.clear() }
🤖 Fix all issues with AI agents
In @.linear.toml:
- Around line 4-5: Update the Linear workspace value in the .linear.toml file:
change the workspace key from "chroma-explorer" to the correct Pinecone Explorer
workspace name used by this repo (replace the string value for workspace) so the
entry reads workspace = "<pinecone-explorer-workspace>" while keeping team_id =
"PINE" unchanged; locate the workspace entry in .linear.toml and update the
string literal accordingly.
In `@src/components/assistants/AssistantsPanel.tsx`:
- Around line 148-181: Replace the clickable <div> wrapper for each assistant
row in AssistantsPanel.tsx with a semantic <button type="button"> that retains
the same className, onClick handler (handleAssistantClick), onContextMenu
handler (handleAssistantContextMenu), and title (using getStatusTooltip), so
rows become focusable and operable by keyboard; keep the inner status indicator
and text (which use getStatusColor and getStatusTooltip) unchanged, ensure you
do not add an extra role or tabIndex (native button semantics suffice), and
update any styling assumptions that relied on the element being a div (e.g.,
remove flex/inline styles that conflict with button defaults) so keyboard users
can use Enter/Space to activate rows and the context menu still opens on
right-click.
In `@src/context/ModeContext.tsx`:
- Around line 35-52: The keyboard shortcut effect captures a stale setMode
closure causing mode changes to apply to the wrong profile after switching;
update the useEffect that defines handleKeyDown to include setMode in its
dependency array (so the effect re-attaches when the profile-specific setter
changes) and remove the manual eslint-disable-line react-hooks/exhaustive-deps;
ensure the listener registration/removal still uses the same handleKeyDown names
so addEventListener/removeEventListener remain paired.
In `@src/hooks/useAssistantQueries.ts`:
- Around line 145-174: The refetchInterval currently only polls when files have
status 'Processing', which misses files in the 'Deleting' state; update the
refetch condition inside useFilesQuery (function useFilesQuery, constant
FILES_POLL_INTERVAL, type AssistantFile) so it treats files with status ===
'Deleting' the same as 'Processing' (e.g., change hasProcessingFiles to check
file.status === 'Processing' || file.status === 'Deleting') so deletion
in-flight keeps the 5s polling interval.
🧹 Nitpick comments (2)
electron/main.ts (1)
1119-1137: Consider attaching dialog to parent window.The
showOpenDialogcall doesn't specify a parent window, which may cause the dialog to appear disconnected from the application on some platforms. Consider usingBrowserWindow.fromWebContents(event.sender)to attach the dialog to the calling window.♻️ Proposed enhancement
ipcMain.handle('dialog:showOpenDialog', async (event, options: { properties?: Array<'openFile' | 'openDirectory' | 'multiSelections' | 'showHiddenFiles'> filters?: Array<{ name: string; extensions: string[] }> title?: string defaultPath?: string }) => { try { + const win = BrowserWindow.fromWebContents(event.sender) - const result = await dialog.showOpenDialog({ + const result = await dialog.showOpenDialog(win!, { properties: options.properties || ['openFile'], filters: options.filters, title: options.title, defaultPath: options.defaultPath, }) return { success: true, data: result } } catch (error) {src/components/files/FilesPanel.tsx (1)
1-120: Clear stale file selection when assistant or file list changes.
Right nowactiveFilecan survive assistant switches or file deletions, which can leave downstream views pointing to a non-existent file. Consider resetting when the assistant changes or when the active file no longer exists.♻️ Suggested effect
-import { useState, useMemo, useCallback } from 'react' +import { useState, useMemo, useCallback, useEffect } from 'react' @@ const { data: files = [], isLoading, error, refetch } = useFilesQuery( currentProfile?.id || null, activeAssistant, !!activeAssistant ) + + useEffect(() => { + if (!activeAssistant) { + setActiveFile(null) + return + } + if (activeFile && !files.some((file) => file.id === activeFile)) { + setActiveFile(null) + } + }, [activeAssistant, activeFile, files, setActiveFile])
- Add useFilesQuery hook with dynamic polling (5s while processing) - Add FileSelectionContext for tracking selected file - Add FilesPanel component with status indicators and upload button - Add dialog:showOpenDialog IPC handler for native file picker - Wire up providers in ConnectionWindow Closes PINE-41
02efadd to
182a00e
Compare
* feat: Add ModeContext and ModeSwitcher UI (#37) * feat: Add ModeContext and ModeSwitcher UI - Add ModeContext for managing index/assistant mode state - Add ModeSwitcher segmented control with Database/Bot icons - Persist mode preference per connection profile - Add keyboard shortcuts Cmd+1 (Index) and Cmd+2 (Assistant) Closes PINE-36 * fix: address review comments on PINE-36 - Update .linear.toml workspace from chroma-explorer to pinecone-explorer - Make setPreferredMode throw on missing profile instead of silently no-op - Change ModeSwitcher from tablist/tab to radiogroup/radio for accessibility * fix: add packages field to pnpm-workspace.yaml for CI * fix: add aria-label for accessible name on ModeSwitcher buttons --------- Co-authored-by: Atlas (Engineering Lead) <atlas@openclaw.ai> Co-authored-by: Scout (Lead Tester) <scout@openclaw.ai> * feat: Add AssistantService with CRUD operations (#38) * feat: Add AssistantService with CRUD operations - Add AssistantService class wrapping Pinecone SDK assistant methods - Add IPC handlers for assistant:list/create/describe/update/delete - Add preload bindings for window.electronAPI.assistant - Add TypeScript types for AssistantModel, CreateAssistantParams, UpdateAssistantParams - Wire up service to PineconeService with getAssistantService() method Closes PINE-37 * fix: address review comments on PINE-37 - Normalize metadata null to undefined in mapAssistantModel - Fix stale setMode closure in keyboard shortcut handler (moved setMode before useEffect, added to deps) --------- Co-authored-by: Atlas (Engineering Lead) <atlas@openclaw.ai> Co-authored-by: Scout (Lead Tester) <scout@openclaw.ai> * feat: Add AssistantsPanel component (#39) * feat: Add AssistantsPanel component - Add useAssistantQueries.ts with React Query hooks for assistant CRUD - Add AssistantSelectionContext.tsx for managing selected assistant - Add AssistantsPanel.tsx mirroring IndexesPanel pattern - Status indicators: Ready (green), Initializing (yellow), Failed (red) - Loading, error, and empty states handled Closes PINE-38 * feat(assistant): add file management IPC handlers (PINE-40) Add file operations scoped to a specific assistant: Types (electron/types.ts): - AssistantFileStatus enum: Processing, Available, Deleting, ProcessingFailed - AssistantFile interface with id, name, status, percentDone, metadata, signedUrl, errorMessage - ListAssistantFilesFilter for filtering files - UploadAssistantFileParams for file upload with metadata AssistantService (electron/assistant-service.ts): - listFiles(assistantName, filter?) - List files for an assistant - describeFile(assistantName, fileId) - Get file details with signed URL - uploadFile(assistantName, params) - Upload file from disk path - deleteFile(assistantName, fileId) - Delete a file IPC handlers (electron/main.ts): - assistant:files:list - assistant:files:describe - assistant:files:upload - assistant:files:delete Preload bindings (electron/preload.ts): - assistant.files.list() - assistant.files.describe() - assistant.files.upload() - assistant.files.delete() TypeScript declarations (src/types/electron.d.ts): - Added all file types and API methods * feat: Add FilesPanel component - Add useFilesQuery hook with dynamic polling (5s while processing) - Add FileSelectionContext for tracking selected file - Add FilesPanel component with status indicators and upload button - Add dialog:showOpenDialog IPC handler for native file picker - Wire up providers in ConnectionWindow Closes PINE-41 * feat(files): add UploadFileDialog component with drag-and-drop support PINE-42 - Add useUploadFileMutation hook to useAssistantQueries.ts - Create UploadFileDialog component with: - Drag-and-drop file zone - File picker button using native dialog - Selected file preview with name and size - Optional metadata JSON editor with validation - Multimodal checkbox (enabled only for PDF files) - Upload progress indicator - Error handling with inline message - Dialog closes on successful upload - Wire up FilesPanel upload button to open UploadFileDialog * feat(PINE-43): Create FileDetailPanel component - Create FileDetailPanel.tsx showing file metadata when selected - Add ID field with copy-to-clipboard button - Display status with color indicator (Available/Processing/Failed/Deleting) - Show processing progress bar when file is processing - Show error message section for failed files - Display timestamps (created/updated) with formatted dates - Show custom metadata as JSON - Add Download button that opens signedUrl via shell.openExternal - Add Delete button with confirmation dialog - Add useDeleteFileMutation and useFileDetailQuery hooks to useAssistantQueries.ts - Export FileDetailPanel from files/index.ts Note: File size display not implemented as AssistantFile type from Pinecone API does not include a size field. * feat: Add chat IPC handlers with streaming support - Add ChatMessage, ChatParams, ChatResponse, ChatStreamChunk types - Add chat() and chatStream() methods to AssistantService - Add IPC handlers for assistant:chat, assistant:chat:stream:start/cancel - Add preload bindings with onChunk event listener for streaming - Track active streams with AbortController for cancellation Closes PINE-44 * feat(PINE-45): Create ChatView main component - Create src/components/chat/ChatView.tsx - Layout with scrollable message list and fixed input area - Message display with user/assistant avatars and styling - Model dropdown selector (gpt-4o, claude-3-5-sonnet, gemini-2.0-flash) - Clear conversation button - Auto-scroll to bottom on new messages - Submit on Enter, Shift+Enter for newline - Send button disabled while streaming - Stop generation button during streaming - Citation display for assistant messages - Empty state with helpful instructions - Create src/hooks/useChatStream.ts - Manages streaming state and message accumulation - Handles chunk events (message_start, content, citation, message_end, error) - Returns: messages, isStreaming, sendMessage, clearMessages, cancelStream - Properly cleans up subscriptions on unmount - Update src/components/layout/MainContent.tsx - Import ModeContext and AssistantSelectionContext - Render ChatView when mode === 'assistant' and an assistant is selected - Show empty state message when in assistant mode without selection - Keep existing VectorsView for mode === 'index' * feat(PINE-46): Create ChatMessage component with streaming - Add ChatMessage component with markdown support via react-markdown - User messages right-aligned with blue/primary background - Assistant messages left-aligned with muted background - Typing indicator (animated dots) when streaming with empty content - Live cursor animation during content streaming - Citation numbers as clickable superscripts inline with text - Styled code blocks and inline code - Update ChatView to use new ChatMessage component * feat(chat): add CitationPopover component for interactive citations - Create CitationPopover component using Radix Popover - Shows file name and page numbers for each reference - View File button navigates using FileSelectionContext - Update ChatMessage to wrap citation superscripts with popover - Popover closes on outside click (Radix default behavior) Closes PINE-47 * feat: Wire up Assistant mode in MainContent - Conditionally render AssistantsPanel/IndexesPanel based on mode - Conditionally render FilesPanel/NamespacesPanel based on mode - Conditionally render FileDetailPanel/VectorDetailPanel based on mode - Preserve panel resize handles and widths - Selection state isolated between modes via separate contexts Closes PINE-48 * feat(PINE-49): Add context menus for Assistants and Files - Add IPC handlers in main.ts for context-menu:show-assistant and context-menu:show-file - Add preload bindings for showAssistantMenu, onAssistantAction, showFileMenu, onFileAction - Update AssistantsPanel.tsx with: - Native context menu on right-click with Edit and Delete options - Delete confirmation dialog with name verification - Hook integration with useDeleteAssistantMutation - Update FilesPanel.tsx with: - Native context menu on right-click with Download and Delete options - Delete confirmation dialog - Download via signedUrl fetch and shell.openExternal - Hook integration with useDeleteFileMutation and useFileDetailQuery - Update TypeScript declarations in electron.d.ts Acceptance criteria: - Right-click assistant shows Edit/Delete menu ✓ - Right-click file shows Download/Delete menu ✓ - Delete actions show confirmation dialog ✓ - Menu actions trigger correct operations ✓ * feat(PINE-50): Add keyboard shortcuts for Assistant mode - Update keyboard shortcuts constants with new assistant/chat categories: - INDEX_MODE (Cmd+1): Switch to Index mode - ASSISTANT_MODE (Cmd+2): Switch to Assistant mode - NEW_ASSISTANT (Cmd+Shift+N): Create new assistant - SEND_MESSAGE (Cmd+Enter): Send chat message - FOCUS_CHAT_INPUT (Cmd+K): Focus chat input - CLEAR_CONVERSATION (Cmd+Shift+Backspace): Clear conversation - Update electron menu.ts: - Replace panel toggle items with Index Mode/Assistant Mode in View menu - Add Assistant menu with New Assistant, Chat submenu, Edit/Delete items - Chat submenu includes Send, Focus Input, Clear Conversation - Add IPC bindings in preload.ts for new menu events: - Mode switching: onSwitchToIndexMode, onSwitchToAssistantMode - Assistant: onNewAssistant, onEditAssistant, onDeleteAssistant - Chat: onSendMessage, onFocusChatInput, onClearConversation - Update ModeContext.tsx to listen for menu IPC events - Update ChatView.tsx with keyboard shortcut handlers: - Cmd+K focuses chat input - Cmd+Shift+Backspace clears conversation - Cmd+Enter sends message (via menu) - Update AssistantsPanel.tsx: - Cmd+Shift+N creates new assistant - Handle menu events for edit/delete assistant - Update TypeScript types in electron.d.ts - Clean up obsolete toggle panel handlers from useMenuHandlers.ts --------- Co-authored-by: Atlas (Engineering Lead) <atlas@openclaw.ai> * feat: Add file management IPC handlers (#40) * feat(assistant): add file management IPC handlers (PINE-40) Add file operations scoped to a specific assistant: Types (electron/types.ts): - AssistantFileStatus enum: Processing, Available, Deleting, ProcessingFailed - AssistantFile interface with id, name, status, percentDone, metadata, signedUrl, errorMessage - ListAssistantFilesFilter for filtering files - UploadAssistantFileParams for file upload with metadata AssistantService (electron/assistant-service.ts): - listFiles(assistantName, filter?) - List files for an assistant - describeFile(assistantName, fileId) - Get file details with signed URL - uploadFile(assistantName, params) - Upload file from disk path - deleteFile(assistantName, fileId) - Delete a file IPC handlers (electron/main.ts): - assistant:files:list - assistant:files:describe - assistant:files:upload - assistant:files:delete Preload bindings (electron/preload.ts): - assistant.files.list() - assistant.files.describe() - assistant.files.upload() - assistant.files.delete() TypeScript declarations (src/types/electron.d.ts): - Added all file types and API methods * fix: address review comments - pnpm workspace, linear config, AssistantStatus type * fix: address review comments on PINE-40 - AssistantsPanel: Convert assistant row div to button for keyboard accessibility - AssistantsPanel: Add aria-pressed attribute for active state - ModeContext: Fix stale setMode closure by adding to useEffect dependencies - ModeContext: Reorder setMode definition before keyboard effect * fix: remove unused ExplorerMode type from electron/types.ts The ExplorerMode type was defined in electron/types.ts but never imported or used. The only active definition is in src/context/ModeContext.tsx. This change removes the duplicate definition and updates ConnectionProfile.preferredMode to use an inline union type. Co-authored-by: Stepan Arsentjev <stepandel@users.noreply.github.com> --------- Co-authored-by: Atlas (Engineering Lead) <atlas@openclaw.ai> Co-authored-by: Scout (Lead Tester) <scout@openclaw.ai> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Stepan Arsentjev <stepandel@users.noreply.github.com> * feat: Add FilesPanel component (#41) * feat: Add FilesPanel component - Add useFilesQuery hook with dynamic polling (5s while processing) - Add FileSelectionContext for tracking selected file - Add FilesPanel component with status indicators and upload button - Add dialog:showOpenDialog IPC handler for native file picker - Wire up providers in ConnectionWindow Closes PINE-41 * fix: address review comments - pnpm workspace, linear config, AssistantStatus type * fix: clear assistantService on disconnect, remove files from later PRs --------- Co-authored-by: Atlas (Engineering Lead) <atlas@openclaw.ai> Co-authored-by: Scout (Lead Tester) <scout@openclaw.ai> * fix build: add stub FileDetailPanel * fix: Address PR review comments - Add registerAccelerator: false to New Index menu item for consistency - Add cancellation guard in ModeContext to prevent stale mode updates - Handle 'InitializationFailed' status in AssistantsPanel - Make citation superscripts keyboard accessible (button with aria-label) - Validate URL protocol before calling openExternal for security - Disable delete button when file status is 'Deleting' - Clear messages when switching assistants in useChatStream * feat: Add AssistantConfigView for create/edit (#51) - Add AssistantConfigView component for creating/editing assistants - Add DraftAssistantContext for managing draft assistant state - Wire up AssistantConfigView in MainContent - Add DraftAssistantProvider to ConnectionWindow Closes PINE-39 Co-authored-by: Scout (Lead Tester) <scout@openclaw.ai> * fix: address review comments on PINE-42 (#42) Co-authored-by: Scout (Lead Tester) <scout@openclaw.ai> * fix: address review comments on PINE-44 (#45) - Remove @ts-expect-error, add temperature/contextOptions to chat params - Add isDestroyed check and error handling for streaming in main.ts - Clear assistantService on disconnect in pinecone-service.ts - Make assistant rows keyboard-accessible (use button element) - Add IME composition check (isComposing) to prevent accidental submit - Use stable message keys (message.id) instead of array index - Reset conversation state when assistantName changes - Remove empty assistant placeholder when canceling stream - Pass multimodal flag through file upload flow Co-authored-by: Scout (Lead Tester) <scout@openclaw.ai> * fix: address review comments on PINE-39 (#47) - Fix .linear.toml workspace (chroma-explorer → pinecone-explorer) - Add packages field to pnpm-workspace.yaml for CI - Add InitializationFailed to AssistantStatus type - Reset assistantService on connect/disconnect Co-authored-by: Scout (Lead Tester) <scout@openclaw.ai> * fix: address review comments on PINE-49 (#49) - Pass temperature and contextOptions to chat() and chatStream() methods - Add multimodal param to upload file flow (types, hook, service) - Guard handleConfirmDelete against null currentProfile - Use stable message.id key instead of array index in ChatView - Fix download race condition by verifying fileDetail matches fileToDownload - Keep file detail cache consistent during delete operations - Handle early stream chunks before stream ID is set Co-authored-by: Scout (Lead Tester) <scout@openclaw.ai> * fix: Address additional PR review comments (round 2) - Add assistant and chat menu event handlers to preload.ts - Add types for new menu handlers in electron.d.ts - Add pending guard to prevent duplicate delete calls in AssistantsPanel - Reset initialization state when profile changes in ModeContext - Extract shared Markdown components to reduce duplication in ChatMessage * fix buid errors * feat: Add E2E test suite for Assistant feature (#53) * feat(e2e): add data-testid attributes to assistant components Add comprehensive data-testid attributes for E2E testing: Mode: - mode-switcher, mode-index, mode-assistant Assistants: - assistants-panel, assistant-item, assistant-status - new-assistant-button, assistant-config-view - assistant-name-input, assistant-instructions-input - assistant-save-button, assistant-cancel-button Files: - files-panel, files-empty-state, file-item - upload-file-button, file-detail-panel - file-detail-empty-state, file-download-button - file-delete-button, upload-file-dialog - browse-files-button, upload-submit-button Chat: - chat-view, chat-message-list, chat-input - chat-send-button, chat-stop-button - chat-clear-button, chat-model-selector - chat-message-user, chat-message-assistant Citations: - citation-superscript, citation-popover - citation-reference, citation-file-name - citation-view-file-button Part of PINE-51 * fix(e2e): Address PR review comments - 13 actionable items Fixes from CodeRabbit review: 1. assistant-citations.spec.ts: - Citation test now explicitly skips with message when no citations - Multiple citations test uses test.skip() when citationCount <= 1 2. assistant-crud.spec.ts: - Added assertion for errorMessage visibility in validation test - Context menu edit test now explicitly skipped (native menu limitation) 3. assistant-file-detail.spec.ts: - File selection test explicitly skips when fileCount === 0 - Delete test now asserts file disappears and count decreases 4. assistant-integration.spec.ts: - Network failure test now uses page.route() to simulate failures 5. assistant-mode.spec.ts: - Cross-platform keyboard shortcuts (Meta on macOS, Control on others) - Mode persistence test asserts switcher visibility (no silent skip) 6. assistant-upload.spec.ts: - API upload test: skip until real file fixture available - Metadata input test: skip until file dialog mocking available - Processing status test: explicit skip when no files - Progress test: skip until upload flow is wired --------- Co-authored-by: Atlas (Engineering Lead) <atlas@openclaw.ai> * fix(assistant): wire chatStream API through preload (#54) PINE-55: Fix 'Cannot read properties of undefined (reading onChunk)' Root cause: useChatStream.ts expected assistant.chatStream.* APIs but electron/preload.ts never exposed them. IPC handlers existed in main.ts but weren't wired through the preload bridge. Changes: - Add Chat types to electron/types.ts (ChatMessage, Citation, CitationReference, ChatUsage, ChatParams, ChatResponse, ChatStreamChunk) - Add chatStream namespace to assistant API in preload.ts with start/cancel/onChunk methods - Add corresponding TypeScript types to src/types/electron.d.ts The chatStream API now properly exposes: - start(profileId, assistantName, params) -> streamId - cancel(streamId) -> void - onChunk(callback) -> cleanup function Co-authored-by: Atlas (Engineering Lead) <atlas@openclaw.ai> * fix: Phase 6 feedback - dialog API and mode labels (PINE-53, PINE-54) (#55) * fix(assistant): wire chatStream API through preload PINE-55: Fix 'Cannot read properties of undefined (reading onChunk)' Root cause: useChatStream.ts expected assistant.chatStream.* APIs but electron/preload.ts never exposed them. IPC handlers existed in main.ts but weren't wired through the preload bridge. Changes: - Add Chat types to electron/types.ts (ChatMessage, Citation, CitationReference, ChatUsage, ChatParams, ChatResponse, ChatStreamChunk) - Add chatStream namespace to assistant API in preload.ts with start/cancel/onChunk methods - Add corresponding TypeScript types to src/types/electron.d.ts The chatStream API now properly exposes: - start(profileId, assistantName, params) -> streamId - cancel(streamId) -> void - onChunk(callback) -> cleanup function * fix: Phase 6 feedback - dialog API and mode labels PINE-54: Wire dialog API through preload - Add dialog.showOpenDialog to electron/preload.ts - Add corresponding TypeScript types PINE-53: Update mode labels to 'Database' instead of 'Index' - Change 'Index Explorer' → 'Database Explorer' in tooltip - Change 'Index' → 'Database' in button text --------- Co-authored-by: Atlas (Engineering Lead) <atlas@openclaw.ai> * fix uploader * fix(assistant): use SDK chatStream method instead of chat with stream flag The Pinecone SDK has a dedicated `assistant.chatStream()` method for streaming. Passing `stream: true` to `assistant.chat()` is invalid and causes an API error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(assistant): update supported models list to match Pinecone Assistant Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * style(chat): compact macOS-native chat UI Remove avatars and role labels for an Apple Messages-style layout. Tighten spacing, use pill-shaped bubbles, circular send button, and smaller typography to match the app's TopBar and sidebar density. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(files): add right-click context menu for file actions (#56) PINE-56: Phase 6 feedback - Part 2 Add file context menu with Download and Delete actions: - Add showFileMenu/onFileAction to electron/preload.ts - IPC handler already existed in main.ts (lines 656-673) - Add onContextMenu handler to FilesPanel file buttons - Delete action shows confirmation dialog, then deletes file - Download action opens signed URL in browser - Add TypeScript types to electron.d.ts Shortcuts in Settings were already implemented (keyboard-shortcuts.ts has 'assistant' and 'chat' categories). Co-authored-by: Atlas (Engineering Lead) <atlas@openclaw.ai> * feat(analytics): add tracking for Assistant events (PINE-57) (#57) * feat(files): add right-click context menu for file actions PINE-56: Phase 6 feedback - Part 2 Add file context menu with Download and Delete actions: - Add showFileMenu/onFileAction to electron/preload.ts - IPC handler already existed in main.ts (lines 656-673) - Add onContextMenu handler to FilesPanel file buttons - Delete action shows confirmation dialog, then deletes file - Download action opens signed URL in browser - Add TypeScript types to electron.d.ts Shortcuts in Settings were already implemented (keyboard-shortcuts.ts has 'assistant' and 'chat' categories). * feat(analytics): add tracking for Assistant events PINE-57: Phase 7 - Add analytics Add track() calls to Assistant IPC handlers: - assistant_created (with region) - assistant_deleted - file_uploaded (with multimodal flag) - file_deleted - chat_message_sent (with model, messageCount) - chat_stream_started (with model) Follows existing analytics pattern from index operations. --------- Co-authored-by: Atlas (Engineering Lead) <atlas@openclaw.ai> * fix(files): poll for Deleting status to update UI after file removal The files query only polled while files had 'Processing' status, so files stuck in 'Deleting' status never refreshed until a manual page reload. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(assistant): production readiness fixes from audit Address 10 issues found during production readiness audit: 1. Fix IPC wiring for menu-driven mode switching (onIndexMode/onAssistantMode) 2. Add URL protocol validation in shell:openExternal (block non-http(s)) 3. Add confirmation dialog before file deletion in FileDetailPanel 4. Surface file operation errors to users in FilesPanel (upload/delete/download) 5. Resolve keyboard shortcut collision (NEW_ASSISTANT → CmdOrCtrl+Shift+A) 6. Add synchronous ref guard to prevent double-submit in useChatStream 7. Abort active chat streams when window is destroyed 8. Add vitest framework with 17 unit tests for AssistantService and matchesShortcut 9. Add file path validation (exists check) before upload in main process 10. Remove unused dependencies (sharp, dotenv, bufferutil, utf-8-validate) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * clean up --------- Co-authored-by: Atlas (Engineering Lead) <atlas@openclaw.ai> Co-authored-by: Scout (Lead Tester) <scout@openclaw.ai> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Stepan Arsentjev <stepandel@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Create the secondary left panel that lists files for the selected assistant, mirroring NamespacesPanel pattern.
Changes
useFilesQueryhook with dynamic polling (every 5s while files are processing)FileSelectionContextfor tracking selected fileFilesPanelcomponent with:dialog:showOpenDialogIPC handler for native file pickerFiles Changed
src/components/files/FilesPanel.tsx(new)src/context/FileSelectionContext.tsx(new)src/hooks/useAssistantQueries.tselectron/main.tselectron/preload.tssrc/types/electron.d.tssrc/windows/ConnectionWindow.tsxTesting
pnpm test:build✅Closes PINE-41
Summary by CodeRabbit