diff --git a/CHANGELOG.md b/CHANGELOG.md index 44e707d4..5a4dd84e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and versions follow [Semantic Versioning](https://semver.org/). ## [Unreleased] ### Added +- **Recurring tasks remember their last runs:** each run of a recurring task now reads a short note of what its last + three runs found, sent or decided, plus the task's own notes, so it tells you only what is new instead of repeating + yesterday's news. Runs keep those notes up to date themselves; see, edit or clear them under **Notes between runs** + on the task. - **Watches that only speak up when something important changed:** a check script can now **Tell me when something important changes**. Each check is compared with the last one without any AI, so an unchanged page costs nothing and stays silent; only when something changed does your fast AI model decide whether it matters, and then you get diff --git a/desktop/src/features/tasks/detail/NotepadCard.tsx b/desktop/src/features/tasks/detail/NotepadCard.tsx new file mode 100644 index 00000000..1a5138a3 --- /dev/null +++ b/desktop/src/features/tasks/detail/NotepadCard.tsx @@ -0,0 +1,70 @@ +/** Recurring tasks (docs/API.md §4 "Recurring tasks remember"): the notes its runs keep for the next run. */ +import { IconNotes, IconPencil, IconTrash } from '@tabler/icons-react' +import { useEffect, useState } from 'react' +import { Button, Textarea } from '@/components/ui' +import type { Task } from '@/lib/types' + +const MAX_CHARS = 1500 + +export function NotepadCard({ task, onSave }: { task: Task; onSave: (notepad: string | null) => Promise }) { + const notepad = task.notepad ?? '' + const [editing, setEditing] = useState(false) + const [draft, setDraft] = useState(notepad) + const [saving, setSaving] = useState(false) + useEffect(() => { + if (!editing) setDraft(notepad) + }, [notepad, editing]) + + const save = async (value: string | null) => { + setSaving(true) + try { + await onSave(value) + setEditing(false) + } finally { + setSaving(false) + } + } + + return ( +
+
+ +

Notes between runs

+ + {editing ? ( +
+ + +
+ ) : ( +
+ {notepad && ( + + )} + +
+ )} +
+ {editing ? ( +