Store: one way to do each thing, dead parameters and branches out

- Streamed model writing (a note, sections, a note on an article) ends
  through one `writing` helper, and the first-token timing is one
  closure; one errText for the error message written out seven times.
- apply() runs through attempt(), duplicateNode through apply(); the
  nodeWrite wrapper is gone. The links list's decline is
  rejectSuggestion. setPaneSources and reorderPane share changeForest;
  setForest was a plain assignment. paneMoves and movePane share
  activeColumn (by forkNode's index, not a linear search). out() steps
  back with land(); navigate's two "show the library" branches are one;
  the article title a host shows is hostArticle() wherever it is asked.
- Dead: the "rewrite" pending kind (nothing makes one; Node.tsx looked
  for it), createLibrary's open flag and both library calls' return
  values (every caller opens, none reads), and parameters no caller
  passes (viewKey, endReview, exportNode, importFile's default,
  whenSynced, auxSpot's default). Emits right after say(), which emits,
  and a repairView run twice in revert.
- panePath folded into pathRefs, its only caller; two comments reworded
  that narrated history or had lost words.

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 16:25:27 -05:00
1 parent 2e3ffbb7cd
commit 5d6b7a8215
2 files changed
+134 -175

No files matched your search

+1 -2
View File
@@ -276,11 +276,10 @@ export function NodeBody({ id, inline, inNote }: { id: NodeId; inline?: boolean;
const snap = store.snap;
const n = snap.nodes[id];
if (store.edit?.node === id && store.edit.field === "body") return <BodyEditor id={id} />;
const rewrite = [...store.pending.values()].find((p) => p.node === id && p.kind === "rewrite");
const { placed, orphans } = notesFor(snap, id);
const paras = paragraphs(n.body);
return (
<span class={`body${rewrite ? " rewriting" : ""}`} data-body={id}>
<span class="body" data-body={id}>
{paras.map((r, i) => (
<Para key={i} id={id} range={r} notes={placed} inline={!!inline} inNote={!!inNote} first={i === 0} />
))}