Skip to content

Commit e463f84

Browse files
RicterZclaude
andcommitted
feat: PaletteItem 加拖拽图标,ChainItem/PaletteItem 禁止文字选中
- PaletteItem 拖拽把手区域加六点格拖拽图标,与 ChainItem 风格一致 - ChainItem 和 PaletteItem 卡片加 select-none,防止触屏长按触发文字选中 而非拖拽手势 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent 21aec95 commit e463f84

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/components/sidebar/left-sidebar.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function ChainItem({ id, marker, index, hasArrowAfter, onRemove, onFlyTo }: Chai
106106

107107
return (
108108
<div ref={setNodeRef} style={style} className={cn(isSortableDragging && 'opacity-40')}>
109-
<div className="border border-gray-200 rounded-xl bg-white overflow-hidden flex items-center gap-2">
109+
<div className="border border-gray-200 rounded-xl bg-white overflow-hidden flex items-center gap-2 select-none">
110110
<button
111111
{...attributes}
112112
{...listeners}
@@ -172,16 +172,19 @@ function PaletteItem({ marker, onFlyTo, onRemove }: PaletteItemProps) {
172172
<div
173173
ref={setNodeRef}
174174
className={cn(
175-
'border border-gray-200 rounded-xl bg-white overflow-hidden flex items-center gap-2',
175+
'border border-gray-200 rounded-xl bg-white overflow-hidden flex items-center gap-2 select-none',
176176
isDragging && 'opacity-40 border-blue-300'
177177
)}
178178
>
179179
{/* 拖拽把手:listeners 仅挂在此处,与 onFlyTo 按钮物理隔离,避免 ghost click */}
180180
<div
181-
className="pl-2.5 py-2.5 cursor-grab active:cursor-grabbing touch-none flex-shrink-0 text-gray-300"
181+
className="pl-2 py-2.5 cursor-grab active:cursor-grabbing touch-none flex-shrink-0 flex items-center gap-1.5 text-gray-300"
182182
{...attributes}
183183
{...listeners}
184184
>
185+
<svg className="w-4 h-4 flex-shrink-0" viewBox="0 0 20 20" fill="currentColor">
186+
<path d="M7 4a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm0 4a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm0 4a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm6-8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm0 4a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm0 4a1 1 0 1 1-2 0 1 1 0 0 1 2 0z" />
187+
</svg>
185188
<div className={cn('w-6 h-6 rounded-full flex items-center justify-center', getMarkerColor(marker.content.iconType || 'location'))}>
186189
<span className="text-xs text-white">{icon.emoji}</span>
187190
</div>

0 commit comments

Comments
 (0)