mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 19:47:25 +01:00
Three things the widget did wrong on production, found by using it: - A visitor's note about Loki itself got a receipt with no link: only the owner's build had a way to follow. Self-reported notes now carry the same claim link api/feedback hands out, so the person can follow it in their own My feedback. The claim path has one spelling (feedbackClaimPath). - On Loki's own site the header read "LOKI / Loki": the brand line, then document.title. pageLabel drops the brand segment and keeps the page's name, falling back to the path, then Home. - A corner holding the host's own floating button (substrata's ASK, Heidi's pill) was climbed: two assistants stacked as one tower at 390px, and ours floated 300px up the edge at 1280px. That corner is now the host's: the launcher takes the other corner if it is clear, else the edge tab. Tab bars and composers are not floats and are stepped around as before; a side named by the host or the visitor is kept. The install prompt no longer tells builders to add data-fc-bottom to stack them. Browser fixtures 4/4b fail against the current production bundle and pass with this one. Claude-Session: https://claude.ai/code/session_01E1qoQ9syUYXCRNbyrpqPGa Co-authored-by: Claude <noreply@anthropic.com>
24 lines
1.2 KiB
TypeScript
24 lines
1.2 KiB
TypeScript
// The header names the page, not the brand again.
|
|
// Run: npx tsx scripts/test/widget-page-label.ts
|
|
import assert from "node:assert/strict";
|
|
import { pageLabel } from "../../widget/page-label";
|
|
|
|
// Loki's own pages: the brand line already says "Loki".
|
|
assert.equal(pageLabel("Loki", "/"), "Home");
|
|
assert.equal(pageLabel("Loki", "/control/"), "/control");
|
|
assert.equal(pageLabel("Control — Loki", "/control"), "Control");
|
|
assert.equal(pageLabel("LOKI | Feedback", "/feedback"), "Feedback");
|
|
assert.equal(pageLabel("Loki · My feedback", "/my-feedback"), "My feedback");
|
|
// Everyone else's titles pass through untouched.
|
|
assert.equal(pageLabel("Substrata — Ask the archive", "/"), "Substrata — Ask the archive");
|
|
assert.equal(pageLabel("Murphy's Bar", "/menu"), "Murphy's Bar");
|
|
// A word that merely contains the brand is not the brand, and a hyphenated
|
|
// name is one name.
|
|
assert.equal(pageLabel("Lokis Garten", "/"), "Lokis Garten");
|
|
assert.equal(pageLabel("evig-computers", "/"), "evig-computers");
|
|
// No title at all: the path, then Home.
|
|
assert.equal(pageLabel("", "/chat"), "/chat");
|
|
assert.equal(pageLabel("", "/"), "Home");
|
|
|
|
console.log("✓ widget-page-label: ok");
|