Skip to content

Show the notes folder as a workspace tree in Space - #226

Merged
BunsDev merged 13 commits into
mainfrom
notes-tree
Oct 15, 2026
Merged

BunsDev merged 13 commits into
mainfrom
notes-tree

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Stacked on #222's branch (notes-store, which now includes #225). Notes in folders, slice B2: Space shows the notes folder as Workspace › Project › Folder › pages and files.

Store and IPC (NotesStore, shared/notes.ts)

  • notes:tree lists workspaces, projects, folders, notes and files, with a version hash. { since } answers unchanged, so the 1.5-second poll stays cheap.
  • Create: a workspace, a project, a folder, or a page in a project or folder (space:create { containerId }). Also rename a workspace, project, folder or file, and delete an empty container.
  • Move notes, folders and files into a project or folder, or projects into a workspace. Placement rules apply, a folder can't go inside itself, and a moving page gets a "Moved page" or "Moved folder" version first. Notes inside a moved folder keep their revisions.
  • Ids survive renames, moves and restarts. Workspaces and projects keep theirs in marker files; other folders and plain files in the index, found by path or by inode after a Finder move. A folder name that can't hold the typed name (say, a colon) keeps that name in the index.
  • notes:reveal and notes:open are local-only (Reveal in Finder, open with the default app).

Space sidebar (NotesTree.tsx, useNotesTree.ts)

  • The tree replaces the flat page tree in Pages and All. "New workspace" is in Space options.
  • Row menu: New page, New folder or New project, Rename (edited in place), Move to… (only valid places), Reveal in Finder, and Delete when empty.
  • What a click does: a page opens as before; a folder with a folder note opens that page; a file opens in its default app.
  • Labels: container rows are named by their name alone, so they never collide with a page's "Open <title>" label that existing specs use.
  • Fallback: if the tree can't load, the old page tree stays.

Tests

  • New test/notes-tree.test.ts: listing, creation, rename through the folder note, moves and their versions, Finder renames keeping ids, delete-empty rules, and the version hash.
  • New e2e/notes-tree.spec.ts: create each level, page in a folder, rename a folder on disk, Move to, relaunch. It couldn't run locally: the display was asleep, so every launch timed out waiting for the native show.
  • The notes, Space and Pages unit tests pass: 52 passed, 0 failed.

The first slice of notes in folders. NotesStore keeps SpaceStore's page
contract (ids, revisions, 30-second typing checkpoints, cascading trash
and restore, revert, comments, the same error texts) over a folder laid
out Workspace > Project > folders, with Personal > Notes as the default.

Each note carries modex_id frontmatter, so moves, renames and crashes
never lose which page a file is; a page with children is a folder that
holds a folder note of the same name. Version history, comments, trash
batches and a last-seen index live in .modex/. Writes go history, note,
index, and reading finishes whatever a crash interrupted. Edits, moves,
new files and deletions made outside Modex become versions of their
own. Migration builds the folder beside notes/ from app/space.json and
publishes it with one rename, never writes space.json, keeps a backup,
and recovers pages an older build changes later.

Modex does not use it yet; SpaceStore now exports its reader and
validators and a SpacePagesStore interface for the switch.

Coven-Harness: Claude Code / claude-opus-5-5
Store now holds a NotesStore over MODEX_HOME/notes instead of SpaceStore
over app/space.json; the space:* commands and the Pages tools keep their
contract. On first use, the pages of app/space.json move into
Personal > Notes and that file is never written again.

A page's file takes its title's name when the title loses focus or
another page opens (notes:settle); typing never renames files. Version
history labels edits made outside Modex "Outside Modex".

The e2e specs that read space.json now read the note files, and the
forced save failures refuse the history folder instead of replacing
space.json with a directory. New notes.spec covers the migration and an
edit made outside Modex.

Coven-Harness: Claude Code / claude-opus-5-5
NotesStore now lists the folder as workspaces, projects, folders, notes
and files (notes:tree, with a version for cheap polling). It can create
workspaces, projects and folders, create a page in a project or folder,
rename any container or file, move notes, folders and files into a
project or folder (projects into a workspace), and delete an empty
container. Workspace and project ids live in their marker files; other
folders and files keep theirs in the index, found again by path or by
inode after a Finder move. A moving page gets a version before its file
moves. Reveal in Finder and Open are local-only commands.

Coven-Harness: Claude Code / claude-opus-5-5
Space's sidebar now lists Workspace > Project > Folder > pages and
files from notes:tree, polled like pages. Space options can create a
workspace; a row's menu creates a project, folder or page in place,
renames (edited inline), moves (Move to... lists only valid places),
reveals in Finder, and deletes what is empty. A page opens as before, a
folder with a folder note opens that page, and a file opens in its
default app. Container rows are named by their name alone so they never
collide with a page of the same title. If the tree cannot load, the
previous page tree remains.

Coven-Harness: Claude Code / claude-opus-5-5
# Conflicts:
#	apps/desktop/src/main/commands.ts
#	apps/desktop/src/main/index.ts
#	apps/desktop/src/shared/types.ts
#	apps/store-desktop/src/main/demo.ts
#	docs/status.md
@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
modex Ready Ready Preview Oct 15, 2026 4:51pm UTC

Request Review

uniqueName compared the bare stem against names with their extension,
so for any extension but .md a taken name went unseen: renaming or
moving a file next to one of the same name failed with EEXIST instead
of getting a suffix. A note and a folder of one name still collide.

Coven-Harness: Claude Code / claude-opus-5-5
status.md: keep main's new entries (one CI run per PR push, the Fable
fallback) and then the notes entry.

Coven-Harness: Claude Code / claude-opus-5-5
Coven-Harness: Claude Code / claude-opus-5-5
Its tree equals #222's final head, which notes-tree already contains.

Coven-Harness: Claude Code / claude-opus-5-5
Coven-Harness: Claude Code / claude-opus-5-5
BunsDev added a commit that referenced this pull request Oct 15, 2026
#238 already carries #235's folder-move and default-container repairs, so every conflict
resolves to #238's side and the tree is unchanged. The merge brings in #235's and
notes-tree's ancestry so later merges of #226's squash and main do not conflict again.

Coven-Harness: Claude Code / claude-opus-5-5
@BunsDev
BunsDev merged commit f52e033 into main Oct 15, 2026
12 checks passed
@BunsDev
BunsDev deleted the notes-tree branch October 15, 2026 17:36
BunsDev added a commit that referenced this pull request Oct 15, 2026
Its tree equals #226's final head 8cdaef5, which this branch already contains.

Coven-Harness: Claude Code / claude-opus-5-5
BunsDev added a commit that referenced this pull request Oct 15, 2026
…ts (#246)

Follow-ups from a code review of the notes stack (#222, #226, #227, #230).

Knowledge tools fence by real paths: a document path that lands in the notes
folder must land in the turn's own project, whether the knowledge base is the
notes folder, a workspace inside it, a folder that holds it, or a content.dir
inside it. Search over such a base is read locally, asynchronously and
bounded, skipping other projects' notes. Before, only a base that was exactly
the notes root was confined, and a content.dir broke the prefix.

Pages and knowledge tools look up the project's notes on every call, so
moving them to another workspace mid-turn no longer refuses every call. A
read-only turn finds the project's notes without making them, and an unknown
project gets none rather than every project's.

NotesStore: a copied workspace or project folder gets its own id instead of
making the store unreadable; detachProject drops the cached look;
linkProject answers from the last look when already linked; the watcher
ignores dot folders (.modex, .ok, .git) but not markers; pageRels() serves a
whole call. The sidebar hides a workspace whose projects a filter hides.

Coven-Harness: Claude Code / claude-opus-5-5

This branch was successfully deployed

1 active deployment
Preview — 8cdaef51 Deployed Oct 15, 2026 by vercel[bot]
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