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
+39 -12
View File
@@ -4,6 +4,7 @@ import { useEffect, useMemo, useRef, useState } from "react";
import { useRouter } from "next/navigation";
import { CornerDownLeftIcon, DumbbellIcon } from "lucide-react";
import { GraphView } from "@/components/graph-view";
import { ChainsHome } from "@/components/chains-home";
import { SetupDialog } from "@/components/setup-dialog";
import { useStrongKeyless, useZeroKeys, ZeroKeysPill } from "@/components/setup-cta";
import { DictationBar, joinDictation, useDictation } from "@/components/dictation";
@@ -17,7 +18,16 @@ import type { TurnUsage } from "@/src/core";
* under the header and the new-session dock, both of which float over it
* with no gradient scrims. Sessions live in the toggleable sidebar.
*/
export function Home({ initialConfigured }: { initialConfigured: boolean }) {
export function Home({
initialConfigured,
rendering = true,
}: {
initialConfigured: boolean;
/** GRAPH RENDERING off (owner, 2026-10-06): the home's main view is
* the chains view, not the canvas. Read server-side per navigation —
* changing the setting applies on the next visit home. */
rendering?: boolean;
}) {
const router = useRouter();
const [topic, setTopic] = useState("");
/* The topic MIRROR ("nothing gets lost" round, 2026-10-01 — same
@@ -149,16 +159,28 @@ export function Home({ initialConfigured }: { initialConfigured: boolean }) {
never needs to receive events — the mask routes the pixels. */}
<div className="lh-drag absolute inset-x-0 top-0 h-13" aria-hidden="true" />
{/* Graph — the main view, full-bleed (owner, graph-view round 1): no
padding on any side; the canvas runs from the sidebar to the right
edge and from the bottom to the top, under everything else. */}
{/* The main view — full-bleed (owner, graph-view round 1): no
padding on any side; it runs from the sidebar to the right edge
and from the bottom to the top, under everything else. With
rendering OFF (graph.rendering, owner 2026-10-06) it is the
CHAINS VIEW — the same table as the overlay, in flow; data,
extraction, and the pick flow are untouched. */}
<main className="absolute inset-0">
<GraphView
chainSelectOpen={chainSelectOpen}
practiceSelection={pickedIds}
onPracticeSelectionChange={setPracticeProps}
onChainSelectClose={() => setChainSelectOpen(false)}
/>
{rendering ? (
<GraphView
chainSelectOpen={chainSelectOpen}
practiceSelection={pickedIds}
onPracticeSelectionChange={setPracticeProps}
onChainSelectClose={() => setChainSelectOpen(false)}
/>
) : (
<ChainsHome
chainSelectOpen={chainSelectOpen}
practiceSelection={pickedIds}
onPracticeSelectionChange={setPracticeProps}
onChainSelectClose={() => setChainSelectOpen(false)}
/>
)}
</main>
{/* Header floats over the graph — pointer-events-none except the
@@ -185,7 +207,10 @@ export function Home({ initialConfigured }: { initialConfigured: boolean }) {
send consumes it). Practice mode with nothing picked
shows the pick HINT so the affordance is discoverable;
teaching mode with nothing picked renders nothing. */}
{(practiceProps.length > 0 || mode === "practice") && (
{/* While PICKING in the chains home the chip row hides
(owner, 2026-10-06): the floating bar above the composer
already carries count + Clear + Done — one voice, not two. */}
{(practiceProps.length > 0 || mode === "practice") && !(rendering === false && chainSelectOpen) && (
<div className="mb-2 flex items-center justify-start gap-1.5">
<button
type="button"
@@ -201,7 +226,9 @@ export function Home({ initialConfigured }: { initialConfigured: boolean }) {
<DumbbellIcon aria-hidden="true" className="size-3.5 text-muted-foreground" />
{practiceProps.length > 0
? `${practiceProps.length} ${practiceProps.length === 1 ? "proposition" : "propositions"} selected`
: "Pick propositions from the map"}
: rendering
? "Pick propositions from the map"
: "Pick propositions"}
</button>
{practiceProps.length > 0 && (
<button