Wave 6 chunk B: the embeddings surfaces — picker, re-embed gate, gray-outs, cost pill
- Settings ▸ Graph grows the embedding-model picker (graph-row-embedding-model):
GET /api/models/embeddings' live-federated BYOK catalog (re-fetched on mount
and every settings save), rows priced from EMBEDDING_PRICES ("$x.xx/1M in",
honestly "—" when unlisted), ids shown AND stored as full colon-safe slugs
(openrouter:liquid/…:free is never split), plus an Unset row writing null.
Empty catalog = nothing keyed: the trigger BECOMES the deep link to Keys
("Add a provider key first…") — and deep-links fired while the dialog is
open now actually switch sections (initialSection was read once at mount;
the body follows it now — pre-existing gap, first exercised by this link).
- Re-embed gate (owner design): picking a model that differs from the stored
one holds the write behind a confirm strip carrying the honest node count
from GET /api/graph; zero propositions skip the strip (nothing to re-embed)
and land directly. Unset never confirms — the port just stops resolving.
The copy says the re-embed runs with the next background pass (the staleness
machinery — a settings PUT alone never triggers it; no server endpoints
were added).
- Gray-out, the searchStatus precedent: with no model configured, the ladder
rungs Embedding/Clustering/Labeling dim + disable with a "Needs an
embedding model" hint (master switch stays lit), and the stats-bar
GraphContextControl swaps its slider for a dimmed deep-link button to the
Graph section. Loading never grays; every settings save re-reads (signal).
- Cost chrome: the pipeline popover grows the Embeddings stage row
(costs.stages.embedding, wave 6's folded stage — "— · 0 in / 0 out" until
runs exist, same as its siblings).
- Master's ride-along: the core-barrel ChatDeleteMode comment now says two
type-only things (it always exported both).
Gates: tsc clean, 912/912 (8 new: price lines, model-dependency predicate,
unset/set SSR dimming; 2 ladder fixtures updated to the new no-model
semantics), lint 0, build ok. Live-verified on :3001: unset deep-link →
graph section, menu pricing + colon-safety (37 options), confirm strip with
"20 propositions", Cancel keeps the record, Unset writes immediately,
in-dialog empty-catalog deep-link lands Keys, Embeddings row in the popover.
This commit is contained in:
@@ -16,6 +16,7 @@ import { TOGGLE_TOOLS, AgentSection } from "../components/settings/agent-section
|
||||
import { AppearanceSection, GraphSection } from "../components/settings/appearance-section.tsx";
|
||||
import { KeysSection } from "../components/settings/keys-section.tsx";
|
||||
import { KeyboardSection } from "../components/settings/keyboard-section.tsx";
|
||||
import type { GraphSettings } from "../src/core/index.ts";
|
||||
import { SettingsDialogBody, SettingsDialogProvider } from "../components/settings/settings-dialog.tsx";
|
||||
import { KEYBOARD_ACTIONS } from "../src/core/index.ts";
|
||||
|
||||
@@ -134,8 +135,13 @@ describe("AgentSection (thin SSR)", () => {
|
||||
});
|
||||
|
||||
describe("GraphSection — the dependency ladder", () => {
|
||||
it("defaults: all four rungs on, none disabled", () => {
|
||||
const html = renderToStaticMarkup(<GraphSection graph={undefined} onSectionChange={() => {}} />);
|
||||
// Wave 6: without an embedding model the three dependent rungs are
|
||||
// inert (dimmed, disabled, hinted) — pinned in embedding-settings.
|
||||
// These ladder pins isolate the CHAIN logic with a model configured.
|
||||
const MODEL: GraphSettings = { enabled: true, embeddingModel: "openai:text-embedding-3-small" };
|
||||
|
||||
it("defaults with a model set: all four rungs on, none disabled", () => {
|
||||
const html = renderToStaticMarkup(<GraphSection graph={MODEL} onSectionChange={() => {}} />);
|
||||
for (const key of ["enabled", "embedding", "clustering", "labeling"]) {
|
||||
assert.ok(html.includes(`data-testid="graph-row-${key}"`), key);
|
||||
assert.ok(!tagOf(html, `toggle-graph-${key}`).includes("disabled"), `${key} touchable`);
|
||||
@@ -144,7 +150,7 @@ describe("GraphSection — the dependency ladder", () => {
|
||||
|
||||
it("master off grays EVERY dependent (stored values persist, resolve inert)", () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<GraphSection graph={{ enabled: false, embedding: true, clustering: true, labeling: true }} onSectionChange={() => {}} />,
|
||||
<GraphSection graph={{ ...MODEL, enabled: false, embedding: true, clustering: true, labeling: true }} onSectionChange={() => {}} />,
|
||||
);
|
||||
for (const key of ["embedding", "clustering", "labeling"]) {
|
||||
assert.ok(tagOf(html, `toggle-graph-${key}`).includes("disabled"), `${key} disabled`);
|
||||
@@ -154,7 +160,7 @@ describe("GraphSection — the dependency ladder", () => {
|
||||
|
||||
it("a mid-ladder break grays only what's below it", () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<GraphSection graph={{ enabled: true, embedding: true, clustering: false }} onSectionChange={() => {}} />,
|
||||
<GraphSection graph={{ ...MODEL, embedding: true, clustering: false }} onSectionChange={() => {}} />,
|
||||
);
|
||||
assert.ok(!tagOf(html, "toggle-graph-embedding").includes("disabled"), "embedding touchable");
|
||||
assert.ok(!tagOf(html, "toggle-graph-clustering").includes("disabled"), "clustering touchable");
|
||||
|
||||
Reference in New Issue
Block a user