Skip to content

Memory: new-memory badge and send memory to task - #228

Merged
nthomsencph merged 7 commits into
mainfrom
feat/187-memory-badge
Nov 9, 2026
Merged

nthomsencph merged 7 commits into
mainfrom
feat/187-memory-badge

Conversation

@nthomsencph

@nthomsencph nthomsencph commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #227 (which is stacked on #229); merge after it.

What was missing

The memory browser read a project's memory only while its modal was open, so nothing told you when Claude had written a new memory. And there was no way to point a task's agent at a memory short of copying its path.

What changed

New-memory badge

  • MemoryWatcher is back, rebuilt from the version that was cut before Browse and edit Claude auto-memory from Dash #189 landed. It keeps one fs.watch per project for as long as the project exists, starting at launch. A memory folder that doesn't exist yet is watched through its nearest existing ancestor, as before. syncMemoryWatches adds and drops watches when a project is added (from the UI or the control API) or deleted.
  • A new projects.memory_seen_at column (epoch ms) records when you last looked. The migration adds it behind a pragma_table_info guard and sets existing projects to "now", so old memories don't all show up as new on the first launch. New projects start at "now" too.
  • On each change (debounced 300 ms), main counts the memory files modified after memory_seen_at (MEMORY.md doesn't count) and pushes memory:newCount. The renderer keeps the counts in runtimeStore.
  • The project row shows the number of new memories in a small count badge (the existing CountBadge), with an "N new memories" tooltip. Clicking it opens the memory. Opening the modal, and closing an edit made from it, sets the project as seen and clears the badge. memory:markSeen broadcasts 0 so a count already on its way can't bring it back.

Send memory to task prompt

  • A "Memories" item in the task's … menu opens the memory of that task's project, with the task as the origin. The project menu opens it as before, with no origin.
  • An @ button on the shown memory closes the modal and types @<absolute path> into the task's agent pane without sending it, then focuses the terminal. It uses the existing typeIntoTask. A path with whitespace is typed as @"<path>", the quoted form Claude Code parses.
  • Target: the origin task, if it is still open; otherwise the active task, if it is an open task of the shown project; otherwise the button is greyed out and its tooltip says "Open a task in to send this memory to it". The origin is kept when you switch project in the modal and dropped on close. IconButton gets a disabled state that keeps its tooltip working (a disabled <button> gets no hover events).

Verification

  • pnpm type-check and pnpm lint pass (0 errors; the 40 warnings were already there).
  • pnpm test: 1780 passed, 3 skipped (on top of Show setup script progress and output #227). New tests cover the migration, the new-memory count, the watcher (real fs: writes, a late folder, delete and recreate, ignoring transcript writes, removing a project), the send target (origin, active, archived, none) and the mention text, the modal's origin task in uiStore, and the runtimeStore badge state.
  • dashctl.test.ts sometimes fails when the whole suite runs. It does the same on main without these changes.

Still needs a manual check in a dev instance: the count appears when Claude writes a memory and clears when the modal opens or an edit closes; the count after a restart; the task menu's "Memories" item; the @ button types into the right task and focuses it; the disabled tooltip; how the count badge looks in the row.

Fixes #187

🤖 Generated with Claude Code

Main watches every project's auto-memory folder from startup (one fs.watch
each, on the folder or its nearest existing ancestor until it exists) and
pushes the project's new-memory count on each change. A project's last look
is a new memory_seen_at column, moved to now when its memory modal opens.
The project row shows a dot with an "N new memories" tooltip.

Claude goes brr.. via Dash
An @ button on the shown memory types `@<memory path> ` into the active
task's agent pane, unsent, closes the modal and focuses the terminal, so the
user can finish the sentence. It goes through typeIntoTask, as Fix CI and the
review toast do. With no active task in the shown project the button is
greyed out and its tooltip says why; IconButton gains a disabled state that
keeps its tooltip.

Fixes #187

Claude goes brr.. via Dash
- The modal marks the project seen again when an edit in the diff editor
  closes, so saving a memory doesn't bring the dot back.
- markSeen broadcasts 0 after any count already sent, and a count reads the
  seen time only once the folder is read, so a stale count can't relight it.
- A memory path with whitespace is mentioned as @"...", the form Claude Code
  parses (its @-mention regex matches @"([^"]+)").
- The memory_seen_at migration runs its ALTER and UPDATE in one transaction.
- The late-folder watcher test retries until notified instead of waiting.

Claude goes brr.. via Dash
- The project row shows how many memories are new in a CountBadge, where the
  dot was, with the same tooltip.
- A "Memories" item in the task's ... menu opens its project's memory with
  that task as the origin. Send to task now goes to the origin task first,
  then the shown project's active task, else stays disabled. The origin
  survives switching project in the modal and is dropped on close.

Claude goes brr.. via Dash
The task the modal was opened from is skipped once the modal shows another
project's memory; the shown project's active task, or the disabled reason,
takes over. Rename NewMemoryDot to NewMemoryCount.

Claude goes brr.. via Dash
Main has no project-changed signal of its own (projectEvents only tells the
renderer), so saveProject and deleteProject, the one path every caller takes,
resync the memory watches. The three hand calls in dbIpc and the control API
are gone. Syncs are no-ops until startMemoryWatches at app start, so tests
and early saves open no watches. memory:markSeen takes the project id.

Claude goes brr.. via Dash
memoryBadge sends through broadcast, the memory:newCount listener through
preload's listen, and the modal finds its origin task with selectTaskById.
MemoryWatcher keeps its own fs.watch: it re-arms on the event type and its
debounce must outlive a re-arm, which watchDir's close would cancel.

Claude goes brr.. via Dash
@nthomsencph
nthomsencph force-pushed the feat/187-memory-badge branch from fe9149c to 28fe1bb Compare November 8, 2026 23:45
@nthomsencph
nthomsencph changed the base branch from main to feat/201-setup-progress November 8, 2026 23:45
@nthomsencph
nthomsencph changed the base branch from feat/201-setup-progress to main November 8, 2026 23:58
@nthomsencph
nthomsencph changed the base branch from main to feat/201-setup-progress November 9, 2026 00:01
@nthomsencph
nthomsencph changed the base branch from feat/201-setup-progress to main November 9, 2026 00:03
@nthomsencph
nthomsencph merged commit 3d778aa into main Nov 9, 2026
5 checks passed
@nthomsencph nthomsencph mentioned this pull request Nov 9, 2026
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.

Memory: new-memory badge on project rows + send memory to task prompt

1 participant