diff --git a/app/src/components/notes/NoteEditor.tsx b/app/src/components/notes/NoteEditor.tsx new file mode 100644 index 0000000..fa230db --- /dev/null +++ b/app/src/components/notes/NoteEditor.tsx @@ -0,0 +1,63 @@ +import SendToAgentButton from "./SendToAgentButton"; +import Button from "../ui/Button"; + +interface Props { + projectId: string; + title: string; + body: string; + onTitleChange: (value: string) => void; + onBodyChange: (value: string) => void; + onCommit: () => void; + onDelete: () => void; +} + +/** + * Title and body, saved when a field loses focus. + * + * Plain text on purpose. There is no markdown rendering and no view/edit split, + * so there is no moment where the text on screen is not the text that would be + * sent — which is what makes "the agent gets exactly what you see" true rather + * than nearly true. + */ +export default function NoteEditor({ + projectId, + title, + body, + onTitleChange, + onBodyChange, + onCommit, + onDelete, +}: Props) { + return ( +
+
+ onTitleChange(e.target.value)} + onBlur={onCommit} + placeholder="Note title" + aria-label="Note title" + className="flex-1 min-w-0 px-2 h-8 bg-[var(--bg-primary)] border border-[var(--border-color)] rounded-[var(--radius-control)] text-[13px] text-[var(--text-primary)] focus:border-[var(--accent)] transition-colors" + /> + {/* The live editor text, not `note.body` — what is on screen is what + gets sent. */} + + +
+