[Haik]: refactor: co-locate UI primitives with AgentChat feature — delete avatar, button, collapsible, dialog, separator, and tooltip from src/components/ui, recreate them under AgentChat/_shared and component-local dirs (tooltip, avatar, dialog, separator), and rewire 13 consumer imports across OpenSwarmThread, ToolFallback, approvalToolkit, and nativeToolkit adapters

This commit is contained in:
haikdc
2026-04-18 17:17:30 -07:00
parent 015b663cbf
commit b74bd2a006
19 changed files with 22 additions and 22 deletions
@@ -6,8 +6,8 @@ import {
AuiIf,
} from '@assistant-ui/react';
import { ArrowDownIcon } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { TooltipProvider } from '@/components/ui/tooltip';
import { Button } from '@/app/pages/AgentChat/_shared/button';
import { TooltipProvider } from './components/tooltip';
import { TooltipIconButton } from './components/TooltipIconButton';
import { UserMessage } from './components/UserMessage/UserMessage';
import { AssistantMessage } from './components/AssistantMessage/AssistantMessage';
@@ -1,6 +1,6 @@
"use client";
import { CollapsibleContent } from "@/components/ui/collapsible";
import { CollapsibleContent } from "@/app/pages/AgentChat/_shared/collapsible";
import { cn } from "@/lib/utils";
@@ -4,7 +4,7 @@ import { useCallback, useRef, useState } from "react";
import {
useScrollLock,
} from "@assistant-ui/react";
import { Collapsible } from "@/components/ui/collapsible";
import { Collapsible } from "@/app/pages/AgentChat/_shared/collapsible";
import { cn } from "@/lib/utils";
const ANIMATION_DURATION = 200;
@@ -8,7 +8,7 @@ import {
XCircleIcon,
} from "lucide-react";
import { type ToolCallMessagePartStatus } from "@assistant-ui/react";
import { CollapsibleTrigger } from "@/components/ui/collapsible";
import { CollapsibleTrigger } from "@/app/pages/AgentChat/_shared/collapsible";
import { cn } from "@/lib/utils";
type ToolStatus = ToolCallMessagePartStatus["type"];
@@ -7,8 +7,8 @@ import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";
import { Button } from "@/components/ui/button";
} from "./tooltip";
import { Button } from "@/app/pages/AgentChat/_shared/button";
import { cn } from "@/lib/utils";
type TooltipIconButtonProps = ComponentPropsWithRef<typeof Button> & {
@@ -13,14 +13,14 @@ import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";
} from "../tooltip";
import {
Dialog,
DialogTitle,
DialogContent,
DialogTrigger,
} from "@/components/ui/dialog";
import { Avatar, AvatarImage, AvatarFallback } from "@/components/ui/avatar";
} from "./dialog";
import { Avatar, AvatarImage, AvatarFallback } from "./avatar";
import { TooltipIconButton } from "../TooltipIconButton";
import { cn } from "@/lib/utils";
@@ -3,7 +3,7 @@
import type { Action } from "../../utils/types";
import { useActionButtons } from "./useActionButtons";
import { cn } from "@/lib/utils";
import { Button } from "@/components/ui/button";
import { Button } from "@/app/pages/AgentChat/_shared/button";
interface ActionButtonsProps {
actions: Action[];
@@ -1,2 +1,2 @@
export { cn } from "@/lib/utils";
export { Separator } from "@/components/ui/separator";
export { Separator } from "../../separator";
@@ -1,3 +1,3 @@
export { cn } from "@/lib/utils";
export { Button } from "@/components/ui/button";
export { Separator } from "@/components/ui/separator";
export { Button } from "@/app/pages/AgentChat/_shared/button";
export { Separator } from "../../separator";
@@ -1,3 +1,3 @@
export { cn } from "@/lib/utils";
export { Button } from "@/components/ui/button";
export { Separator } from "@/components/ui/separator";
export { Button } from "@/app/pages/AgentChat/_shared/button";
export { Separator } from "../../separator";
@@ -1,3 +1,3 @@
export { cn } from "@/lib/utils";
export { Button } from "@/components/ui/button";
export { Collapsible, CollapsibleTrigger } from "@/components/ui/collapsible";
export { Button } from "@/app/pages/AgentChat/_shared/button";
export { Collapsible, CollapsibleTrigger } from "@/app/pages/AgentChat/_shared/collapsible";
@@ -1,3 +1,3 @@
export { cn } from "@/lib/utils";
export { Button } from "@/components/ui/button";
export { Collapsible, CollapsibleTrigger } from "@/components/ui/collapsible";
export { Button } from "@/app/pages/AgentChat/_shared/button";
export { Collapsible, CollapsibleTrigger } from "@/app/pages/AgentChat/_shared/collapsible";
@@ -1,3 +1,3 @@
export { cn } from "@/lib/utils";
export { Button } from "@/components/ui/button";
export { Collapsible, CollapsibleTrigger } from "@/components/ui/collapsible";
export { Button } from "@/app/pages/AgentChat/_shared/button";
export { Collapsible, CollapsibleTrigger } from "@/app/pages/AgentChat/_shared/collapsible";