diff --git a/web/src/components/TaskItem.tsx b/web/src/components/TaskItem.tsx index 1d0d7a8..faa1b8f 100644 --- a/web/src/components/TaskItem.tsx +++ b/web/src/components/TaskItem.tsx @@ -9,6 +9,7 @@ import { Calendar, Repeat, Check, + Search, } from "lucide-react"; import { useTranslation } from "react-i18next"; import type { Task } from "@/lib/types"; @@ -40,6 +41,7 @@ export function TaskItem({ task, subtasks = [], depth = 0 }: TaskItemProps) { const { t } = useTranslation(); const router = useRouter(); const [expanded, setExpanded] = useState(false); + const [detailOpen, setDetailOpen] = useState(false); const [editing, setEditing] = useState(false); const [title, setTitle] = useState(task.title); const [notes, setNotes] = useState(task.notes || ""); @@ -123,17 +125,21 @@ export function TaskItem({ task, subtasks = [], depth = 0 }: TaskItemProps) { > {/* Main row */}
- {/* Expand toggle */} - + {/* Expand subtasks toggle — only shown when subtasks exist */} + {subtasks.length > 0 ? ( + + ) : ( + + )} {/* Checkbox */} - {/* Title */} + {/* Title — click opens detail */} setExpanded(!expanded)} + onClick={() => setDetailOpen(!detailOpen)} > {task.title} @@ -174,10 +180,20 @@ export function TaskItem({ task, subtasks = [], depth = 0 }: TaskItemProps) { {subtasks.filter((s) => s.completed).length}/{subtasks.length} )} + + {/* Detail view toggle */} +
- {/* Expanded view */} - {expanded && ( + {/* Detail view */} + {detailOpen && (
{editing ? (
@@ -284,7 +300,7 @@ export function TaskItem({ task, subtasks = [], depth = 0 }: TaskItemProps) {
{/* Subtask form */} - {showSubtaskForm && expanded && ( + {showSubtaskForm && detailOpen && (
)} - {/* Subtasks */} - {subtasks.map((sub) => ( + {/* Subtasks — toggled by chevron */} + {expanded && subtasks.map((sub) => ( ))}