feat: add project-aware agent workspace
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { ChevronRight } from "lucide-react";
|
||||
import { motion, useReducedMotion } from "motion/react";
|
||||
import type { PersonaState } from "@/shared/ai-elements/persona";
|
||||
import { cn } from "@/shared/ui/cn";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
import { AgentPersona } from "./agent-persona";
|
||||
import { agentLayoutTransition } from "./agent-motion";
|
||||
|
||||
type AgentCollapsedRailProps = {
|
||||
personaState?: PersonaState;
|
||||
@@ -15,26 +16,27 @@ export function AgentCollapsedRail({
|
||||
onExpand
|
||||
}: AgentCollapsedRailProps) {
|
||||
const expandLabel = `展开 Agent 助手面板,当前状态:${statusLabel}`;
|
||||
const prefersReducedMotion = useReducedMotion();
|
||||
|
||||
return (
|
||||
<aside
|
||||
<motion.aside
|
||||
aria-label="Agent 折叠栏"
|
||||
className={cn(
|
||||
"agent-rail-enter acrylic-control pointer-events-auto w-[72px] rounded-2xl border p-1.5"
|
||||
)}
|
||||
initial={prefersReducedMotion ? false : { opacity: 0, x: -5, scale: 0.94 }}
|
||||
animate={{ opacity: 1, x: 0, scale: 1 }}
|
||||
transition={prefersReducedMotion ? { duration: 0 } : agentLayoutTransition}
|
||||
style={{ transformOrigin: "left top" }}
|
||||
className="agent-collapsed-rail pointer-events-auto size-[var(--workbench-agent-rail-width,64px)] rounded-full"
|
||||
>
|
||||
<button
|
||||
<Button
|
||||
variant="ghost"
|
||||
type="button"
|
||||
aria-label={expandLabel}
|
||||
title={expandLabel}
|
||||
onClick={onExpand}
|
||||
className="agent-rail-item group relative flex h-14 w-full items-center justify-center rounded-xl border border-transparent bg-transparent hover:bg-[var(--action-selection-soft)]"
|
||||
className="flex h-full w-full items-center justify-center rounded-full border-0 bg-transparent p-0"
|
||||
>
|
||||
<AgentPersona className="h-11 w-11" state={personaState} />
|
||||
<span className="agent-panel-primary-icon absolute bottom-0.5 right-0.5 grid h-5 w-5 place-items-center rounded-md border-0! shadow-xs transition-transform group-hover:translate-x-0.5">
|
||||
<ChevronRight size={13} strokeWidth={2.5} aria-hidden="true" />
|
||||
</span>
|
||||
</button>
|
||||
</aside>
|
||||
<AgentPersona className="h-full w-full" state={personaState} />
|
||||
</Button>
|
||||
</motion.aside>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user