Files
olivv-cs-ComfyUI-FunPack/app/shell/layout.js
T
digital-garbage 835fab7864 core+shell: the bridge, and the first module through it
One declaration does three jobs: renders the panel, carries the defaults, names
the values that come back. A module writes no DOM and reads no DOM.

Validation refuses rather than repairs -- unknown type, a renderer its type does
not have, a label that is not text, a default outside its own bounds, a when
naming a key the module never declared. A module that is wrong does not get a
best-effort panel; it does not load, and says why once.

Ordering is by declared relation and stage, never priority numbers, and a cycle
drops only the modules in it. Compatibility is by trait, never model name.

The shell hands a module { composer, values, on, shell } and nothing else: no
node, no document, no kit internals. It cannot style anything because it is
never given anything that could.

catalogue/hide.html puts one good module and five broken ones through the real
shell and shows the result: one panel, five absent, no placeholders. The lint
fixtures make the scanner prove it catches each rule, so a clean scan means
something.

First slice: modules/system/appearance. Two settings, an optional ui.js, and
clicking Light actually turns the app light.
2026-08-28 19:58:06 +03:00

36 lines
1.2 KiB
JavaScript

// The app's regions, and the mount points each one offers.
//
// A region declares what it can host. Core never learns these names, and no
// list of them exists anywhere else -- a module asks for one by name, and gets
// it or does not.
import { composer } from "../composer/composer.js";
import { offer } from "./mounts.js";
export function build(root) {
const general = composer.panel.default({
title: "Settings",
body: composer.hint.default({ text: "Modules that announced a settings.general mount point." }),
});
const generation = composer.panel.default({
title: "Generation",
body: composer.hint.default({ text: "Modules that announced a generation.* mount point." }),
});
const page = composer.splitPane.h({
size: 46,
label: "Settings and generation",
panes: [general, generation],
});
root.replaceChildren(page.node);
// The mount point IS the contract with modules; the region behind it can be
// rearranged freely as long as the name survives.
offer("settings.general", general.body);
offer("generation.timing", generation.body);
offer("generation.model", generation.body);
return { general, generation, page };
}