ui: rename learner-facing 'knowledge context' copy to 'graph context' (components + render tests)

This commit is contained in:
amosblomqvist
2026-09-18 18:03:25 +03:00
parent 4f83fd4827
commit cbecb8df03
7 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -329,7 +329,7 @@ function ActivityBlobRow({
: blob.jobKind === "visual" : blob.jobKind === "visual"
? "Figure maker" ? "Figure maker"
: blob.jobKind === "graph-context" : blob.jobKind === "graph-context"
? "Knowledge context" ? "Graph context"
: "Sub-agent"; : "Sub-agent";
return ( return (
<div <div
+1 -1
View File
@@ -23,7 +23,7 @@ const KIND_LABEL: Record<JobKind, string> = {
visual: "Figure agent", visual: "Figure agent",
// The injection is server-initiated — it has no tool part, so never a // The injection is server-initiated — it has no tool part, so never a
// dispatch card. The entry exists only for the exhaustive record. // dispatch card. The entry exists only for the exhaustive record.
"graph-context": "Knowledge context", "graph-context": "Graph context",
}; };
export function DispatchCard({ toolCallId, kind }: { toolCallId: string; kind: JobKind }) { export function DispatchCard({ toolCallId, kind }: { toolCallId: string; kind: JobKind }) {
+1 -1
View File
@@ -45,7 +45,7 @@ export function GraphContextControl({
return ( return (
<div data-testid={testId} className="flex items-center gap-2 text-xs text-muted-foreground"> <div data-testid={testId} className="flex items-center gap-2 text-xs text-muted-foreground">
<BookOpenIcon className="size-3 shrink-0" /> <BookOpenIcon className="size-3 shrink-0" />
<span className="shrink-0">Knowledge context</span> <span className="shrink-0">Graph context</span>
<input <input
type="range" type="range"
min={0} min={0}
+2 -2
View File
@@ -47,8 +47,8 @@ export function GraphContextMarker({
}, [open]); }, [open]);
const summary = data const summary = data
? `Knowledge context — ~${formatTokens(data.tokens)} · ${data.propositions.length} propositions` ? `Graph context — ~${formatTokens(data.tokens)} · ${data.propositions.length} propositions`
: "Knowledge context"; : "Graph context";
return ( return (
<div ref={ref} data-testid={testId} className="relative flex items-center justify-center py-1"> <div ref={ref} data-testid={testId} className="relative flex items-center justify-center py-1">
+2 -2
View File
@@ -152,14 +152,14 @@ describe("activity section render", () => {
assert.match(html, /activity-total-cost[^>]*>—</); assert.match(html, /activity-total-cost[^>]*>—</);
}); });
it("renders a graph-context job as 'Knowledge context' — the dock's fourth kind", () => { it("renders a graph-context job as 'Graph context' — the dock's fourth kind", () => {
const html = renderToStaticMarkup( const html = renderToStaticMarkup(
<ActivitySection <ActivitySection
feed={{ jobs: [job({ id: "jctx", kind: "graph-context", activity: "selecting propositions", title: "Water cycle" })], extractions: [] }} feed={{ jobs: [job({ id: "jctx", kind: "graph-context", activity: "selecting propositions", title: "Water cycle" })], extractions: [] }}
/>, />,
); );
assert.match(html, /data-testid="activity-blob-job"/); assert.match(html, /data-testid="activity-blob-job"/);
assert.match(html, /Knowledge context/); assert.match(html, /Graph context/);
assert.match(html, /selecting propositions/); assert.match(html, /selecting propositions/);
assert.match(html, /data-testid="activity-abort"/, "END kills the injection like any job"); assert.match(html, /data-testid="activity-abort"/, "END kills the injection like any job");
}); });
+3 -3
View File
@@ -27,7 +27,7 @@ function markerMessage(): TeacherUIMessage {
describe("GraphContextMarker", () => { describe("GraphContextMarker", () => {
it("renders the quiet summary line with token + proposition counts", () => { it("renders the quiet summary line with token + proposition counts", () => {
const html = renderToStaticMarkup(<GraphContextMarker message={markerMessage()} />); const html = renderToStaticMarkup(<GraphContextMarker message={markerMessage()} />);
assert.ok(html.includes("Knowledge context — ~537")); assert.ok(html.includes("Graph context — ~537"));
assert.ok(html.includes("3 propositions")); assert.ok(html.includes("3 propositions"));
assert.ok(html.includes('data-testid="graph-context"')); assert.ok(html.includes('data-testid="graph-context"'));
assert.ok(html.includes("<button"), "the line is clickable"); assert.ok(html.includes("<button"), "the line is clickable");
@@ -37,8 +37,8 @@ describe("GraphContextMarker", () => {
const html = renderToStaticMarkup( const html = renderToStaticMarkup(
<GraphContextMarker message={{ parts: [{ type: "data-graph-context", data: { nope: true } }] }} />, <GraphContextMarker message={{ parts: [{ type: "data-graph-context", data: { nope: true } }] }} />,
); );
assert.ok(html.includes("Knowledge context</")); assert.ok(html.includes("Graph context</"));
assert.ok(!html.includes("Knowledge context —"), "no counts on a malformed part"); assert.ok(!html.includes("Graph context —"), "no counts on a malformed part");
}); });
}); });
+1 -1
View File
@@ -109,7 +109,7 @@ describe("DraftShell — the sessionless surface", () => {
// The readout: "tok" abbreviated, but the FULL number (owner, 2026-09-15: // The readout: "tok" abbreviated, but the FULL number (owner, 2026-09-15:
// no k-rounding — 1024 reads as 1024). // no k-rounding — 1024 reads as 1024).
assert.ok(html.includes("1024 tok"), "the readout shows the default budget, not 0 — default is ON"); assert.ok(html.includes("1024 tok"), "the readout shows the default budget, not 0 — default is ON");
assert.ok(html.includes("Knowledge context"), "the control is labeled"); assert.ok(html.includes("Graph context"), "the control is labeled");
// Absent settings render the default — never 'off'. // Absent settings render the default — never 'off'.
assert.ok(!html.includes(">off<")); assert.ok(!html.includes(">off<"));
}); });