diff options
| author | Solstice <solstice@local> | 2026-06-09 01:02:30 -0700 |
|---|---|---|
| committer | Solstice <solstice@local> | 2026-06-09 01:02:30 -0700 |
| commit | 4e2d978eb5fc9457d5b913bc10faf1266e6dcda4 (patch) | |
| tree | 835f8cdc1160fe979a39e0bdad0c5179cc49820d /src/components/TaskList.tsx | |
| parent | f43f549ffbe3074977116c9f35aa7064d6a4bd95 (diff) | |
chore: final polish and preparation for release
Diffstat (limited to 'src/components/TaskList.tsx')
| -rw-r--r-- | src/components/TaskList.tsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/components/TaskList.tsx b/src/components/TaskList.tsx index 6ecce42..6cd9c3f 100644 --- a/src/components/TaskList.tsx +++ b/src/components/TaskList.tsx @@ -10,10 +10,12 @@ export function TaskList() { const [newName, setNewName] = useState(''); const [newSessions, setNewSessions] = useState(4); + const clampSessions = (value: number) => Math.min(20, Math.max(1, value)); + const handleAdd = async () => { const name = newName.trim(); if (!name) return; - await addTask(name, newSessions); + await addTask(name, clampSessions(newSessions)); setNewName(''); setNewSessions(4); setShowForm(false); @@ -133,7 +135,7 @@ export function TaskList() { min={1} max={20} value={newSessions} - onChange={(e) => setNewSessions(Math.max(1, parseInt(e.target.value) || 1))} + onChange={(e) => setNewSessions(clampSessions(parseInt(e.target.value, 10) || 1))} style={{ fontFamily: 'var(--font-mono)', fontSize: '14px', @@ -185,9 +187,10 @@ export function TaskList() { fontFamily: 'var(--font-sans)', fontSize: '13px', color: 'var(--fg-4)', + lineHeight: 1.5, }} > - No tasks yet + No tasks yet. Add one to track deliberate focus sessions. </div> )} {tasks.map((task) => { |
