Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit 02f21812d652c06f1da3b100b9dbd733370c47d3
parent fa6f9952cbc42a7687a9d9ce5bbc9bef1ac650e8
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Thu, 29 Oct 2026 04:16:53 -0400

umtool: a module panel write that leaves render.chrome empty removes it

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Diffstat:
Mumtool/app/api/report/modules/route.ts | 2+-
Mumtool/report-to-video/modules/config-loader.test.mjs | 2+-
Mumtool/report-to-video/modules/panel.mjs | 5+++--
3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/umtool/app/api/report/modules/route.ts b/umtool/app/api/report/modules/route.ts @@ -73,7 +73,7 @@ export async function PUT(request: Request) { const enabled = typeof body.enabled === "boolean" ? body.enabled : undefined; const write = panelWrite(r.manifest as Record<string, unknown>, id, { fields, enabled }); const { result, editNotes } = await withEditNotes(r.project, async () => { - if (write.chrome) return updateChrome(r.project.dir, write.chrome, { token }); + if ("chrome" in write) return updateChrome(r.project.dir, write.chrome ?? null, { token }); return updateRender(r.project.dir, write.render ?? {}, { token }); }); return Response.json({ ok: true, token: (result as { token: string | null }).token, editNotes }, { headers: noStore }); diff --git a/umtool/report-to-video/modules/config-loader.test.mjs b/umtool/report-to-video/modules/config-loader.test.mjs @@ -165,7 +165,7 @@ test("the panel: a module's fields from its descriptor, a save as the writers ta assert.equal(intro.enabled, false); // Saves. assert.deepEqual(panelWrite(m, "pair", { fields: { position: "top", "labels.then": "2012" } }).chrome.pair, { style: "split", position: "top", labels: { then: "2012" } }); - assert.deepEqual(panelWrite(m, "pair", { enabled: false }).chrome, {}); + assert.equal(panelWrite(m, "pair", { enabled: false }).chrome, null, "a chrome left empty is removed"); assert.deepEqual(panelWrite(m, "chapter", { enabled: true }).chrome.chapter, { list: [] }); assert.deepEqual(panelWrite(m, "intro", { enabled: true, fields: { mark: "chime" } }).render, { intro: { style: "boot-dark", site: "auto", mark: "chime" } }); assert.deepEqual(panelWrite(m, "rail", { fields: { "pip.spacing": "pitch" } }).chrome.deck, { pip: { spacing: "pitch" } }); diff --git a/umtool/report-to-video/modules/panel.mjs b/umtool/report-to-video/modules/panel.mjs @@ -120,7 +120,7 @@ export function panelState(manifest, seen, problems = {}) { * @param {Record<string, any>} manifest * @param {string} id * @param {{ fields?: Record<string, unknown>, enabled?: boolean }} change - * @returns {{ chrome?: Record<string, any>, render?: Record<string, any> }} + * @returns {{ chrome?: Record<string, any> | null, render?: Record<string, any> }} */ export function panelWrite(manifest, id, { fields = {}, enabled } = {}) { const m = panelModules().find((x) => x.id === id); @@ -144,7 +144,8 @@ export function panelWrite(manifest, id, { fields = {}, enabled } = {}) { for (const [k, v] of Object.entries(fields)) next = setPath(next, rel ? `${rel}.${k}` : k, v === "" ? null : v); } if (base.startsWith("render.chrome") || m.configKey?.startsWith("render.chrome")) { - return { chrome: next.chrome ?? {} }; + // A chrome left empty is no chrome (updateChrome's null removes the key). + return { chrome: next.chrome && Object.keys(next.chrome).length ? next.chrome : null }; } // A look key (intro, blur): the patch of the top-level keys it changed. const patch = {};