From aee59b978b79d3c61de0609614b79a3cbbe460c6 Mon Sep 17 00:00:00 2001 From: MT-Mint <798521692@qq.com> Date: Wed, 18 Mar 2026 16:44:03 +0800 Subject: [PATCH] prettier --- .../app/workspace/chats/[thread_id]/page.tsx | 21 +-- .../src/components/ai-elements/checkpoint.tsx | 5 +- .../src/components/ai-elements/context.tsx | 10 +- .../src/components/ai-elements/controls.tsx | 6 +- frontend/src/components/ai-elements/edge.tsx | 10 +- frontend/src/components/ai-elements/image.tsx | 2 +- .../src/components/ai-elements/loader.tsx | 2 +- frontend/src/components/ai-elements/node.tsx | 6 +- frontend/src/components/ai-elements/panel.tsx | 4 +- frontend/src/components/ai-elements/queue.tsx | 30 ++-- .../src/components/ai-elements/reasoning.tsx | 27 ++-- .../src/components/ai-elements/shimmer.tsx | 8 +- .../src/components/ai-elements/sources.tsx | 6 +- frontend/src/components/ai-elements/task.tsx | 12 +- .../src/components/ai-elements/toolbar.tsx | 4 +- .../components/ai-elements/web-preview.tsx | 16 +-- frontend/src/components/ui/alert.tsx | 22 +-- frontend/src/components/ui/aurora-text.tsx | 22 +-- frontend/src/components/ui/avatar.tsx | 20 +-- frontend/src/components/ui/badge.tsx | 18 +-- frontend/src/components/ui/breadcrumb.tsx | 30 ++-- frontend/src/components/ui/button-group.tsx | 28 ++-- frontend/src/components/ui/card.tsx | 26 ++-- frontend/src/components/ui/carousel.tsx | 136 +++++++++--------- frontend/src/components/ui/command.tsx | 52 +++---- frontend/src/components/ui/dialog.tsx | 40 +++--- frontend/src/components/ui/dropdown-menu.tsx | 66 ++++----- frontend/src/components/ui/empty.tsx | 30 ++-- frontend/src/components/ui/hover-card.tsx | 18 +-- frontend/src/components/ui/item.tsx | 52 +++---- frontend/src/components/ui/magic-bento.css | 4 +- frontend/src/components/ui/progress.tsx | 14 +- frontend/src/components/ui/scroll-area.tsx | 16 +-- frontend/src/components/ui/separator.tsx | 14 +- frontend/src/components/ui/sheet.tsx | 38 ++--- frontend/src/components/ui/shine-border.tsx | 16 +-- frontend/src/components/ui/skeleton.tsx | 6 +- frontend/src/components/ui/sonner.tsx | 16 +-- frontend/src/components/ui/spotlight-card.css | 8 +- frontend/src/components/ui/switch.tsx | 16 +-- frontend/src/components/ui/tabs.tsx | 28 ++-- frontend/src/components/ui/toggle.tsx | 18 +-- .../artifacts/artifact-file-detail.tsx | 1 - .../workspace/citations/citation-link.tsx | 12 +- .../components/workspace/mode-hover-guide.tsx | 5 +- .../components/workspace/settings/about.md | 3 + frontend/src/core/mcp/api.ts | 14 +- frontend/src/hooks/use-mobile.ts | 24 ++-- 48 files changed, 503 insertions(+), 479 deletions(-) diff --git a/frontend/src/app/workspace/chats/[thread_id]/page.tsx b/frontend/src/app/workspace/chats/[thread_id]/page.tsx index 8dbc546e..c52f083c 100644 --- a/frontend/src/app/workspace/chats/[thread_id]/page.tsx +++ b/frontend/src/app/workspace/chats/[thread_id]/page.tsx @@ -68,7 +68,10 @@ export default function ChatPage() { const setInputRef = useRef(promptInputController.textInput.setInput); setInputRef.current = promptInputController.textInput.setInput; useEffect(() => { - if (inputInitialValue && inputInitialValue !== lastInitialValueRef.current) { + if ( + inputInitialValue && + inputInitialValue !== lastInitialValueRef.current + ) { lastInitialValueRef.current = inputInitialValue; setTimeout(() => { setInputRef.current(inputInitialValue); @@ -82,7 +85,10 @@ export default function ChatPage() { } }, [inputInitialValue]); // UI mode depends only on route: /workspace/chats/new is always "new page" mode. - const isNewThread = useMemo(() => threadIdFromPath === "new", [threadIdFromPath]); + const isNewThread = useMemo( + () => threadIdFromPath === "new", + [threadIdFromPath], + ); // Submission strategy is controlled by `isnew` query param only. // - isnew=false: reuse existing thread @@ -110,9 +116,7 @@ export default function ChatPage() { const languageTypeRaw = searchParams.get("languageType")?.trim() ?? searchParams.get("language_type")?.trim(); - const languageType = languageTypeRaw - ? Number(languageTypeRaw) - : 0; + const languageType = languageTypeRaw ? Number(languageTypeRaw) : 0; return { contentId, @@ -270,7 +274,8 @@ export default function ChatPage() { } } catch (error) { if (!cancelled) { - const message = error instanceof Error ? error.message : "Skill 初始化失败"; + const message = + error instanceof Error ? error.message : "Skill 初始化失败"; setSkillBootstrapError(message); setIsSkillBootstrapping(false); showNotification("Skill 初始化失败", { body: message }); @@ -371,8 +376,8 @@ export default function ChatPage() { suppressExistingThreadPrefetchUi ? [] : !thread.isLoading && finalState?.messages - ? (finalState.messages as Message[]) - : undefined + ? (finalState.messages as Message[]) + : undefined } paddingBottom={todoListCollapsed ? 160 : 280} /> diff --git a/frontend/src/components/ai-elements/checkpoint.tsx b/frontend/src/components/ai-elements/checkpoint.tsx index d9a5d326..6d912fec 100644 --- a/frontend/src/components/ai-elements/checkpoint.tsx +++ b/frontend/src/components/ai-elements/checkpoint.tsx @@ -19,7 +19,10 @@ export const Checkpoint = ({ ...props }: CheckpointProps) => (
{children} diff --git a/frontend/src/components/ai-elements/context.tsx b/frontend/src/components/ai-elements/context.tsx index f49d7cae..7385d068 100644 --- a/frontend/src/components/ai-elements/context.tsx +++ b/frontend/src/components/ai-elements/context.tsx @@ -115,7 +115,7 @@ export const ContextTrigger = ({ children, ...props }: ContextTriggerProps) => { {children ?? ( @@ -231,7 +231,7 @@ export const WebPreviewConsole = ({
@@ -244,7 +244,7 @@ export const WebPreviewConsole = ({ "text-xs", log.level === "error" && "text-destructive", log.level === "warn" && "text-yellow-600", - log.level === "log" && "text-foreground" + log.level === "log" && "text-foreground", )} key={`${log.timestamp.getTime()}-${index}`} > diff --git a/frontend/src/components/ui/alert.tsx b/frontend/src/components/ui/alert.tsx index 14213546..aa7de24d 100644 --- a/frontend/src/components/ui/alert.tsx +++ b/frontend/src/components/ui/alert.tsx @@ -1,7 +1,7 @@ -import * as React from "react" -import { cva, type VariantProps } from "class-variance-authority" +import * as React from "react"; +import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const alertVariants = cva( "relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", @@ -16,8 +16,8 @@ const alertVariants = cva( defaultVariants: { variant: "default", }, - } -) + }, +); function Alert({ className, @@ -31,7 +31,7 @@ function Alert({ className={cn(alertVariants({ variant }), className)} {...props} /> - ) + ); } function AlertTitle({ className, ...props }: React.ComponentProps<"div">) { @@ -40,11 +40,11 @@ function AlertTitle({ className, ...props }: React.ComponentProps<"div">) { data-slot="alert-title" className={cn( "col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight", - className + className, )} {...props} /> - ) + ); } function AlertDescription({ @@ -56,11 +56,11 @@ function AlertDescription({ data-slot="alert-description" className={cn( "text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed", - className + className, )} {...props} /> - ) + ); } -export { Alert, AlertTitle, AlertDescription } +export { Alert, AlertTitle, AlertDescription }; diff --git a/frontend/src/components/ui/aurora-text.tsx b/frontend/src/components/ui/aurora-text.tsx index 85857c1a..f8e475a5 100644 --- a/frontend/src/components/ui/aurora-text.tsx +++ b/frontend/src/components/ui/aurora-text.tsx @@ -1,12 +1,12 @@ -"use client" +"use client"; -import React, { memo } from "react" +import React, { memo } from "react"; interface AuroraTextProps { - children: React.ReactNode - className?: string - colors?: string[] - speed?: number + children: React.ReactNode; + className?: string; + colors?: string[]; + speed?: number; } export const AuroraText = memo( @@ -23,7 +23,7 @@ export const AuroraText = memo( WebkitBackgroundClip: "text", WebkitTextFillColor: "transparent", animationDuration: `${10 / speed}s`, - } + }; return ( @@ -36,8 +36,8 @@ export const AuroraText = memo( {children} - ) - } -) + ); + }, +); -AuroraText.displayName = "AuroraText" +AuroraText.displayName = "AuroraText"; diff --git a/frontend/src/components/ui/avatar.tsx b/frontend/src/components/ui/avatar.tsx index 71e428b4..c4475c2e 100644 --- a/frontend/src/components/ui/avatar.tsx +++ b/frontend/src/components/ui/avatar.tsx @@ -1,9 +1,9 @@ -"use client" +"use client"; -import * as React from "react" -import * as AvatarPrimitive from "@radix-ui/react-avatar" +import * as React from "react"; +import * as AvatarPrimitive from "@radix-ui/react-avatar"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; function Avatar({ className, @@ -14,11 +14,11 @@ function Avatar({ data-slot="avatar" className={cn( "relative flex size-8 shrink-0 overflow-hidden rounded-full", - className + className, )} {...props} /> - ) + ); } function AvatarImage({ @@ -31,7 +31,7 @@ function AvatarImage({ className={cn("aspect-square size-full", className)} {...props} /> - ) + ); } function AvatarFallback({ @@ -43,11 +43,11 @@ function AvatarFallback({ data-slot="avatar-fallback" className={cn( "bg-muted flex size-full items-center justify-center rounded-full", - className + className, )} {...props} /> - ) + ); } -export { Avatar, AvatarImage, AvatarFallback } +export { Avatar, AvatarImage, AvatarFallback }; diff --git a/frontend/src/components/ui/badge.tsx b/frontend/src/components/ui/badge.tsx index fd3a406b..55f8352b 100644 --- a/frontend/src/components/ui/badge.tsx +++ b/frontend/src/components/ui/badge.tsx @@ -1,8 +1,8 @@ -import * as React from "react" -import { Slot } from "@radix-ui/react-slot" -import { cva, type VariantProps } from "class-variance-authority" +import * as React from "react"; +import { Slot } from "@radix-ui/react-slot"; +import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const badgeVariants = cva( "inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", @@ -22,8 +22,8 @@ const badgeVariants = cva( defaultVariants: { variant: "default", }, - } -) + }, +); function Badge({ className, @@ -32,7 +32,7 @@ function Badge({ ...props }: React.ComponentProps<"span"> & VariantProps & { asChild?: boolean }) { - const Comp = asChild ? Slot : "span" + const Comp = asChild ? Slot : "span"; return ( - ) + ); } -export { Badge, badgeVariants } +export { Badge, badgeVariants }; diff --git a/frontend/src/components/ui/breadcrumb.tsx b/frontend/src/components/ui/breadcrumb.tsx index eb88f321..f63ae19a 100644 --- a/frontend/src/components/ui/breadcrumb.tsx +++ b/frontend/src/components/ui/breadcrumb.tsx @@ -1,11 +1,11 @@ -import * as React from "react" -import { Slot } from "@radix-ui/react-slot" -import { ChevronRight, MoreHorizontal } from "lucide-react" +import * as React from "react"; +import { Slot } from "@radix-ui/react-slot"; +import { ChevronRight, MoreHorizontal } from "lucide-react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; function Breadcrumb({ ...props }: React.ComponentProps<"nav">) { - return