Refactor: Unify task hover icon behavior across all variants

This commit is contained in:
mARTin 2026-02-13 22:48:45 +01:00
parent a834b440a5
commit 13c513b314

View File

@ -3010,23 +3010,18 @@ function TaskItem({ task, isEditing, onToggle, onEdit, onUpdate, onDelete, onNot
) : (
<>
<span
className={`weekly-task-text ${task.completed ? 'completed' : ''}`}
className={`weekly-task-text flex-1 ${task.completed ? 'completed' : ''}`}
onClick={(e) => {
if (variant === 'default') onToggle();
// For minimal, parent onClick handles edit
// For minimal/someday, parent onClick handles edit
}}
onDoubleClick={variant === 'default' ? onEdit : undefined}
style={variant === 'minimal' ? { fontSize: '0.9375rem' } : undefined}
style={variant === 'minimal' || isSomeday ? { fontSize: '0.9375rem' } : undefined}
>
{task.title}
</span>
<div className={variant === 'minimal'
? "task-actions absolute right-0 top-0 bottom-0 bg-white/90 pl-1"
: "task-actions"
}
style={variant === 'minimal' ? { display: 'flex', alignItems: 'center' } : undefined}
>
<div className="task-actions absolute right-0 top-0 bottom-0 flex items-center bg-white/95 dark:bg-gray-800/95 pl-2 pr-1 shadow-[-8px_0_8px_-4px_rgba(255,255,255,0.95)] dark:shadow-[-8px_0_8px_-4px_rgba(31,41,55,0.95)]">
{/* Edit */}
<button className="task-action-btn" onClick={(e) => { e.stopPropagation(); onEdit(); }} title="Edit">
<svg viewBox="0 0 24 24" width="12" height="12" stroke="currentColor" strokeWidth="2.5" fill="none" strokeLinecap="round" strokeLinejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg>