practice fix follow-up — the picker lists EVERY birth-session group (owner ruling)
Owner escalation on deviation 1: practice availability must not
inherit a visual-rendering threshold. graphClusters() now runs
birthSessionPartition(snap.nodes) directly (same size-desc/id-asc
ordering) instead of reading the snapshot's MIN_CLUSTER_SIZE-filtered
clusters array — MIN_CLUSTER_SIZE stays a hull-drawing rule only.
Label join mirrors the snapshot's (chat title / notes path, null when
the naming record is gone). Contract doc + architecture.md sentence
corrected to match; empty-picker copy reworded ('once a session births
its first proposition' — no 3+ mechanics). Render pins: new empty line
+ a 1- and 2-proposition group listing pin. 1130/1130, tsc 0, lint 0,
build 0.
This commit is contained in:
@@ -46,6 +46,15 @@ function clusters(): GraphClusterGroup[] {
|
||||
];
|
||||
}
|
||||
|
||||
/** Small groups are listable (owner ruling: practice availability never
|
||||
* inherits the hull-drawing threshold). */
|
||||
function smallClusters(): GraphClusterGroup[] {
|
||||
return [
|
||||
{ key: "chat_2", kind: "chat", label: "One-off question", nodeIds: ["n20"], nodeCount: 1 },
|
||||
{ key: "chat_3", kind: "chat", label: "Quick exchange", nodeIds: ["n30", "n31"], nodeCount: 2 },
|
||||
];
|
||||
}
|
||||
|
||||
function stubProblem(id: string, chains: string[]): Problem {
|
||||
return { id, chains, statement: "", solution: "", rubric: "", status: "generating" };
|
||||
}
|
||||
@@ -129,6 +138,15 @@ describe("PracticeDialogBody — creation (cluster picker)", () => {
|
||||
it("an empty graph is an honest empty list", () => {
|
||||
const html = renderToStaticMarkup(<PracticeDialogBody {...base} clusters={[]} />);
|
||||
assert.ok(html.includes("No clusters yet"));
|
||||
assert.ok(html.includes("once a session births its first proposition"), "no 3+ mechanics in copy");
|
||||
});
|
||||
|
||||
it("1- and 2-proposition groups appear — no hull threshold in the picker", () => {
|
||||
const html = renderToStaticMarkup(<PracticeDialogBody {...base} clusters={smallClusters()} />);
|
||||
assert.ok(html.includes('data-testid="practice-cluster-chat_2"'), "singleton group listed");
|
||||
assert.ok(html.includes("1 propositions"));
|
||||
assert.ok(html.includes('data-testid="practice-cluster-chat_3"'), "pair group listed");
|
||||
assert.ok(html.includes("2 propositions"));
|
||||
});
|
||||
|
||||
it("empty selection (vanished nodes) renders the honest inline line", () => {
|
||||
|
||||
Reference in New Issue
Block a user