AssetsController
Serves the panel's static assets from where they already live — no build, no copy into `public/`. Three sources, one door each: the panel's OWN component bundle ships with this package (`assets/milpa/`); the design system — tokens, the fonts stylesheet, its faces, the wordmark and the icon — comes from `milpa/live-web` through {@see DesignTokens::path()}; the client runtime and Alpine come from the same package through {@see ClientRuntime}. Anything else is 404. 🚨 THE PANEL USED TO CARRY ITS OWN COPY OF THE TOKENS, AND IT HAD DRIFTED. `decisions/0243` ended the copies — three packages held identical ones, all three missing `--space-32`, and the file moved into `milpa/live-web`. This copy survived that fix: 9875 bytes against the system's 9892, one line apart, short exactly `--space-32`, which is why `height: var(--space-32)` measured `0px` in a rendered panel. Nothing read it yet, so the cost today was zero and the cost tomorrow was every token the system adds (greenhouse decisions/0309). 🚨 AND THE PANEL'S TYPE CAME FROM GOOGLE. Line 1 of the vendored bundle is an `@import url('https://fonts.googleapis.com/…')` the vendoring step prepends — three outbound requests per load, from a surface whose default gate is loopback-only, while this family ships the six woff2 faces itself. Measured with the import removed, on a machine where the family is not installed: «Space Grotesk» rendered at exactly the width of a family that does not exist. The failure is silent — the text stays legible in `system-ui` — which is why it lasted.
AssetsController::serve()
public function serve(Psr\Http\Message\ServerRequestInterface $request): Psr\Http\Message\ResponseInterface`GET {route}/assets/{file}` — one asset by name.
Parameters
| Name | Type | Description |
|---|---|---|
| $request | Psr\Http\Message\ServerRequestInterface |
AssetsController::face()
public function face(Psr\Http\Message\ServerRequestInterface $request): Psr\Http\Message\ResponseInterface`GET {route}/assets/fonts/{face}` — one font face. A second route because `milpa-fonts.css` names its files RELATIVELY (`url('fonts/x.woff2')`), so a browser that loaded the stylesheet at `{route}/assets/milpa-fonts.css` asks for `{route}/assets/fonts/x.woff2` and nothing else. A host that flattens that serves a stylesheet whose every `src` is a 404 — and that failure shows up as MISSING TYPE, never as an error.
Parameters
| Name | Type | Description |
|---|---|---|
| $request | Psr\Http\Message\ServerRequestInterface |
AssetsController::file()
public function file(string $name): Psr\Http\Message\ResponseInterfaceThe response for one asset name — 404 for anything the panel does not ship.
Parameters
| Name | Type | Description |
|---|---|---|
| $name | string |