From fd57eb4b6f4ad4fb59064d71b00549fa499201cb Mon Sep 17 00:00:00 2001
From: DrSmoothl <1787882683@qq.com>
Date: Tue, 7 Jul 2026 15:48:52 +0800
Subject: [PATCH] fix(webui): scope message-segment drag to the grip handle
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The whole segment row in the debug message builder was `draggable`, so an
HTML5 drag started on any pointer gesture inside it — including selecting
part of a pasted URL in a segment input, which dragged the card instead of
selecting text.
Move `draggable` (and onDragStart/onDragEnd) off the row onto the grip
handle only; the row keeps onDragOver/onDrop so it stays the drop target.
The body is now fully selectable/editable. The grip also moves up beside
the segment label, freeing the card's left edge. Nested forward-node
builders keep their stopPropagation drag boundary.
---
.../src/components/debug/message-builder.tsx | 42 ++++++++++++-------
1 file changed, 26 insertions(+), 16 deletions(-)
diff --git a/packages/webui/src/components/debug/message-builder.tsx b/packages/webui/src/components/debug/message-builder.tsx
index dc5ee47c..e2c15b2a 100644
--- a/packages/webui/src/components/debug/message-builder.tsx
+++ b/packages/webui/src/components/debug/message-builder.tsx
@@ -140,27 +140,37 @@ export function MessageBuilder({ segments, onChange, uin, groupId, depth = 0 }:
{segments.map((s, i) => (
+ {/* Drag is scoped to the grip handle only — making the whole row
+ draggable hijacked text selection inside the segment inputs (you
+ couldn't select part of a pasted URL without dragging the card).
+ The row stays the drop target; its body is fully selectable. */}
+