UI without documents: every page a node, the library root the first; moving, copying, exporting and importing any node

The page has one head for whatever node is the page (crumbs from the library's title, a byline of
sections and nodes, its flags and ⋯); in panes the first pane is the page and every other pane has
a section's head, whatever node it shows. A prompt (a node whose sections cite its sentences) is
folded wherever it shows. The library root's sections open in place like any others; an address
outside the hoisted node un-hoists to the library, and Esc at a hoisted page's top steps out to its
parent's.

What acts on a node and everything under it acts on the node the reader is on (the focused
section, or the one a focused note or selection is in): M moves it under any node (the jump box as
a picker, the root offered too), /duplicate copies it just after itself, /export saves it, /import
reads a file in as its last child (place() prefixes the titles down to the parent), /linkhere scans
it, S lists its links (on the root, the whole library's), history's f filters to it and r reverts
it. Every node's ⋯ offers them.

The documents menu, its mode and keys, /new, /open, /rename and /linkdoc are gone; m is free and
the top bar's left is a plain label with the library's name. Addresses are /n/<node id>, and / the
root; an old /doc/ address shows the library.

Server: /api/docs gives way to /api/nodes/<id>/{tree,export,import}; link jobs take scope "node" or
"library" and pending lists ?node=<id>&subtree=1. Step-1 shims removed: docOf/documents, all of
core/library.ts (IMPORT_MAX and importTree move to seed.ts, address and resolve to address.ts),
docArg, and the old single-document replica check. revertDocTo is revertSubtreeTo.

The page scrolls the focus into view only when the focus, the page or the mode changed, not on a
render for something that arrived in the background; row flags give way on a narrow screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab
This commit is contained in:
thalladaandClaude Opus 5.5 committed 2026-11-17 01:49:12 -05:00
1 parent e6e4ad8d26
commit bed47c0c7a
31 files changed
+789 -1153

No files matched your search

+32
View File
@@ -332,6 +332,38 @@ describe("the scan route in review mode", () => {
expect(marked.suggestions.find((s: Suggestion) => s.kind === "forced")).toBeTruthy();
expect(marked.entries.find((s: Suggestion) => s.kind === "forced").review).toBeUndefined();
});
it("scopes by node: a node and everything under it (/linkhere), or on the library root the whole library (/linkall); pending lists a subtree", async () => {
const snap = ids.doc.snap();
expect(scopeNodes(snap, ids.minds)).toEqual([ids.minds, ids.arms]);
expect(scopeNodes(snap, ids.arms)).toEqual([ids.arms]);
expect(scopeNodes(snap, null)).toEqual([ids.minds, ids.arms, ids.stars]);
expect(scopeNodes(snap, ids.lib)).toEqual(scopeNodes(snap, null));
const done = async () => {
for (let i = 0; i < 200; i++) {
const { job } = await (await fetch(`${base}/api/links/jobs`)).json();
if (job.state !== "running") return job as JobState;
await new Promise((r) => setTimeout(r, 20));
}
throw new Error("the job did not finish");
};
expect((await post("jobs", { scope: "node", node: ids.minds })).job).toMatchObject({ scope: "node", node: ids.minds, title: "Octopus minds", total: 2 });
expect(await done()).toMatchObject({ state: "done", done: 2 });
expect((await post("jobs", { scope: "node", node: ids.lib })).job).toMatchObject({ scope: "library", title: "the library", total: 3 });
await done();
const lib = (await post("jobs", { scope: "library" })).job;
expect(lib).toMatchObject({ scope: "library", total: 3 });
expect(lib.node).toBeUndefined();
await done();
expect((await post("jobs", { scope: "doc", doc: "octopus-minds" })).error).toMatch(/scope is "node" or "library"/);
expect((await post("jobs", { scope: "node", node: "999@999" })).error).toMatch(/no node/);
// Pending: a node alone, or with everything under it.
const sub = await (await fetch(`${base}/api/links/pending?node=${encodeURIComponent(ids.minds)}&subtree=1&all=1`)).json();
expect(sub.suggestions.length).toBeGreaterThan(0);
expect(new Set(sub.suggestions.map((s: Suggestion) => s.node))).toEqual(new Set([ids.arms]));
const alone = await (await fetch(`${base}/api/links/pending?node=${encodeURIComponent(ids.minds)}&all=1`)).json();
expect(alone.suggestions.every((s: Suggestion) => s.node === ids.minds)).toBe(true);
});
});
describe("the links list in the page", () => {