Terminal Notes
Every terminal gets a Markdown notes scratchpad — a right-panel tab, a close-dialog reminder, a title-bar icon. It reuses kolu's existing `intent` field, renamed `notes` — a rename plus migration and three client surfaces, not a feature from scratch.
Every terminal — active or sleeping — gets a Markdown notes scratchpad. The catch:
the field already exists as intent (surface.ts:255), fully wired. So this
is a rename + three surfaces, not a new feature.
User-facing description
Notes live in their own Notes tab, with Edit / Preview sub-tabs (like the Code tab) and autosave as you type. When a terminal has notes, a note icon lights up in its title bar (→ the tab), and closing the terminal shows the notes one last time before they’re gone.
Architecture-level changes
| Storage | reuse intent, renamed notes — persistence already done |
| Home | dedicated Notes tab + inline editor |
| Editor | plain <textarea> + @kolu/solid-markdown preview (Edit / Preview tabs) |
| Saving | debounced autosave (client → setNotes → server’s 500 ms → disk) |
| On close | deleted with the terminal; the dialog is the reminder |
| Boundary | leaf — reuses the existing renderer + surface; not a @kolu/* package |
- Reuse, renamed.
intentis already persist + autosave + sleep/wake + restore + render. Rename →notes(onestate.tsmigration); the title still shows the first line as the chip. - New tab arm. Notes becomes a kind in the right-panel tab union (
RightPanelTabKindSchema); the editor is extracted once into a sharedNotesEditor. - Orchestration stays at the root.
CloseConfirmrenders the frozentarget.meta.notessnapshot, never a live read — the contract that keeps the reminder from shifting under the user. Leaf components get data + callbacks; the editor singleton lives atApp.tsx. - A leaf, not an electricity. The axes a notes editor could own are already packages — markdown → safe-HTML is
@kolu/solid-markdown, live-state + persistence are@kolu/surface.NotesEditorjust plugs into both, likedefineMutation/@kolu/commandsin the register.
Implementation details
One PR, with a test + visual evidence. In order:
- Rename
intent→notesacross common/server/client + astate.tsmigration (idempotent, optional-safe). - Extract
NotesEditor(textarea + Edit / Preview sub-tabs) from the modal. - Notes tab — add the
notestab kind (compiler-enforced 3-place union change) +NotesPanelwith inline debounced autosave. - Title-bar icon — body-gated
NotesIcon→rightPanel.showNotes(). - Close-dialog reminder — read-only, off the frozen
target.meta.notessnapshot.