From 8fc5917b3b0adc8d69807ec80d77d50e15e6403c Mon Sep 17 00:00:00 2001 From: DrSmoothl <1787882683@qq.com> Date: Tue, 30 Jun 2026 18:57:54 +0800 Subject: [PATCH] fix(webui): align message composer/builder (Apple-HIG) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two alignment fixes in the 消息构建 tab: - MessageBuilder is now a bounded "compose canvas" (always bordered) so the empty hint reads as an intentional empty state inside a defined input region, instead of a stray centered line floating in the left-aligned form. - The 账号 / 目标 label rows are pinned to a fixed h-8 (== the 群聊/私聊 segmented control's height) so both labels and the selectors beneath them share a baseline — min-h-7 wasn't enough since the segmented is ~32px. --- packages/webui/src/components/debug/message-builder.tsx | 8 +++++--- packages/webui/src/components/debug/message-composer.tsx | 9 +++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/webui/src/components/debug/message-builder.tsx b/packages/webui/src/components/debug/message-builder.tsx index 0fee32e5..dc5ee47c 100644 --- a/packages/webui/src/components/debug/message-builder.tsx +++ b/packages/webui/src/components/debug/message-builder.tsx @@ -13,7 +13,6 @@ import { Picker } from '@/components/ui/picker'; import { FaceGrid } from '@/components/ui/face-grid'; import { FileSource } from '@/components/debug/file-source'; import { useGroupMembers } from '@/hooks/use-debug-contacts'; -import { cn } from '@/lib/utils'; // ── segment model ── // `_id` is a stable React key tied to a segment's identity (so editing one field @@ -130,9 +129,12 @@ export function MessageBuilder({ segments, onChange, uin, groupId, depth = 0 }: }; return ( -
0 && 'rounded-xl border border-border/50 bg-muted/20 p-2')}> + // A bounded "compose canvas" at every level — so the empty hint reads as an + // intentional empty state inside a defined region rather than a stray + // centered line floating in the left-aligned form (Apple-HIG alignment). +
{segments.length === 0 && ( -

空消息 — 在下方添加段

+

空消息 — 点下方「添加段」开始

)} {segments.map((s, i) => ( diff --git a/packages/webui/src/components/debug/message-composer.tsx b/packages/webui/src/components/debug/message-composer.tsx index 9df795f2..51a5df59 100644 --- a/packages/webui/src/components/debug/message-composer.tsx +++ b/packages/webui/src/components/debug/message-composer.tsx @@ -91,14 +91,19 @@ export function MessageComposer({ accounts }: { accounts: QQInfo[] }) {
- 账号 + {/* Fixed h-8 == the target column's segmented-control height, so both + label rows are exactly equal and the two selectors below share a + baseline (min-h-7 wasn't enough — the segmented is ~32px). */} +
+ 账号 +
-
+
目标 { setKind(k); setTarget(''); }} options={[{ value: 'group', label: '群聊' }, { value: 'friend', label: '私聊' }]} />