feat(landing): add a live system status indicator to the footer (#641)

Adds /api/status to the landing Pages worker, HEAD-probing demo.snapotter.com and
docs.snapotter.com with a 2 second per-attempt deadline and one retry. snapotter.com is
not probed; the worker answering the request is the proof it is up.

The footer badge ships grey in the static HTML and only upgrades once the route answers.
A rejected fetch, a non-ok response, an unparseable body, and an unrecognized verdict all
leave it grey, so it never claims green on its own.

Color lives in the dot, never the label: `--color-success` scores 4.498:1 against the
footer's `--color-background-alt`, just under AA.

Four labels across 21 locales.
This commit is contained in:
SnapOtter
2026-07-25 20:52:42 +08:00
committed by GitHub
parent d9a8ae7b7e
commit d690a6e26d
48 changed files with 1142 additions and 0 deletions
+9
View File
@@ -159,4 +159,13 @@ describe("landing", () => {
expectPair(landing, "muted", "background");
expectPair(landing, "dark-fg", "dark-bg");
});
// The footer status dot is a graphic, so WCAG 1.4.11's 3:1 applies rather
// than AA's 4.5. Note "success" clears 3:1 here but not 4.5, which is why the
// badge's label stays muted while only the dot takes a state color.
it("footer status dot clears 3:1 non-text on the footer surface", () => {
for (const dot of ["muted", "success", "primary-ink", "danger"]) {
expectPair(landing, dot, "background-alt", 3);
}
});
});