From 55e78de6fc0e64efc0c7607be4134ffa2a073d35 Mon Sep 17 00:00:00 2001 From: Zhou <32321321@qq.com> Date: Mon, 6 Apr 2026 16:30:57 +0800 Subject: [PATCH] fix: wrap suggestion chips without overlapping input (#1895) * fix: wrap suggestion chips without overlapping input * fix: fix lint error --- .../src/components/ai-elements/suggestion.tsx | 18 +++-- .../src/components/workspace/input-box.tsx | 70 +++++++++---------- 2 files changed, 46 insertions(+), 42 deletions(-) diff --git a/frontend/src/components/ai-elements/suggestion.tsx b/frontend/src/components/ai-elements/suggestion.tsx index fe12ae2c4..dcc82ae1b 100644 --- a/frontend/src/components/ai-elements/suggestion.tsx +++ b/frontend/src/components/ai-elements/suggestion.tsx @@ -1,10 +1,11 @@ "use client"; +import type { LucideIcon } from "lucide-react"; +import { Children, type ComponentProps } from "react"; + import { Button } from "@/components/ui/button"; import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"; import { cn } from "@/lib/utils"; -import type { LucideIcon } from "lucide-react"; -import { Children, type ComponentProps } from "react"; const STAGGER_DELAY_MS = 60; const STAGGER_DELAY_MS_OFFSET = 250; @@ -16,12 +17,15 @@ export const Suggestions = ({ children, ...props }: SuggestionsProps) => ( - -
+ +
{Children.map(children, (child, index) => child != null ? ( {Icon && } - {children || suggestion} + {children ?? suggestion} ); }; diff --git a/frontend/src/components/workspace/input-box.tsx b/frontend/src/components/workspace/input-box.tsx index 19e93b3f3..ddc682744 100644 --- a/frontend/src/components/workspace/input-box.tsx +++ b/frontend/src/components/workspace/input-box.tsx @@ -429,7 +429,38 @@ export function InputBox({ }, [context.model_name, disabled, isMock, status, thread.messages, threadId]); return ( -
+
+ {showFollowups && ( +
+
+ {followupsLoading ? ( +
+ {t.inputBox.followupLoading} +
+ ) : ( + + {followups.map((s) => ( + handleFollowupClick(s)} + /> + ))} + + + )} +
+
+ )} - {isNewThread && searchParams.get("mode") !== "skill" && ( -
- -
- )} {!isNewThread && (
)}
- {showFollowups && ( -
-
- {followupsLoading ? ( -
- {t.inputBox.followupLoading} -
- ) : ( - - {followups.map((s) => ( - handleFollowupClick(s)} - /> - ))} - - - )} -
+ {isNewThread && searchParams.get("mode") !== "skill" && ( +
+
)}