Skip to content

Akhil/notes metadata body split - #274

Merged
itsmeakhil merged 4 commits into
mainfrom
akhil/notes-metadata-body-split
Aug 13, 2026
Merged

Akhil/notes metadata body split#274
itsmeakhil merged 4 commits into
mainfrom
akhil/notes-metadata-body-split

Conversation

@itsmeakhil

Copy link
Copy Markdown
Collaborator

No description provided.

itsmeakhil and others added 4 commits August 12, 2026 20:48
Bodies are moving out of the notes metadata array, so the compound
`id|updatedAt` cache key would go stale (metadata updatedAt no longer
advances on every body save). Key by id and have every write path
overwrite its entry explicitly. Adds delete/clear so a removed note's
text is dropped and a vault lock clears all plaintext from memory.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Aqzbw8Z5mbR5bNMp3pWfvk
…e delete

The notes list feeds the sidebar, which needs metadata only, but it was
returning the full meta_json row — every encrypted body — forcing the UI
to decrypt the whole vault on open. Null the content field unless
?content=1 (the search-index warm).

Recursive delete re-listed every note once per tree level; build the
parentId -> children map once and BFS it, with a cycle guard.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Aqzbw8Z5mbR5bNMp3pWfvk
…arch

Opening Notes decrypted every note body, and every autosave replaced the
notes array — rebuilding noteById/childrenMap/sortedNotes and re-rendering
the whole sidebar tree once per second while typing.

Metadata and bodies now have separate lifetimes:

- `notes` holds metadata only; bodies live in a new NotesContentContext
  that only the editor subscribes to, so body writes can't touch the
  sidebar. A content-only save skips setNotes entirely and parks the
  server's new updatedAt until the next note switch.
- refreshNotes does no crypto at all; the active note's body is fetched
  and decrypted on demand.
- Bodies and the search index are tagged with the cipher key they were
  decrypted under, so a vault lock invalidates both on read. The
  module-level plain-text cache is cleared explicitly on key change so
  decrypted text doesn't outlive the unlocked session.
- Sidebar search warms the plain-text index once, on the first query of
  the session, reusing the existing Notes.sidebar.loading string.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Aqzbw8Z5mbR5bNMp3pWfvk
@vercel

vercel Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Unable to deploy a commit from a private repository on your GitHub organization to the itsmeakhil's projects team on Vercel, which is currently on the Hobby plan. In order to deploy, you can:

  • Make your repository public or
  • Upgrade to Pro. A Pro subscription is required to deploy from a private organization repository.

To read more about collaboration on Vercel, click here.

@itsmeakhil
itsmeakhil merged commit c04cb5f into main Aug 13, 2026
0 of 2 checks passed
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.

1 participant