Files
museion/ref/prototypes/wf130-settings-ui-prototype.html

469 lines
25 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Museion — Settings page prototype (#130)</title>
<style>
/* PROTOTYPE #130 — throwaway. What should the Settings page look like once it
gains provider keys + per-surface models? Three structurally different
variants, ?variant=A|B|C, bottom bar cycles.
Grounded in: #126 (3 surfaces, per-surface config = profile model: block,
keys fan out to profiles' .env), #128 (dropdowns from hermes registry cache
+ free text; effort per provider), #131 (no Keychain, no engine selector),
#132 (claude-sonnet-5-5 seeds all three, GLM posture = low). */
:root {
--bg: #FAF9F3; /* #89 calibrated chrome color */
--surface: #FFFEFB; /* #89 calibrated page color */
--fg: #1a1916;
--muted: #6b6964;
--border: #e8e5df;
--accent: #c96442;
--fg-soft: rgba(26,25,22,.06);
--font-display: 'Iowan Old Style', Charter, Georgia, serif;
--font-body: -apple-system, system-ui, sans-serif;
--font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
--radius: 10px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 13px/1.45 var(--font-body); color: var(--fg); background: var(--bg);
display: flex; overflow: hidden; }
.rail { width: 56px; flex: none; border-right: 1px solid var(--border);
display: flex; flex-direction: column; align-items: center; padding: 8px 0; gap: 2px; }
.rail-btn { width: 44px; height: 44px; display: grid; place-items: center;
border: none; border-radius: var(--radius); background: transparent;
color: var(--muted); cursor: pointer; }
.rail-btn:hover { background: var(--fg-soft); color: var(--fg); }
.rail-btn.current { background: var(--surface); color: var(--fg); box-shadow: inset 2px 0 0 var(--accent); }
.rail-spacer { flex: 1; }
svg { width: 20px; height: 20px; }
.pane { flex: 1; overflow-y: auto; }
.pane-head { min-height: 52px; display: flex; align-items: center;
justify-content: space-between; gap: 10px; padding: 0 24px;
border-bottom: 1px solid var(--border); background: var(--bg); }
.pane-head h2 { font: 600 15px/1 var(--font-display); margin: 0; }
.section-label { padding: 22px 0 8px; color: var(--muted);
font: 11px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.note { color: var(--muted); font-size: 11.5px; }
.note.mono { font: 11px var(--font-mono); }
.chip { display: inline-block; padding: 2px 7px; border: 1px solid var(--border);
border-radius: 6px; font: 11px var(--font-mono); color: var(--muted);
background: var(--surface); white-space: nowrap; }
.chip.accent { color: var(--accent); border-color: rgba(201,100,66,.35); }
.ok { color: #3d7a4e; }
.err { color: var(--accent); }
/* form controls — one shared voice across variants (layouts differ, parts don't) */
input[type=text], input[type=password], select {
font: 12.5px var(--font-body); color: var(--fg); background: var(--surface);
border: 1px solid var(--border); border-radius: 7px; padding: 5px 8px; }
input:focus, select:focus { outline: 2px solid rgba(201,100,66,.35); outline-offset: 0; }
select { cursor: pointer; }
input.mono { font: 11.5px var(--font-mono); }
.btn { font: 11.5px var(--font-body); padding: 5px 11px; border-radius: 7px;
border: 1px solid var(--border); background: var(--surface); cursor: pointer;
color: var(--fg); }
.btn:hover { border-color: var(--muted); }
.btn.small { font: 11px var(--font-mono); padding: 3px 9px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 7px;
overflow: hidden; background: var(--surface); }
.seg button { font: 11.5px var(--font-body); padding: 4px 10px; border: none;
background: transparent; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--fg); color: var(--bg); }
.field-label { font: 10.5px var(--font-mono); letter-spacing: .05em; text-transform: uppercase;
color: var(--muted); display: block; margin-bottom: 3px; }
/* ============ shared block parts (A ledger + C keys page both use them) ============ */
.block { border: 1px solid var(--border); border-radius: var(--radius);
background: var(--surface); padding: 14px 16px; margin-bottom: 10px; }
.block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.block-head h3 { font: 600 14px/1 var(--font-display); margin: 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.grid .wide { grid-column: 1 / -1; }
.test-line { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
/* ============ Variant A: providers-first ledger (single scroll) ============ */
.vA .doc { max-width: 680px; padding: 0 24px 48px; }
.vA .surface-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 14px;
align-items: center; border: 1px solid var(--border); border-radius: var(--radius);
background: var(--surface); padding: 12px 16px; margin-bottom: 10px; }
.vA .surface-name { font: 600 14px/1.2 var(--font-display); }
.vA .surface-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vA .surface-meta { text-align: right; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
/* ============ Variant B: surface cards first, keys tucked below ============ */
.vB .doc { max-width: 720px; padding: 0 24px 48px; }
.vB .card { border: 1px solid var(--border); border-radius: var(--radius);
background: var(--surface); padding: 16px 18px; margin-bottom: 12px; }
.vB .card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.vB .card-head h3 { font: 600 17px/1 var(--font-display); margin: 0; }
.vB .current { font: 12.5px var(--font-mono); color: var(--accent); margin: 0 0 12px; }
.vB .row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.vB .keys { border-top: 1px solid var(--border); margin-top: 26px; padding-top: 4px; }
.vB details { border: 1px solid var(--border); border-radius: var(--radius);
background: var(--surface); margin-bottom: 8px; }
.vB summary { padding: 10px 14px; cursor: pointer; font: 12px var(--font-mono);
color: var(--muted); display: flex; gap: 12px; align-items: center; list-style: none; }
.vB summary::before { content: '▸'; transition: transform .1s; }
.vB details[open] summary::before { transform: rotate(90deg); }
.vB summary .prov { color: var(--fg); font-weight: 600; }
.vB details .inner { padding: 0 14px 14px; }
/* ============ Variant C: sidebar + detail (System Settings shape) ============ */
.vC { display: flex; height: 100%; }
.vC .side { width: 190px; flex: none; border-right: 1px solid var(--border);
padding: 14px 8px; background: var(--bg); }
.vC .side-button { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
border: none; border-radius: 8px; background: transparent; color: var(--fg);
font: 13px var(--font-body); padding: 7px 10px; cursor: pointer; margin-bottom: 2px; }
.vC .side-button:hover { background: var(--fg-soft); }
.vC .side-button.current { background: var(--surface); box-shadow: inset 2px 0 0 var(--accent); }
.vC .side-button .k { font: 10px var(--font-mono); color: var(--muted); margin-left: auto; }
.vC .detail { flex: 1; overflow-y: auto; padding: 18px 26px 48px; }
.vC .detail h3 { font: 600 16px/1 var(--font-display); margin: 0 0 4px; }
.vC .detail .sub { color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.vC .form { max-width: 480px; display: flex; flex-direction: column; gap: 14px; }
.vC .frow { display: flex; flex-direction: column; gap: 4px; }
.vC .frow-inline { display: flex; gap: 8px; align-items: center; }
/* ============ shared: home row (existing pane content, #17) ============ */
.home-row { display: flex; align-items: center; gap: 10px; max-width: 680px;
border: 1px solid var(--border); border-radius: var(--radius);
background: var(--surface); padding: 12px 16px; }
.home-row code { font: 12px var(--font-mono); }
/* ============ floating variant switcher ============ */
#switcher { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
display: flex; align-items: center; gap: 10px; padding: 8px 12px;
background: #1a1916; color: #faf9f3; border-radius: 999px;
box-shadow: 0 6px 24px rgba(0,0,0,.25); font: 12px var(--font-mono); z-index: 99;
user-select: none; }
#switcher button { background: none; border: none; color: inherit; font: inherit;
cursor: pointer; padding: 4px 8px; border-radius: 6px; }
#switcher button:hover { background: rgba(255,255,255,.15); }
</style>
</head>
<body>
<nav class="rail" aria-label="Navigation">
<button class="rail-btn" title="Posts" onclick="railNote()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M4 19.5V6a2 2 0 0 1 2-2h11a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a2 2 0 0 1-2-2zm0 0a2 2 0 0 0 2 2h12"/></svg>
</button>
<button class="rail-btn" title="Sessions" onclick="railNote()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M21 12a9 9 0 1 1-2.64-6.36M21 3v6h-6"/></svg>
</button>
<button class="rail-btn" title="Learnings" onclick="railNote()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M12 3 2 8l10 5 10-5-10-5zM6 10.5V16c0 1.5 2.7 3 6 3s6-1.5 6-3v-5.5"/></svg>
</button>
<span class="rail-spacer"></span>
<button class="rail-btn" title="Archive" onclick="railNote()">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><path d="M3 8h18v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8zm2 0V6a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v2M10 12h4"/></svg>
</button>
<button class="rail-btn current" title="Settings">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 0 0 .34 1.87l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.7 1.7 0 0 0-1.87-.34 1.7 1.7 0 0 0-1 1.56V21a2 2 0 1 1-4 0v-.07a1.7 1.7 0 0 0-1-1.56 1.7 1.7 0 0 0-1.87.34l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.7 1.7 0 0 0 .34-1.87 1.7 1.7 0 0 0-1.56-1H3a2 2 0 1 1 0-4h.07a1.7 1.7 0 0 0 1.56-1 1.7 1.7 0 0 0-.34-1.87l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.7 1.7 0 0 0 1.87.34h0a1.7 1.7 0 0 0 1-1.56V3a2 2 0 1 1 4 0v.07a1.7 1.7 0 0 0 1 1.56 1.7 1.7 0 0 0 1.87-.34l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.7 1.7 0 0 0-.34 1.87v0a1.7 1.7 0 0 0 1.56 1H21a2 2 0 1 1 0 4h-.07a1.7 1.7 0 0 0-1.56 1z"/></svg>
</button>
</nav>
<main class="pane">
<div class="pane-head"><h2>Settings</h2><span class="note mono" id="head-note"></span></div>
<div id="content" style="padding:0 24px 80px;"></div>
</main>
<div id="switcher">
<button onclick="cycle(-1)" aria-label="Previous variant">←</button>
<span id="variant-label"></span>
<button onclick="cycle(1)" aria-label="Next variant">→</button>
</div>
<script>
'use strict';
/* Mocked state — shapes grounded in the map's closed tickets. Registry lists
are the real ~/.hermes/provider_models_cache.json ids (subset). Note
claude-sonnet-5-5 (#132's seed) is NOT in the cache — that's live: the
dropdown must carry free text, seeded value shows as custom. */
const REGISTRY = {
zai: ['glm-4.5','glm-4.6','glm-4.7','glm-5','glm-5-turbo','glm-5.1','glm-5.2','glm-5.3','glm-5.3-flash','glm-5.3-flashx'],
anthropic: ['claude-fable-5.1','claude-fable-5','claude-opus-5-5','claude-opus-5','claude-sonnet-5','claude-opus-4-8','claude-opus-4-7','claude-sonnet-4-6'],
openai: ['gpt-5.6-sol','gpt-5.6-terra','gpt-5.6-luna','gpt-5.5','gpt-5.5-pro','gpt-5.4','gpt-5.4-mini','gpt-5.4-nano'],
};
const EFFORTS = { // #128 amendment: all three providers, one model.reasoning_effort key
zai: ['low','high','max'],
openai: ['low','medium','high','xhigh','max'],
anthropic: ['low','medium','high','xhigh','max'],
};
const PROVIDERS = {
zai: { label:'z.ai', endpoint:'https://api.z.ai/api/paas/v4', coding:'https://api.z.ai/api/coding/paas/v4',
keyType:'standard', key:'sk-Kj3…a3f2', reveal:false, test:null },
anthropic:{ label:'Anthropic', endpoint:'https://api.anthropic.com',
key:'sk-ant-Qp8…9d41', reveal:false, test:null },
openai: { label:'OpenAI', endpoint:'https://api.openai.com/v1',
key:'sk-Tz2…7c0e', reveal:false, test:null },
};
const SURFACES = [ // #126: 3 surfaces; #132: sonnet-5-5 seeds all three, effort unset
{ id:'pass1', label:'Pass 1', profile:'museion-pass1', provider:'anthropic',
model:'claude-sonnet-5-5', custom:true, effort:'unset',
note:'applies on the next pass' },
{ id:'pass2', label:'Pass 2', profile:'museion-pass2', provider:'anthropic',
model:'claude-sonnet-5-5', custom:true, effort:'unset',
note:'applies on the next pass' },
{ id:'chat', label:'Chat', profile:'museion', provider:'anthropic',
model:'claude-sonnet-5-5', custom:true, effort:'unset',
note:'Sessions rides this engine · a model change restarts it (after any streaming turn)' },
];
const EFFORT_UNSET = 'unset · provider default';
const VARIANTS = { A: 'Providers-first ledger', B: 'Surface cards · keys below', C: 'Sidebar + detail' };
const page = { C: 'pass1' }; // variant C's selected sidebar page
/* ---------- shared part renderers (parts shared, layouts differ) ---------- */
function endpointField(pid) {
const p = PROVIDERS[pid];
const ep = pid === 'zai' && p.keyType === 'coding' ? p.coding : p.endpoint;
return `<input type="text" class="mono" style="width:100%" value="${ep}" onchange="setEndpoint('${pid}', this.value)">`;
}
function keyField(pid) {
const p = PROVIDERS[pid];
return `<input type="${p.reveal ? 'text' : 'password'}" class="mono" style="width:100%" value="${p.key}"
onchange="setKey('${pid}', this.value)">
<button class="btn small" onclick="toggleReveal('${pid}')">${p.reveal ? 'hide' : 'show'}</button>`;
}
function zaiToggle() {
const p = PROVIDERS.zai;
return `<div class="seg" role="group" aria-label="z.ai key type">
<button class="${p.keyType==='standard'?'on':''}" onclick="setKeyType('standard')">Standard (pay-as-you-go)</button>
<button class="${p.keyType==='coding'?'on':''}" onclick="setKeyType('coding')">Coding plan</button>
</div>`;
}
function testLine(pid) {
const p = PROVIDERS[pid];
let out = '<span class="note mono"></span>';
if (p.test === 'busy') out = '<span class="note mono">testing…</span>';
else if (p.test) out = `<span class="note mono ok">${p.test.ms} ms · ${p.test.n} models reachable</span>`;
return `<div class="test-line"><button class="btn small" onclick="testConn('${pid}', this)">Test Connection</button>${out}</div>`;
}
function providerBlock(pid) {
const p = PROVIDERS[pid];
return `<div class="block">
<div class="block-head"><h3>${p.label}</h3>
${pid==='zai' ? zaiToggle() : ''}</div>
<div class="grid">
<div class="wide"><span class="field-label">Endpoint (base URL)</span>${endpointField(pid)}</div>
<div class="wide"><span class="field-label">API key → writes this provider's profiles' .env</span>
<div style="display:flex;gap:6px">${keyField(pid)}</div></div>
</div>
${testLine(pid)}
${pid==='zai' ? '<div class="note" style="margin-top:6px">Key type picks the endpoint family — coding-plan keys are distribution-restricted; shipped Museion uses standard keys (#127).</div>' : ''}
</div>`;
}
function modelPicker(s, width) {
if (s.custom) {
return `<span style="display:inline-flex;gap:4px;align-items:center">
<input type="text" class="mono" style="width:${width||170}px" value="${s.model}" onchange="setModel('${s.id}', this.value)">
<button class="btn small" title="back to registry list" onclick="uncustom('${s.id}')">↩</button>
</span>`;
}
const opts = REGISTRY[s.provider].map(m =>
`<option value="${m}" ${m===s.model?'selected':''}>${m}</option>`).join('');
return `<select style="width:${width||190}px" onchange="pickModel('${s.id}', this.value)">
${opts}<option value="__custom">Custom…</option></select>`;
}
function effortPicker(s) {
const opts = ['unset', ...EFFORTS[s.provider]].map(e =>
`<option value="${e}" ${e===s.effort?'selected':''}>${e==='unset'?EFFORT_UNSET:e}</option>`).join('');
return `<select onchange="setEffort('${s.id}', this.value)" title="model.reasoning_effort — hermes clamps per route (#128)">${opts}</select>`;
}
function providerSelect(s) {
const opts = Object.entries(PROVIDERS).map(([id,p]) =>
`<option value="${id}" ${id===s.provider?'selected':''}>${p.label}</option>`).join('');
return `<select onchange="setSurfaceProvider('${s.id}', this.value)">${opts}</select>`;
}
function modelLine(s) {
const inReg = REGISTRY[s.provider].includes(s.model);
return `<span class="note mono">${s.model}${inReg ? '' : ' · custom (not in registry)'}</span>`;
}
function homeSection() {
return `<div class="section-label">Content</div>
<div class="home-row" style="max-width:none">
<code>/Users/alex/Documents/Museion</code>
<span style="flex:1"></span>
<button class="btn">Choose…</button>
</div>
<div class="note" style="margin-top:6px">Repoint-only: Museion never moves content. (existing pane section, #17)</div>`;
}
/* ---------- state mutators (re-render current variant) ---------- */
function setEndpoint(pid, v) { PROVIDERS[pid].endpoint = v; }
function setKey(pid, v) { PROVIDERS[pid].key = v; }
function toggleReveal(pid) { PROVIDERS[pid].reveal = !PROVIDERS[pid].reveal; render(); }
function setKeyType(t) {
PROVIDERS.zai.keyType = t;
// swapping families: the old key likely mismatches — show the trap (#127 §1.6)
PROVIDERS.zai.test = null; render();
}
function testConn(pid, btn) {
PROVIDERS[pid].test = 'busy'; render();
setTimeout(() => {
PROVIDERS[pid].test = { ms: 240 + Math.floor(Math.random()*560), n: REGISTRY[pid].length + 3 };
render();
}, 650 + Math.random()*450);
}
function setSurfaceProvider(sid, pid) {
const s = SURFACES.find(x => x.id === sid);
s.provider = pid; s.effort = 'unset';
s.model = pid === 'zai' ? 'glm-5.3' : pid === 'openai' ? 'gpt-5.6-sol' : 'claude-sonnet-5';
s.custom = !REGISTRY[pid].includes(s.model);
render();
}
function pickModel(sid, v) {
const s = SURFACES.find(x => x.id === sid);
if (v === '__custom') { s.custom = true; render(); return; }
s.model = v; s.custom = false; render();
}
function setModel(sid, v) { const s = SURFACES.find(x => x.id === sid); if (v.trim()) { s.model = v.trim(); s.custom = true; } render(); }
function uncustom(sid) {
const s = SURFACES.find(x => x.id === sid);
s.custom = false; s.model = REGISTRY[s.provider][0]; render();
}
function setEffort(sid, v) { SURFACES.find(x => x.id === sid).effort = v; render(); }
function setCPage(p) { page.C = p; render(); }
/* ---------- variants ---------- */
function renderA() {
return `<div class="vA"><div class="doc">
${homeSection()}
<div class="section-label">Providers — keys & endpoints</div>
<div class="note" style="margin-bottom:10px">Keys live in each profile's <code>.env</code> — no Keychain (#131). One key per provider fans out to every profile on that provider.</div>
${providerBlock('zai')}${providerBlock('anthropic')}${providerBlock('openai')}
<div class="section-label">Surfaces — model per pass</div>
<div class="note" style="margin-bottom:10px">Three surfaces in v1; Sessions rides Chat (#126). Writes go to the profile's <code>model:</code> block via <code>hermes config set</code>. Output budget is fixed at 24k — not a setting (#128).</div>
${SURFACES.map(s => `
<div class="surface-row">
<div><div class="surface-name">${s.label}</div><div class="note mono" style="margin-top:4px">profile · ${s.profile}</div></div>
<div class="surface-controls">${providerSelect(s)} ${modelPicker(s)} ${effortPicker(s)} ${modelLine(s)}</div>
<div class="surface-meta"><span class="chip accent">${s.effort === 'unset' ? 'effort unset' : 'effort ' + s.effort}</span>
<span class="note mono" style="max-width:220px;text-align:right">${s.note}</span></div>
</div>`).join('')}
</div></div>`;
}
function renderB() {
const keys = Object.entries(PROVIDERS).map(([pid, p]) => `
<details ${pid==='zai' ? '' : ''}>
<summary><span class="prov">${p.label}</span>
<span>${'•'.repeat(4)}${p.key.slice(-4)}</span>
<span>${(pid==='zai' && p.keyType==='coding' ? p.coding : p.endpoint).replace('https://','')}</span>
<span style="margin-left:auto">${p.test ? `<span class="ok">${p.test.ms} ms</span>` : 'Test Connection ▸'}</span></summary>
<div class="inner">${pid==='zai' ? zaiToggle() + '<div style="height:8px"></div>' : ''}
<span class="field-label">Endpoint</span>${endpointField(pid)}
<div style="height:8px"></div>
<span class="field-label">API key → profiles' .env</span>
<div style="display:flex;gap:6px">${keyField(pid)}</div>
<div style="height:6px"></div>${testLine(pid)}
</div>
</details>`).join('');
return `<div class="vB"><div class="doc">
${homeSection()}
<div class="section-label">Surfaces — pick each pass's mind</div>
${SURFACES.map(s => `
<div class="card">
<div class="card-head"><h3>${s.label}</h3><span class="chip">profile · ${s.profile}</span></div>
<p class="current">${s.model}${REGISTRY[s.provider].includes(s.model) ? '' : ' · custom (not in registry)'}</p>
<div class="row">
<div><span class="field-label">Provider</span>${providerSelect(s)}</div>
<div><span class="field-label">Model</span>${modelPicker(s, 200)}</div>
<div><span class="field-label">Reasoning effort</span>${effortPicker(s)}</div>
</div>
<div class="note mono" style="margin-top:10px">${s.note} · effort ${s.effort === 'unset' ? 'unset (provider default)' : s.effort}</div>
</div>`).join('')}
<div class="keys">
<div class="section-label">Provider keys & endpoints</div>
<div class="note" style="margin-bottom:10px">Keys fan out to every profile on that provider's <code>.env</code> — no Keychain (#131).</div>
${keys}
</div>
</div></div>`;
}
function renderC() {
const items = [
{ id:'content', label:'Content', k:'' },
{ id:'pass1', label:'Pass 1', k:'P1' },
{ id:'pass2', label:'Pass 2', k:'P2' },
{ id:'chat', label:'Chat', k:'· Sessions' },
{ id:'keys', label:'Provider Keys', k:'' },
];
const side = items.map(i => `
<button class="side-button ${page.C===i.id?'current':''}" onclick="setCPage('${i.id}')">
${i.label}${i.k ? `<span class="k">${i.k}</span>` : ''}</button>`).join('');
let detail = '';
if (page.C === 'content') {
detail = `<h3>Content</h3><div class="sub">Where the corpus lives.</div>
<div class="form"><div class="frow"><span class="field-label">Museion Home</span>
<div class="frow-inline"><input type="text" class="mono" style="flex:1" value="/Users/alex/Documents/Museion" readonly>
<button class="btn">Choose…</button></div>
<span class="note">Repoint-only: Museion never moves content. (#17)</span></div></div>`;
} else if (page.C === 'keys') {
detail = `<h3>Provider Keys</h3><div class="sub">One key per provider, fanned out to every profile on it. No Keychain (#131).</div>
${providerBlock('zai')}${providerBlock('anthropic')}${providerBlock('openai')}`;
} else {
const s = SURFACES.find(x => x.id === page.C);
detail = `<h3>${s.label}</h3>
<div class="sub mono">profile · ${s.profile} — ${s.note}</div>
<div class="form">
<div class="frow"><span class="field-label">Provider</span>${providerSelect(s)}</div>
<div class="frow"><span class="field-label">Model — hermes registry + free text (#128)</span>
<div class="frow-inline">${modelPicker(s, 240)} ${modelLine(s)}</div></div>
<div class="frow"><span class="field-label">Reasoning effort — one model.reasoning_effort key, hermes clamps per route</span>
${effortPicker(s)}</div>
<div class="note">Output budget fixed at 24k tokens (<code>extra_body.max_tokens</code>) — not a setting (#128).</div>
</div>`;
}
return `<div class="vC" style="height:calc(100vh - 52px)">
<div class="side">${side}</div>
<div class="detail">${detail}</div>
</div>`;
}
/* ---------- shell ---------- */
const RENDER = { A: renderA, B: renderB, C: renderC };
const NOTES = {
A: 'one scroll · providers lead · surfaces ledger',
B: 'surfaces are the heroes · keys collapsed below',
C: 'System Settings shape · sidebar picks the page',
};
function render() {
const v = new URLSearchParams(location.search).get('variant') || 'A';
const host = document.getElementById('content');
host.className = '';
if (v === 'C') { host.style.padding = '0'; host.innerHTML = RENDER[v](); }
else { host.style.padding = ''; host.innerHTML = RENDER[v](); }
document.getElementById('variant-label').textContent = `${v} — ${VARIANTS[v]}`;
document.getElementById('head-note').textContent = NOTES[v];
}
function apply(v, push) {
const u = new URL(location); u.searchParams.set('variant', v);
history.replaceState(null, '', u); render();
}
function cycle(dir) {
const keys = Object.keys(VARIANTS);
const cur = new URLSearchParams(location.search).get('variant') || 'A';
apply(keys[(keys.indexOf(cur) + dir + keys.length) % keys.length], true);
}
document.addEventListener('keydown', e => {
if (/input|textarea|select/i.test(e.target.tagName) || e.target.isContentEditable) return;
if (e.key === 'ArrowLeft') cycle(-1);
if (e.key === 'ArrowRight') cycle(1);
});
function railNote() {} // other rail destinations — unchanged by this prototype
render();
</script>
</body>
</html>