feat: v0.12.0 — fix streaming tool UI persistence, file tree UX improvements, unify icon library

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)
This commit is contained in:
7418 committed 2026-02-24 12:32:03 +08:00
1 parent 8ee8085930
commit 9e7ccfefaa
27 files changed
+622 -212

No files matched your search

+12 -12
View File
@@ -8,13 +8,14 @@ import {
CollapsibleTrigger,
} from "@/components/ui/collapsible";
import { cn } from "@/lib/utils";
import { HugeiconsIcon } from "@hugeicons/react";
import {
ChevronRightIcon,
FileIcon,
FolderIcon,
Folder01Icon,
FolderOpenIcon,
PlusIcon,
} from "lucide-react";
File01Icon,
ArrowRight01Icon,
PlusSignIcon,
} from "@hugeicons/core-free-icons";
import {
createContext,
useCallback,
@@ -154,7 +155,8 @@ export const FileTreeFolder = ({
className="shrink-0 rounded p-0.5 hover:bg-muted"
onClick={(e) => e.stopPropagation()}
>
<ChevronRightIcon
<HugeiconsIcon
icon={ArrowRight01Icon}
className={cn(
"size-4 text-muted-foreground transition-transform",
isExpanded && "rotate-90"
@@ -164,9 +166,9 @@ export const FileTreeFolder = ({
</CollapsibleTrigger>
<FileTreeIcon>
{isExpanded ? (
<FolderOpenIcon className="size-4 text-blue-500" />
<HugeiconsIcon icon={FolderOpenIcon} className="size-4 text-muted-foreground" />
) : (
<FolderIcon className="size-4 text-blue-500" />
<HugeiconsIcon icon={Folder01Icon} className="size-4 text-muted-foreground" />
)}
</FileTreeIcon>
<FileTreeName>{name}</FileTreeName>
@@ -246,10 +248,8 @@ export const FileTreeFile = ({
>
{children ?? (
<>
{/* Spacer matching folder chevron button (size-4 icon + p-0.5 padding) */}
<span className="size-5 shrink-0" />
<FileTreeIcon>
{icon ?? <FileIcon className="size-4 text-muted-foreground" />}
{icon ?? <HugeiconsIcon icon={File01Icon} className="size-4 text-muted-foreground" />}
</FileTreeIcon>
<FileTreeName>{name}</FileTreeName>
{onAdd && (
@@ -259,7 +259,7 @@ export const FileTreeFile = ({
onClick={handleAdd}
title="Add to chat"
>
<PlusIcon className="size-3 text-muted-foreground" />
<HugeiconsIcon icon={PlusSignIcon} className="size-3 text-muted-foreground" />
</button>
)}
</>
@@ -13,8 +13,8 @@ import {
Loading02Icon,
CheckmarkCircle02Icon,
CancelCircleIcon,
ArrowRight01Icon,
} from "@hugeicons/core-free-icons";
import { ChevronRightIcon } from 'lucide-react';
import { cn } from '@/lib/utils';
// ---------------------------------------------------------------------------
@@ -229,7 +229,8 @@ export function ToolActionsGroup({
onClick={handleToggle}
className="flex w-full items-center gap-2 py-1 text-xs rounded-sm hover:bg-muted/30 transition-colors"
>
<ChevronRightIcon
<HugeiconsIcon
icon={ArrowRight01Icon}
className={cn(
"h-3 w-3 shrink-0 text-muted-foreground/60 transition-transform duration-200",
expanded && "rotate-90"