ADR-0016: Business mockups become a served app template
Status: Active · Date: 2026-07-24
References
- App Template (Served Mockups) — Delivery Notes — what changed and how it was proven
- ADR-0010: Trust-tiered pane controls — the pane-control system the old
file://mockups plugged into; this ADR removes the mockup-specific branch of it - ADR-0013: Business themes export ui-variables, Business Themes & Mockups — the reference views being extracted
- tranquil-app-template — the new repo
Context
main-view.html (a list + editor “record” view) and properties.html (a
properties/relationships detail panel) lived inside tranquil-automations at mockups/, loaded as file:// URLs and auto-opened on startup by host wiring
(lib/mockups.js opened them into the center + right dock and drove live theme sync; lib/mockup-controls.js registered URL-matched pane controls; activation trusted the mockups/ dir over tranquil-rpc). Because apm bundles a package’s whole directory, these
pages shipped implicitly in every automations release.
That coupling is wrong for what these pages actually are: not automations chrome, but the seed pattern for future Tranquil “apps” — CRUD or otherwise — that drive automations
and operations. They should be a thing you build from, developed and served on their
own, not static file:// fixtures baked into an unrelated package and force-opened at
launch.
Decision
Extract the two pages (plus mockup.css + fonts/) into a standalone tranquil-app-template repo,
serve them over http with live reload via browser-sync run under Deno, and open them
into Tranquil’s center + right panes with a small automation shipped in the template. Remove
the mockup machinery from tranquil-automations entirely.
- Serving.
deno task devrunsnpm:browser-syncto serveapp/onhttp://localhost:3000with live reload. Deno executes the npm CLI directly via itsnpm:compatibility specifier — nopackage.json, nonode_moduleschecked in;deno.lockis the only committed lockfile. - Opening.
automations/open-app.js— a tranquil-automations script, not a Deno script — runs in Tranquil’s renderer sandbox (which injects theatomglobal) and callsatom.workspace.opento putmain-view.htmlin the center andproperties.htmlin the right dock (hideURLBar,allowedLocations/defaultLocation), settingdata-themeonce to match the current UI theme. - Removal. Delete
mockups/,lib/mockups.js,lib/mockup-controls.js, theshowBusinessMockupsconfig, the auto-open/trust/theme-watch block, and theisMockupUrlexclusion clause inpane-controls-capability.js.
Options considered
- Standalone served repo + opener automation (chosen) — the template is developed and served on its own; nothing mockup-related ships or auto-opens in tranquil-automations. Fits the “app you build from” intent and the automations-and-operations framing. Cost: a new repo and a running dev server to see the pages.
- Keep the files in tranquil-automations, just repoint the loader — rejected: leaves
the pages shipping in the automations release and keeps the host loader (
file://+ theme-watch + trust) that we want gone. Doesn’t make them a template. - A dedicated “Open App Template” command in tranquil-automations — rejected: pushes template-specific knowledge back into the client. The opener belongs with the template (as an automation) so a new app carries its own open logic.
- A Deno-native static server (
jsr:@std/http/file-server) — rejected as the default: no live reload. Kept only as a documented fallback if browser-sync ever misbehaves under Deno (it doesn’t today).
Consequences
- tranquil-automations no longer ships or force-opens the mockups. No pages appear on
startup; the package is one feature lighter. The
registerDefaultRemoteControlspredicate simplifies to “has a webview and is not trusted” — which now also covers the servedhttp://localhost:3000pages, so they get the standard URL-bar toggle control for free (andhideURLBarkeeps them chrome-less). No tranquil-rpc trust is needed anymore. - Live authoring. Editing anything under
app/hot-reloads the open panes — a real edit loop the old staticfile://pages never had. - One removal subtlety worth remembering.
pane-controls-capability.jsimportedisMockupUrlfrom the deletedmockups.js; a “just delete the files” pass would have left a danglingrequirethat crashes activation and silently drops all automations commands. The import + its predicate clause had to go together. - A stale doc. Business Themes & Mockups still
describes the pages as tranquil-automations
file://fixtures — it needs an update to point at the new repo/served model (tracked in the delivery notes). - browser-sync-under-Deno gotchas are now load-bearing (all in the notes): omit the
hoistednode-modules linker in apackage.json-free repo, and browser-sync only injects its reload snippet when the request sendsAccept: text/html(real browsers always do). - Re-evaluate if apps outgrow a single static-server-per-repo (e.g. they need a real build step or a shared component library), at which point the template graduates from “copy this folder” to a scaffolded package.