From b89ea540567ceb0311c364965c46d5bf50f1c786 Mon Sep 17 00:00:00 2001 From: PerishCode Date: Thu, 11 Jun 2026 17:13:27 +0800 Subject: [PATCH] web: polish panel layout and textarea motion --- .../soma/web/src/components/ChatHeader.tsx | 2 +- .../soma/web/src/components/ChatShell.tsx | 52 +++-- .../soma/web/src/components/Composer.tsx | 56 +++--- .../src/atoms/TextArea/TextArea.scss | 38 ++++ .../src/atoms/TextArea/TextArea.tsx | 77 ++------ .../TextArea/hooks/useTextAreaAutosize.ts | 177 ++++++++++++++++++ packages/components/src/index.ts | 1 + .../SectionStackLayout.scss | 50 +++++ .../SectionStackLayout/SectionStackLayout.tsx | 26 +++ packages/components/src/theme/default.scss | 5 + 10 files changed, 372 insertions(+), 112 deletions(-) create mode 100644 packages/components/src/atoms/TextArea/hooks/useTextAreaAutosize.ts create mode 100644 packages/components/src/patterns/SectionStackLayout/SectionStackLayout.scss create mode 100644 packages/components/src/patterns/SectionStackLayout/SectionStackLayout.tsx diff --git a/apps/client/soma/web/src/components/ChatHeader.tsx b/apps/client/soma/web/src/components/ChatHeader.tsx index 48aa81d..bdc298f 100644 --- a/apps/client/soma/web/src/components/ChatHeader.tsx +++ b/apps/client/soma/web/src/components/ChatHeader.tsx @@ -42,7 +42,7 @@ export function ChatHeader(props: { } return ( - + SESSION diff --git a/apps/client/soma/web/src/components/ChatShell.tsx b/apps/client/soma/web/src/components/ChatShell.tsx index 991fd46..c2f5d07 100644 --- a/apps/client/soma/web/src/components/ChatShell.tsx +++ b/apps/client/soma/web/src/components/ChatShell.tsx @@ -1,4 +1,4 @@ -import { GridRows, Notice, Pane, Stack, Text } from "@mini-stim/components"; +import { Pane, SectionStackLayout } from "@mini-stim/components"; import { ChatHeader } from "./ChatHeader"; import { Composer } from "./Composer"; @@ -19,34 +19,28 @@ export function ChatShell(props: { }) { return ( - - - - - {props.error ? ( - - - {props.error} - - - ) : null} - - - - - + + )} + middle={} + bottom={( + + )} + /> ); } diff --git a/apps/client/soma/web/src/components/Composer.tsx b/apps/client/soma/web/src/components/Composer.tsx index ac93160..b720afd 100644 --- a/apps/client/soma/web/src/components/Composer.tsx +++ b/apps/client/soma/web/src/components/Composer.tsx @@ -1,7 +1,8 @@ -import { Button, FieldActionLayout, SendIcon, TextArea } from "@mini-stim/components"; +import { Button, Inline, Notice, SendIcon, Stack, Text, TextArea } from "@mini-stim/components"; export function Composer(props: { disabled?: boolean; + error?: string | null; onChange: (value: string) => void; onSubmit: () => void; value: string; @@ -13,30 +14,35 @@ export function Composer(props: { props.onSubmit(); }} > - - - Send - - )} - > -