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
+10
View File
@@ -88,6 +88,16 @@ function render(props: Partial<typeof BASE> = {}) {
return renderToStaticMarkup(React.createElement(ChainTableBody, { ...BASE, ...props }));
}
describe("ChainTableBody — the HOME variant (graph rendering off, 2026-10-06)", () => {
it("onClose ABSENT = the page, not the overlay: no close X, everything else intact", () => {
const html = render({ onClose: undefined });
assert.ok(!html.includes('data-testid="chain-table-close"'), "nothing to close — the table IS the page");
assert.ok(html.includes('data-testid="chain-table-search"'), "the search row stays");
assert.ok(html.includes("chain"), "the counts stay");
assert.ok(html.includes("lh-drag"), "the window-drag band stays (same bar as every surface)");
});
});
describe("ChainTableBody — clusters (the outermost layer)", () => {
it("collapsed by default: cluster rows render, chain rows do not", () => {
const html = render();
+15 -4
View File
@@ -174,19 +174,30 @@ describe("GraphSection — master switch + chunk budget (wave 7 + 2026-10-02)",
// only other control — it denominates the coverage ring and gates the
// auto-extraction trigger, resolved through the same core resolver the
// server uses (the 4096-fallback fix).
it("renders the master-switch row", () => {
it("renders the master-switch row — EXTRACTION since 2026-10-06 (the data channel, renamed when rendering split off)", () => {
const html = renderToStaticMarkup(<GraphSection graph={undefined} onSectionChange={() => {}} />);
assert.ok(html.includes('data-testid="graph-row-enabled"'));
assert.ok(html.includes(">Extraction<"), "the row names the DATA channel, not 'Graph'");
assert.ok(!html.includes("graph-row-embedding"), "the dead rungs render nothing");
assert.ok(!html.includes("Embedding model"), "the picker is gone");
assert.ok(!html.includes("graph-row-clustering"));
assert.ok(!html.includes("graph-row-labeling"));
assert.ok(tagOf(html, "toggle-graph-enabled").includes('aria-checked="true"'), "absent record = factory ON");
assert.ok(tagOf(html, "toggle-extraction-enabled").includes('aria-checked="true"'), "absent record = factory ON");
});
it("a stored off record shows the switch off", () => {
it("a stored off record shows the extraction switch off", () => {
const html = renderToStaticMarkup(<GraphSection graph={{ enabled: false }} onSectionChange={() => {}} />);
assert.ok(tagOf(html, "toggle-graph-enabled").includes('aria-checked="false"'));
assert.ok(tagOf(html, "toggle-extraction-enabled").includes('aria-checked="false"'));
});
it("the GRAPH RENDERING row (2026-10-06): display-only — absent record = factory ON, stored off shows off", () => {
const html = renderToStaticMarkup(<GraphSection graph={undefined} onSectionChange={() => {}} />);
assert.ok(html.includes('data-testid="graph-row-rendering"'));
assert.ok(html.includes(">Graph rendering<"));
assert.ok(tagOf(html, "toggle-graph-rendering-enabled").includes('aria-checked="true"'), "the home defaults to the canvas");
const off = renderToStaticMarkup(<GraphSection graph={{ rendering: false }} onSectionChange={() => {}} />);
assert.ok(tagOf(html, "toggle-extraction-enabled").includes('aria-checked="true"'), "rendering off does NOT touch extraction");
assert.ok(tagOf(off, "toggle-graph-rendering-enabled").includes('aria-checked="false"'));
});
it("the chunk-budget row: unset shows EMPTY with the factory placeholder + hint — one truth with the trigger", () => {
+11
View File
@@ -163,6 +163,17 @@ describe("parseGraphSettingsBody", () => {
assert.equal(parseGraphSettingsBody("nope").ok, false);
});
it("rendering (2026-10-06): boolean display switch — replace-whole like every sibling", () => {
const off = parseGraphSettingsBody({ enabled: true, rendering: false });
assert.ok(off.ok);
assert.deepEqual(off.settings, { enabled: true, rendering: false });
// absent = unset (factory ON at resolution)
const absent = parseGraphSettingsBody({ enabled: true });
assert.ok(absent.ok);
assert.deepEqual(absent.settings, { enabled: true });
assert.equal(parseGraphSettingsBody({ rendering: "off" }).ok, false, "rendering must be a boolean");
});
it("extractionChunkTokens: whole tokens ≥ the 500 floor (extraction-UX redesign, 2026-09-24)", () => {
const ok = parseGraphSettingsBody({ enabled: true, extractionChunkTokens: 2048 });
assert.ok(ok.ok);
+17 -3
View File
@@ -12,6 +12,7 @@ import { describe, it } from "node:test";
import {
extractionEnabled,
graphToolsEnabled,
renderingEnabled,
resolveConversationSpec,
resolveModelSpec,
resolveRoleSpec,
@@ -43,7 +44,7 @@ describe("resolveSettings", () => {
assert.equal(eff.appearance.mdRendering.headingWeight, 900);
// wave 7 collapse: the master switch ONLY + the redesign's chunk
// budget — absent record resolves the factory 8192 (the 2026-09-30 bump)
assert.deepEqual(eff.graph, { enabled: true, extractionChunkTokens: 8192 });
assert.deepEqual(eff.graph, { enabled: true, rendering: true, extractionChunkTokens: 8192 });
});
it("explicit record values win over every factory default", () => {
@@ -76,10 +77,23 @@ describe("resolveSettings", () => {
assert.equal(eff.appearance.mdRendering.headingWeight, 600);
// wave 7 collapse: the section IS the master switch (absent budget
// field = factory 8192 — a pre-redesign record resolves cleanly).
assert.deepEqual(eff.graph, { enabled: false, extractionChunkTokens: 8192 });
assert.deepEqual(eff.graph, { enabled: false, rendering: true, extractionChunkTokens: 8192 });
// The DISPLAY split (owner, 2026-10-06): extraction off leaves the
// rendering switch ON — the data channel and the view are separate.
assert.equal(renderingEnabled(eff.graph), true);
// The chunk budget rides the same resolution: stored value wins.
const budgeted = resolveSettings({ version: 1, graph: { extractionChunkTokens: 2000 } });
assert.deepEqual(budgeted.graph, { enabled: true, extractionChunkTokens: 2000 });
assert.deepEqual(budgeted.graph, { enabled: true, rendering: true, extractionChunkTokens: 2000 });
});
it("graph rendering (2026-10-06): display-only — off resolves off, extraction untouched", () => {
const eff = resolveSettings({ version: 1, graph: { rendering: false } });
assert.equal(eff.graph.rendering, false, "stored off wins");
assert.equal(eff.graph.enabled, true, "the data channel is untouched");
assert.equal(renderingEnabled(eff.graph), false);
assert.equal(extractionEnabled(eff.graph), true);
// absent = factory ON (the home defaults to the canvas)
assert.equal(resolveSettings({ version: 1, graph: {} }).graph.rendering, true);
});
it("partial role override: thinkingLevel alone borrows the SLOT's model (or nothing, without one)", () => {
+1 -1
View File
@@ -24,7 +24,7 @@ describe("FACTORY_SETTINGS (the compiled factory layer)", () => {
// wave 7 collapse: the master switch ONLY + the extraction-UX
// redesign's chunk budget (2024-09-24); default doubled 8192 with
// the digest-aware redesign (owner, 2026-09-30)
assert.deepEqual(FACTORY_SETTINGS.graph, { enabled: true, extractionChunkTokens: 8192 });
assert.deepEqual(FACTORY_SETTINGS.graph, { enabled: true, rendering: true, extractionChunkTokens: 8192 });
const a = FACTORY_SETTINGS.appearance;
assert.equal(a.mode, "dark");
assert.equal(a.background, null); // the mode's own default, not a factory hex