graph: the rendering switch — chains view as the home (release polish 2)

The settings Graph section splits into two switches (owner, 2026-10-06):

- EXTRACTION (was the lone "Graph" row): the DATA channel — pipeline,
  auditor, prober graph tools. Key unchanged (graph.enabled), label now
  names its job; off = the graph stops growing, nothing is deleted.
- GRAPH RENDERING (new, graph.rendering, default on): display-only.
  Off = the home's main view is the CHAINS VIEW instead of the canvas;
  data, reasoning-chain model, and the pipeline keep working untouched.

The chains home (components/chains-home.tsx): ChainTableBody in flow —
same body as the overlay, same powers (query + sort, selection, the
delete fence with its confirm dialog), but onClose is absent so the
top-bar X does not render (the table IS the page; ChainTableBody now
takes onClose optionally). The chrome survivors float top-right below
the top bar: Import notes (ALWAYS — the entry-point law) + the cost
pill (GraphCostControl, now exported). The composer blob persists over
everything; the table scrolls CLEAR of it via a fixed pb-40 band (text
under a floating box is noise — unlike the canvas, which runs under).

Pick flow mirrors the overlay contract exactly (home lifts the pick
set; selectMode swaps the bar's confirm to Done). The chip relabels to
"Pick propositions" (no "from the map" — there is no map); while
picking, the chip row hides so the floating bar above the composer is
the one voice. Settings resolve rendering through the one core
resolver + renderingEnabled(); read server-side per navigation, so the
switch applies on the next visit home.

Smoke-verified live (headless browser): chains home renders without the
X, import + search + composer clearance confirmed, pick flow checked 2
propositions -> Done -> chip count -> practice session started with the
graph context carried (2 props, 2 chains), settings restored.

Known follow-ups (flagged, not built): after Done the bar morphs to the
table's Clear/Delete management bar while the chip also shows the count
(two voices, same set — the table's own editor law); /chat/new's pick
chip still says "from the map".

Tests: rendering in factory/sanitize/parse/resolve pins, the GraphSection
render pins (Extraction label + rendering row), the home-variant
chain-table pin (no close X). 1414 pass; tsc, lint, build green.
This commit is contained in:
amosblomqvist
2026-10-06 08:26:55 +03:00
parent 8a6eab0b6a
commit 962d3086c0
14 changed files with 392 additions and 27 deletions
+12
View File
@@ -205,6 +205,9 @@ export function resolveSettings(record: UserSettings | null): EffectiveSettings
// the embedding/clustering/labeling rungs and the BYOK embeddingModel
// are gone (stale record keys are simply never read here).
enabled: graph.enabled ?? FACTORY_SETTINGS.graph.enabled,
// The RENDERING switch (owner, 2026-10-06): display-only — gates
// the home's main view (canvas vs chains), never the data.
rendering: graph.rendering ?? FACTORY_SETTINGS.graph.rendering,
// The chunk budget (extraction-UX redesign, 2026-09-24): absent
// (pre-redesign record, fresh install) resolves to the factory
// 4096; the sanitizer has already clamped/floored any stored value.
@@ -227,6 +230,15 @@ export function extractionEnabled(graph: { enabled: boolean }): boolean {
return graph.enabled;
}
/**
* The RENDERING gate (owner, 2026-10-06): graph off = the home shows the
* chains view, not the canvas. Display-only by construction — every data
* path (ledgers, extraction, tools) never consults this.
*/
export function renderingEnabled(graph: { rendering: boolean }): boolean {
return graph.rendering;
}
/**
* The PROBER GRAPH TOOLS gate (wave 7, owner ruling 2026-09-23): the
* toggle is an agent-capability switch (it gates tool registration), but
+10 -1
View File
@@ -306,6 +306,13 @@ export interface GraphSettings {
* names, and the prober graph tools read the ledgers directly — there
* is nothing left to configure. Data stays stored either way. */
enabled?: boolean;
/** GRAPH RENDERING (owner, 2026-10-06 — the release graph-controls
* round): gates ONLY the home's main view. Off = the home shows the
* chains view instead of the canvas; the ledgers, the extraction
* pipeline, and every write path are untouched — this is a display
* switch, not a data switch (the extraction master above is the
* data switch). Default on. */
rendering?: boolean;
/** The chunk budget (extraction-UX redesign, owner 2026-09-24): the
* transcript-token share of the extractor's context — a run fires
* when a chat's UNCOVERED tokens reach it, and the run batches the
@@ -395,7 +402,7 @@ export const FACTORY_SETTINGS: FactorySettings = {
sessionNameSerif: true,
mdRendering: { headingWeight: 900, boldColor: null, italicColor: null },
},
graph: { enabled: true, extractionChunkTokens: 8192 },
graph: { enabled: true, rendering: true, extractionChunkTokens: 8192 },
compaction: { thresholdTokens: 150_000 },
};
@@ -566,6 +573,8 @@ function sanitizeGraph(raw: Record<string, unknown>): GraphSettings {
const out: GraphSettings = {};
const enabled = boolOrDrop(raw.enabled);
if (enabled !== undefined) out.enabled = enabled;
const rendering = boolOrDrop(raw.rendering);
if (rendering !== undefined) out.rendering = rendering;
const rawTokens = raw.extractionChunkTokens;
if (typeof rawTokens === "number" && Number.isFinite(rawTokens) && rawTokens > 0) {
out.extractionChunkTokens = Math.max(EXTRACTION_CHUNK_TOKENS_FLOOR, Math.floor(rawTokens));
+4
View File
@@ -296,6 +296,10 @@ export function parseGraphSettingsBody(body: unknown): SettingsBodyResult<GraphS
if (typeof raw.enabled !== "boolean") return { ok: false, error: "enabled must be a boolean" };
settings.enabled = raw.enabled;
}
if (raw.rendering !== undefined) {
if (typeof raw.rendering !== "boolean") return { ok: false, error: "rendering must be a boolean" };
settings.rendering = raw.rendering;
}
if (raw.extractionChunkTokens !== undefined) {
if (typeof raw.extractionChunkTokens !== "number" || !Number.isFinite(raw.extractionChunkTokens)) {
return { ok: false, error: "extractionChunkTokens must be a number" };