The head linked `icons/favicon.svg` under the service's static files and
nothing else, so a service that kept its icon elsewhere (scribe) or had
none (agent-bridge) showed no icon at all, and clients that ignore SVG
(Safari, bookmark bars) or ask /favicon.ico without reading the page got
a 404 everywhere. Chrome now resolves five icon kinds - svg, 32 px png,
the Apple touch icon, 192 and 512 - from the service's static dir with a
few accepted paths each, falling back per kind to a generic set shipped
here, links svg + png + touch icon in the head, and answers /favicon.ico
and /apple-touch-icon.png at the root and under the mount prefix.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Both found by adopting the shell in scribe, which is older than chrome and
had conventions of its own.
chrome answered an API error with {"error": ...}. FastAPI's convention is
{"detail": ...}, and scribe's client reads exactly that:
msg = (await r.json()).detail || msg
A missing key there does not fail - it falls back to r.statusText, so every
error message in the UI quietly becomes "Bad Request" and the real reason
is lost. That is the worst shape for a regression: no exception, no failing
request, just worse text. Both keys are sent now. marketplace and
agent-bridge read `error` and are unaffected.
chrome also registers /healthz, and being registered first it won over
scribe's - which reports whether whisper, piper and xtts are reachable,
the thing actually worth knowing when scribe is unwell. `health=False`
lets a service keep its own, the same way language_switcher=False already
lets it keep its own language control.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
scribe stores the language per USER, in its database - `PATCH /api/me`,
whose docstring says "the language choice follows the user, not the
browser". chrome's is a cookie, which is browser-local and therefore
strictly weaker for that case.
Adopting the shell would otherwise have quietly swapped a preference that
follows you to another machine for one that does not, and left two
switchers on the page disagreeing about the same setting.
`language_switcher=False` makes the shell stand down. Only the language
control: the theme toggle is unaffected, which the test pins, because
scribe's theme IS chrome's - the same localStorage key and the same three
values, so that one is a straight swap.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both found by porting homepage, which is the first service to raise a
redirect from a dependency and the first with a language switcher that
returns you to the page you were on.
A dependency saying "you are not logged in, go here" raises rather than
returns, because it has no other way to stop the request. The error handler
treated every HTTPException as something to render, so a 307 came back
carrying the themed error page and no Location at all - a redirect that
does not redirect, with a 307 status to make it look like it had. Now a 3xx
with a Location is passed through as one.
chrome's /language/{code} already existed and took the destination from
Referer. homepage's own version additionally honoured ?next=, and chrome's
route shadowed it - so the feature silently disappeared on adoption rather
than conflicting visibly. The parameter moves into chrome instead, with the
open-redirect guard homepage had: anything carrying a scheme or a host is
discarded rather than patched up, including the protocol-relative
`//evil.example/x`, which urlparse reports as a netloc with no scheme and
which a naive `startswith("/")` check waves through.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
homepage puts the same handful of things on every page - who is logged in,
whether the weather and system widgets are enabled, whether to show the
admin link. Flask did that with two context processors. There is no
equivalent here, and passing the same eight keys at every render site is
the kind of repetition that goes stale one call at a time.
`ui.page_context` is a callable taking a Request and returning a dict. It
runs per render rather than once at startup, because what it returns depends
on who is asking: which group a visitor is in decides whether a tile is even
mentioned. An explicit value at the render site still wins, which is what
the test pins down.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
chrome served its assets at /chrome and the service's at /static, both
top-level. agent-bridge cannot use that: its design (D-0008) puts everything
behind exactly two proxied prefixes, /ui and /api, so assets at a third
top-level path are unreachable behind Caddy.
`mount_prefix="/ui"` moves both trees underneath it - /ui/chrome/... and
/ui/static/... - Web Awesome's versioned path included, which the autoloader
derives from its own script URL and so has to be right rather than
approximately right.
The default is unchanged, so marketplace on v0.1.0 is unaffected and does not
need the bump.
The test asserts the negative as well as the positive: nothing may be served
from a path the proxy does not forward. That is the actual requirement, and
it is the half such a test usually omits.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Three fixes found by driving a real page, not by reading the code.
Its autoloader works out where to fetch components from by finding the
<script> whose src *ends with* "webawesome.loader.js". The cache-busting
`?v=` defeated that match, so it fell back to the site root and every
component 404'd - a page that merely looks unstyled, with nothing in the
browser console and only 404s in the server log to say why. Web Awesome now
lives at /chrome/wa-<version>/, which removes the query string and, because
component filenames are stable across releases, also busts caches properly
on an upgrade. There are regression tests for both halves.
The brand ramp pointed at yellow but buttons came out brown: Web Awesome
picks step 50 for a loud fill because that is the darkest point that still
carries white text, and yellow-50 is #b45f04. The services have always used
bright yellow with dark text, so the fill/on pair is now set explicitly
rather than taken from the ramp.
TemplateResponse's old (name, context) signature is gone in Starlette 1.7,
and the error handler was returning its 404 page with an HTTP 200.
Also adds the import map for Preact/hooks/htm to the shell. hooks.module.js
carries a bare "preact" specifier internally, so the map is required rather
than a convenience, and it belongs here once instead of in every service.
strings_json() hands an island its translations with `<` escaped.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
One page frame, one palette, one set of components, one implementation of
config readers, proxy auth, /healthz, i18n and cache-busted asset URLs.
The design tokens had been copied into homepage, marketplace, agent-bridge
and scribe and had started to drift; so had theme.js and the asset() helper,
which existed in two incompatible versions. board.css carried the instruction
"Copy the values from homepage's style.css when they change there", which is
the problem stated as a procedure.
Components come from Web Awesome 3.14.0 (MIT), vendored under static/wa by
vendor-webawesome.sh - curl and tar against the npm registry, so there is no
node_modules, no lockfile and nothing for CI or a Containerfile to run. The
script prunes type definitions and IDE metadata, 13M down to 3.4M, and keeps
only the en and pl translations. Components style themselves inside a shadow
root, so a page rule cannot reach into one: "this input is the wrong width"
stops being a thing that can happen rather than a thing to be careful about.
Two decisions worth recording here:
- Asset versioning is a content digest over the whole static tree, not each
file's mtime. mtime is wrong in a container, where every COPY'd file
carries the build timestamp, so every asset appeared to change on every
build. A single tree-wide token also means a cached page can never pair
itself with a newer script.
- Pages keep the data-theme="light|dark|system" attribute the services have
always used. Web Awesome drives light/dark from a wa-light/wa-dark class
instead; base.html and theme.js own that mapping so nothing else learns it.
The compatibility aliases in tokens.css (--bg, --surface, --accent, ...) are
deliberate: they let a service move page by page instead of all at once.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>