refactor: improve drag and drop UX across tasks, lists, and workspace bullets
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 59s
MindSift CI & Docker Release / Build, Test in Container & Push (push) Successful in 59s
This commit is contained in:
1 parent
35d4657a25
commit
09725611b5
3 files changed
+142
-138
No files matched your search
@@ -9,7 +9,6 @@ import {
|
||||
Share,
|
||||
X,
|
||||
Hash,
|
||||
GripVertical,
|
||||
} from 'lucide-react';
|
||||
import { ListItem, SharedList, ListShare, Team, User, WSMessage } from '../../lib/types';
|
||||
import { api, buildWebSocketURL, triggerHaptic } from '../../lib/api';
|
||||
@@ -968,11 +967,18 @@ export const SharedListsView: React.FC<SharedListsViewProps> = ({ onRefreshGloba
|
||||
return (
|
||||
<div
|
||||
key={item.id}
|
||||
draggable
|
||||
onDragStart={(e) => handleItemDragStart(e, item)}
|
||||
onDragEnd={() => {
|
||||
setDraggingItemId(null);
|
||||
setDragOverItemTarget(null);
|
||||
setDragOverCategoryTarget(null);
|
||||
}}
|
||||
onDragOver={(e) => handleItemDragOver(e, item.id)}
|
||||
onDragLeave={(e) => handleItemDragLeave(e, item.id)}
|
||||
onDrop={(e) => handleDropOnItem(e, item, group.category)}
|
||||
onClick={() => handleToggleItem(item)}
|
||||
className={`px-3 py-2.5 flex items-center justify-between gap-3 cursor-pointer transition-colors hover:bg-panel-hover group relative ${
|
||||
className={`px-3 py-2.5 flex items-center justify-between gap-3 cursor-pointer cursor-grab active:cursor-grabbing select-none transition-colors hover:bg-panel-hover group relative ${
|
||||
isDragging ? 'opacity-30 border border-dashed border-accent/40' : ''
|
||||
}`}
|
||||
>
|
||||
@@ -984,26 +990,12 @@ export const SharedListsView: React.FC<SharedListsViewProps> = ({ onRefreshGloba
|
||||
<div className="absolute bottom-0 left-0 right-0 h-0.5 bg-accent z-20 pointer-events-none rounded-full shadow-[0_0_8px_rgba(var(--accent-rgb),0.6)]" />
|
||||
)}
|
||||
|
||||
<div className="flex items-center gap-2 min-w-0 flex-1">
|
||||
{/* Grip handle for dragging */}
|
||||
<div
|
||||
draggable
|
||||
onDragStart={(e) => handleItemDragStart(e, item)}
|
||||
onDragEnd={() => {
|
||||
setDraggingItemId(null);
|
||||
setDragOverItemTarget(null);
|
||||
setDragOverCategoryTarget(null);
|
||||
}}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
className="opacity-0 group-hover:opacity-70 hover:opacity-100 text-faint hover:text-accent cursor-grab active:cursor-grabbing flex-shrink-0 -ml-1 transition-opacity"
|
||||
title="Ziehen zum Sortieren oder in andere Hashtag-Kategorie schieben"
|
||||
>
|
||||
<GripVertical className="w-3.5 h-3.5" />
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2.5 min-w-0 flex-1">
|
||||
{/* Eckiges Abhaken */}
|
||||
<button
|
||||
type="button"
|
||||
draggable={false}
|
||||
onMouseDown={(e) => e.stopPropagation()}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
handleToggleItem(item);
|
||||
@@ -1037,6 +1029,8 @@ export const SharedListsView: React.FC<SharedListsViewProps> = ({ onRefreshGloba
|
||||
|
||||
<button
|
||||
type="button"
|
||||
draggable={false}
|
||||
onMouseDown={(e) => e.stopPropagation()}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
handleDeleteItem(item.id);
|
||||
|
||||
Reference in new issue
Block a user