Thinking UI

Memory UpdatedPRO

The inline chip an assistant shows when it saves something to memory, with a popover to manage or undo it.

Remember this for next time

Got it, I’ll write examples in TypeScript from now on.

Code

1 file · 264 lines of TypeScriptPRO

Memory Updated is part of Pro

Get its source, the one-paste agent prompt and all 113 components, for a one-time $99.

Motion notes

  • The chip grows out from its icon on the layout spring, so it unfurls inside the reply rather than popping onto it.
  • A twinkling sparkle means “saving”; it spins away and a check draws itself on the elastic spring once the memory is stored.
  • Hover or focus opens the stored fact with Manage and Undo, with a short close delay so the pointer can cross the gap. Undo folds the chip back to nothing on the same spring it arrived on.
  • A persistent live region announces the save and the removal, and takes focus after Undo so the keyboard isn't dropped. With reduced motion, the chip and popover fade and the sparkle holds still.

Usage

Example
<MemoryChip
    fact="Prefers TypeScript"
    status={memory.pending ? "saving" : "saved"}
    detail="From this chat · Just now"
    onUndo={() => deleteMemory(memory.id)}
    onManage={() => router.push("/settings/memory")}
  />

Props

PropTypeDefaultDescription
factstring—The stored fact, e.g. “Prefers TypeScript”.
labelstring"Memory updated"Chip label before the fact.
status"saving" | "saved"—Sparkle while saving, check once saved. Omit to morph on its own shortly after mount.
detailReactNode—Secondary line in the popover, e.g. “From this chat · Just now”.
openboolean—Controlled popover state.
defaultOpenbooleanfalseInitial popover state.
onOpenChange(open: boolean) => void—Called on hover, focus, click and Escape.
undoneboolean—Controlled undo. When true the chip collapses away.
onUndo() => void—Called when Undo is pressed. Delete the memory here.
onManage() => void—Shows a Manage button, e.g. to open memory settings.
placement"top" | "bottom""top"Side the popover opens on.
classNamestring—Classes for the wrapper.