Streaming tool UI fix (ChatView.tsx): - Add toolUsesRef/toolResultsRef to reliably track tool data across closures - Serialize tool_use/tool_result into JSON content-blocks array when building assistant message after stream ends, matching backend storage format - MessageItem.parseToolBlocks() now renders tool UI from history messages - Clean up refs in finally block and timeout auto-retry path File tree UX (FileTree.tsx, file-tree.tsx): - Remove folder path header from right panel, merge search + refresh into one row - Remove file icon spacer (size-5) so file icons align flush with search box - Change folder icon color from blue to muted-foreground Chat list panel (ChatListPanel.tsx): - Folder header: expanded uses FolderOpenIcon, collapsed uses Folder01Icon - Add tooltip showing full working directory path on folder hover - Double-click folder header opens in system file manager Title bar folder name (chat/[id]/page.tsx): - Add tooltip with full path on project name hover - Click opens folder in Finder/Explorer via Electron IPC or API fallback Open folder support: - electron/main.ts: add shell:open-path IPC handler via shell.openPath - electron/preload.ts: expose electronAPI.shell.openPath to renderer - api/files/open/route.ts: fallback API route using open/explorer/xdg-open Unify icon library — migrate app-level components from Lucide to Hugeicons: - file-tree.tsx: folder, file, chevron, plus icons - tool-actions-group.tsx: chevron expand icon - MessageItem.tsx: copy, check, expand/collapse icons - MessageInput.tsx: stop button (SquareIcon → StopIcon) - FileCard.tsx: file icon - ImageLightbox.tsx: left/right navigation arrows - InstallWizard.tsx: status icons (check, x, minus, loader, circle, copy, download) - Keep Lucide in ui/ and ai-elements/ base layers (shadcn standard)
23 lines
727 B
TypeScript
23 lines
727 B
TypeScript
import type { Query } from '@anthropic-ai/claude-agent-sdk';
|
|
|
|
const globalKey = '__activeConversations__' as const;
|
|
|
|
function getMap(): Map<string, Query> {
|
|
if (!(globalThis as Record<string, unknown>)[globalKey]) {
|
|
(globalThis as Record<string, unknown>)[globalKey] = new Map<string, Query>();
|
|
}
|
|
return (globalThis as Record<string, unknown>)[globalKey] as Map<string, Query>;
|
|
}
|
|
|
|
export function registerConversation(sessionId: string, conversation: Query): void {
|
|
getMap().set(sessionId, conversation);
|
|
}
|
|
|
|
export function unregisterConversation(sessionId: string): void {
|
|
getMap().delete(sessionId);
|
|
}
|
|
|
|
export function getConversation(sessionId: string): Query | undefined {
|
|
return getMap().get(sessionId);
|
|
}
|