feat(webui): simplify automation management and unify disclosure motion

Replace the dense automation workspace with a calm list and on-demand details, show current linked-chat titles, and remember manual system-task expansion preferences.

Reuse disclosure transitions across expandable controls, preserve drafts and focus through closing, and release large diffs after their exit animation.

Refs NAN-116
This commit is contained in:
Xubin Ren committed 2026-09-11 20:38:38 +08:00
1 parent 90b889394f
commit 1640784d45
37 files changed
+1746 -721

No files matched your search

+8 -7
View File
@@ -1,6 +1,7 @@
import {
useCallback,
useEffect,
useId,
useMemo,
useRef,
useState,
@@ -18,6 +19,7 @@ import {
Wrench,
} from "lucide-react";
import { useTranslation } from "react-i18next";
import { DisclosureContent } from "@/components/ui/disclosure";
import { AttachmentTile } from "@/components/AttachmentTile";
import { SessionHandleLabel } from "@/components/SessionHandleLabel";
@@ -934,6 +936,7 @@ function TraceGroup({ message }: TraceGroupProps) {
const lines = message.traces ?? [message.content];
const count = lines.length;
const [open, setOpen] = useState(false);
const contentId = useId();
return (
<div className="w-full">
<button
@@ -944,6 +947,7 @@ function TraceGroup({ message }: TraceGroupProps) {
"text-xs text-muted-foreground transition-colors hover:bg-muted/45",
)}
aria-expanded={open}
aria-controls={contentId}
>
<Wrench className="h-3.5 w-3.5" aria-hidden />
<span className="font-medium">
@@ -954,17 +958,14 @@ function TraceGroup({ message }: TraceGroupProps) {
<ChevronRight
aria-hidden
className={cn(
"ml-auto h-3.5 w-3.5 transition-transform duration-200",
"ml-auto h-3.5 w-3.5 transition-transform duration-200 motion-reduce:transition-none",
open && "rotate-90",
)}
/>
</button>
{open && (
<DisclosureContent id={contentId} open={open}>
<ul
className={cn(
"mt-1 space-y-0.5 border-l border-muted-foreground/20 pl-3",
"animate-in fade-in-0 slide-in-from-top-1 duration-200",
)}
className="mt-1 space-y-0.5 border-l border-muted-foreground/20 pl-3"
>
{lines.map((line, i) => (
<li
@@ -975,7 +976,7 @@ function TraceGroup({ message }: TraceGroupProps) {
</li>
))}
</ul>
)}
</DisclosureContent>
</div>
);
}