From d2029fd80435b6ffbf43ee21d5db285e8365e111 Mon Sep 17 00:00:00 2001 From: yangdx Date: Mon, 22 Sep 2025 02:01:39 +0800 Subject: [PATCH] Replace Input with auto-resizing Textarea in RetrievalTesting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Add new Textarea component • Auto-resize between 40px-120px height • Support Enter to submit, Shift+Enter for newline • Add form autocomplete attributes • Reset height after message submission --- lightrag_webui/src/components/ui/Textarea.tsx | 25 +++++++++++++ .../src/features/RetrievalTesting.tsx | 37 ++++++++++++++++--- 2 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 lightrag_webui/src/components/ui/Textarea.tsx diff --git a/lightrag_webui/src/components/ui/Textarea.tsx b/lightrag_webui/src/components/ui/Textarea.tsx new file mode 100644 index 00000000..04a061a8 --- /dev/null +++ b/lightrag_webui/src/components/ui/Textarea.tsx @@ -0,0 +1,25 @@ +import * as React from 'react' +import { cn } from '@/lib/utils' + +export interface TextareaProps + extends React.TextareaHTMLAttributes { + className?: string +} + +const Textarea = React.forwardRef( + ({ className, ...props }, ref) => { + return ( +