Panes by column: a forest of panes, curves between them, close, pin and an active rule

The tree of forks becomes a forest: a pinned pane stays open when a pane it was
opened from closes, as an orphan in its own column. Close takes a pane and what
was opened from it, pinned panes excepted; pin and unpin; [ and ] move to the
pane above or below in a column.

The panes view is laid out by column: column d holds every pane at depth d and
divides its own height among them, a short pane taking only what its text needs;
when they do not fit, all but the focused branch's pane (and pinned ones) fold
into one-line tabs. A faint curve runs from the words, row or link each pane was
opened from to its title, the focused branch's in a stronger ink; curves through
one gutter take lanes side by side, ordered to cross least. Every pane has the
same hairline right and bottom. The active pane has a heavy rule across its top,
the rest of the focused branch a hairline. Each pane has a pin and a x at its top
right (the x also on its spine); q closes the active pane, whatever it shows
(it used to close a whole fork from wherever the fork began, which closed the
node an article was opened from); P pins it. /curves off hides the curves.

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-16 00:37:59 -05:00
1 parent 2f8ca98207
commit 3298cc430c
20 files changed
+1822 -783

No files matched your search

+8 -4
View File
@@ -9,7 +9,7 @@ import { ownerSection, resolveNode } from "../core/links";
import { docOf, isLink, label, type NodeId } from "../core/model";
import { describeTarget, hostOf, parseTarget, validateRef, wikiTitle, type Ref } from "../core/ref";
import { clip, plain } from "../core/text";
import { sameAux, store, type Aux } from "./store";
import { kidClass, sameAux, store, type Aux } from "./store";
import type { Sugg } from "./linker";
import { suggest, summary, wikiConfig, type Attribution as Attr, type Suggestion } from "./wiki";
@@ -144,14 +144,18 @@ export function TargetRow({ id }: { id: NodeId }) {
export const PaneCtx = createContext<number | undefined>(undefined);
/**
* In a pane with forks, what marks the words, rows and links its forks were opened from: each open
* child is "forked", the focused one "forked picked". By the keys a pane's child goes by (refKey).
* In a pane with children, what marks the words, rows and links they were opened from: with forks,
* each open child is "forked", the focused one "forked picked"; always, a class named after the
* child (kidClass), which the curves start from. By the keys a pane's child goes by (refKey).
*/
export function useForkMark(): ((...keys: (string | undefined)[]) => string) | null {
const marks = store.forkMarks(useContext(PaneCtx));
if (!marks) return null;
return (...keys) => {
for (const k of keys) if (k && marks.has(k)) return marks.get(k) ? "forked picked" : "forked";
for (const k of keys) {
const m = k && marks.get(k);
if (m) return `${m.many ? (m.picked ? "forked picked " : "forked ") : ""}${kidClass(k!)}`;
}
return "";
};
}