Skip to content

Per-thread scratch notes: notes field, header editor, sidebar preview (#194) - #235

Merged
currentbits merged 4 commits into
mainfrom
coder/per-thread-scratch-notes-8d56ca
Aug 17, 2026
Merged

currentbits merged 4 commits into
mainfrom
coder/per-thread-scratch-notes-8d56ca

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Closes #194.

When you supervise many threads, the reason a thread is parked ("merge after #42 lands", "why I snoozed this") lives in your head or in some other app. This adds a plain scratch pad to the thread itself.

notes is user-facing only — the agent never reads it, so it stays distinct from shared agent memory, which is agent-facing.

What changed

Contract + main process (7595bdd)

  • ThreadInfo.notes: string (empty when unset) and THREAD_NOTES_MAX = 2000 in src/shared/ipc.ts.
  • threads:setNotes through services.setNotes → electron/ipc.js → preload.js, plus src/wireClient.ts for the web bridge. Trims, caps at 2000, empty string clears, never bumps updatedAt — same rules as setMuted/setPinned.
  • migrateThread defaults notes to "", so threads already on disk upgrade cleanly.
  • store.searchThreads matches notes text alongside titles and messages (checked before the message scan, since it is cheap). Mirrored in the devCoder fake search.
  • Fakes updated in src/devCoder.ts and test/support/fakeCoder.ts.

UI (4049a00)

  • A Notes button in the thread header toggles a textarea panel below it. Blur saves, Escape reverts and closes, Enter inserts a newline (it is a scratch pad, not a one-line field). A write only fires when the trimmed draft actually differs, so opening and closing does nothing. The button carries a dot when the thread already has a note.
  • Sidebar cards render the note's first line, truncated by CSS, with the full text as the hover title. The card is read-only for notes; editing lives in the header.
  • useCoder.setNotes mirrors renameThread exactly (optimistic list + detail patch, same error scope).

Draft-loss fix (e083210)

  • ⌘J/K and ⌘1…9 switch threads without the textarea ever blurring, so onBlur never fired and a typed draft was silently discarded on the way out. The thread-change effect now flushes a dirty draft to the thread it was typed on, which is why onSetNotes carries a thread id rather than implying the selected thread.

Tests

New electron/test/notes.test.js (trim, cap, clear, unknown thread, updatedAt untouched), a notes-only search hit in electron/test/search.test.js, setNotes added to the ipc-seam handler list, and test/threadNotes.test.tsx covering open/seed, save-on-blur, Escape-without-save, the sidebar preview, and the thread-switch flush asserting the old thread id.

typecheck clean; renderer 745/745, electron 875/876, core 38/38, memory 122/122. The single electron failure is pre-existing and unrelated — web-integration.test.js reconnect backoff asserts 1s and gets 120000, reproducing on main at aa4d1ca and when run alone. Filed separately as #233.

Not built (deliberately)

Markdown rendering, a notes modal, notes on the Kanban/Activity views, autosave-on-timer, notes history, and any agent-facing use of notes. One string on the thread in the existing store.

  • PR created by the Claude Code agent

Willem added 4 commits August 17, 2026 13:41
… Spaces: named groups for organizing projects in the sidebar
Add a per-thread scratch pad on the data contract and persist it through
the existing JSON store. setNotes trims, caps at 2000, never bumps
updatedAt, and is matched by thread search.
Scratch notes live next to the thread: a header Notes toggle opens a
textarea (save on blur, Escape reverts), and the sidebar card shows a
single-line preview. Opening and closing unchanged does not write.
A programmatic select (sidebar card / next-thread) never blurs the
notes textarea, so the dirty draft was discarded. Flush it onto the
outgoing thread id before reseeding the panel.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@currentbits
currentbits merged commit 28b62f5 into main Aug 17, 2026
1 check failed
@currentbits
currentbits deleted the coder/per-thread-scratch-notes-8d56ca branch October 3, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Per-thread scratch notes

1 participant