@justai/cuts 0.99.0 → 0.102.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justai/cuts",
3
- "version": "0.99.0",
4
- "description": "A persona's named parts — the page shell that holds them, and the cuts themselves.",
3
+ "version": "0.102.0",
4
+ "description": "A persona's named parts \u2014 the page shell that holds them, and the cuts themselves.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
7
7
  "type": "git",
@@ -29,7 +29,9 @@
29
29
  "./Files.astro": "./src/FilePicker.astro",
30
30
  "./AuthMount.astro": "./src/AuthMount.astro",
31
31
  "./ChildPersona.astro": "./src/ChildPersona.astro",
32
- "./tagline.js": "./src/tagline.js"
32
+ "./tagline.js": "./src/tagline.js",
33
+ "./Catalogue.astro": "./src/Catalogue.astro",
34
+ "./CatalogueCard.astro": "./src/CatalogueCard.astro"
33
35
  },
34
36
  "peerDependencies": {
35
37
  "astro": ">=5"
@@ -0,0 +1,657 @@
1
+ ---
2
+ // THE CATALOGUE — an apex's storefront, and the last part of an apex that was not already shared.
3
+ //
4
+ // queries: app.zone grid · pin.games catalogue · the storefront · how does a new persona appear ·
5
+ // three-layer catalog · seed and runtime append · apex grid · Catalogue cut
6
+ //
7
+ // ── WHY THIS IS A CUT ────────────────────────────────────────────────────────────────────────────
8
+ //
9
+ // app.zone's own answer sheet called the grid "the one thing genuinely app.zone's own", and that was
10
+ // true while there was one apex. There are two now, and the founder's description of the difference
11
+ // is exact: the same experience, one listing app personas and the other game personas.
12
+ //
13
+ // Measured before moving it: 92% of app.zone's kernel is generic, and the difference between the two
14
+ // storefronts is about forty lines. Copying to change forty would have forked 966 — including a
15
+ // stylesheet, which would have become the largest single duplication in the fleet and the one most
16
+ // certain to drift.
17
+ //
18
+ // ── THE SEAM IS MACHINERY VERSUS WORDS ──────────────────────────────────────────────────────────
19
+ //
20
+ // Not "app.zone versus pin.games". The three layers, the card, the filter panel, the search, the deep
21
+ // links, the sort, the NEW badge are machinery and live here. The seed, the taglines, the curated
22
+ // order, the category labels are content and stay with the apex that owns them, arriving as props.
23
+ //
24
+ // ── THE THREE LAYERS ────────────────────────────────────────────────────────────────────────────
25
+ //
26
+ // 1. A BUILD-TIME SEED — hardcoded, and emphatically not the roster of record. It exists so a crawler
27
+ // with no JavaScript sees a real grid and so the build works offline. A persona does NOT have to
28
+ // be in it to appear. An apex with nothing seeded yet passes an empty list and is correct.
29
+ // 2. A BUILD-TIME DESCRIPTION OVERRIDE — each seeded line replaced by the persona's own bio in the
30
+ // reader's language, from the live registry, wrapped so failure is survivable: an outage at build
31
+ // costs freshness, not a deploy.
32
+ // 3. A RUNTIME APPEND — everything the registry knows that the seed does not. This is how a persona
33
+ // that registered an hour ago reaches the storefront with nobody redeploying.
34
+ //
35
+ // ── AND THE ONE LINE THAT DECIDES WHAT THE SITE IS ──────────────────────────────────────────────
36
+ //
37
+ // `kind`. It used to be `home.endsWith(".app.zone")` in a template, and again in llms.txt — a
38
+ // statement about what the ecosystem IS, living in one page's markup, twice. It is now a question
39
+ // asked of the registry, which has carried `personaKind` since long before anything read it.
40
+ import CatalogueCard, { type CatalogueEntry } from "./CatalogueCard.astro";
41
+
42
+ interface Props {
43
+ /** BCP-47 code of the page — the language the registry is asked for. */
44
+ lang: string;
45
+ /** Which citizens this apex lists. The whole difference between two storefronts. */
46
+ kind: string;
47
+ /** The apex's own host, used for the referral parameter on every card. */
48
+ apexHost: string;
49
+ /** Layer one. Empty is valid and correct for an apex with nothing seeded yet. */
50
+ seed?: CatalogueEntry[];
51
+ /** The curated sequence, keyed by host — read by the runtime sort. */
52
+ order?: Record<string, number>;
53
+ /** A shelf label per host: a card has one line to earn a tap, and a bio clamps. Keyed by host. */
54
+ taglines?: Record<string, string>;
55
+ /** Localized category names. The English key stays the stable filter value. */
56
+ catLabels?: Record<string, string>;
57
+ /** Per-id name and description for the seed, in the reader's language. */
58
+ entries?: Record<string, { name: string; desc: string }>;
59
+ /** Every locale this apex serves — the deep-link script strips a language prefix with it. */
60
+ locales: readonly string[];
61
+ strings: {
62
+ search: string;
63
+ filter: string;
64
+ eyebrow: string;
65
+ all: string;
66
+ empty: string;
67
+ /** queries: empty catalogue · a new apex has no personas · first day · nothing matched vs nothing here
68
+ *
69
+ * WHAT AN APEX SAYS ON ITS FIRST DAY, and it is not what it says when a search misses. "No games
70
+ * match." is a true sentence about a filter and a wrong one about an empty shelf — it tells a
71
+ * visitor they typed something unlucky when in fact they arrived early. pin.games opened with a
72
+ * catalogue of zero on purpose, so this is the sentence that greeted the first person there.
73
+ *
74
+ * Optional: an apex with citizens can never reach this state, and falls back to `empty`. */
75
+ awaiting?: string;
76
+ new: string;
77
+ };
78
+ }
79
+ const {
80
+ lang, kind, apexHost,
81
+ seed = [], order = {}, taglines = {}, catLabels = {}, entries = {},
82
+ locales, strings,
83
+ } = Astro.props;
84
+
85
+ // localized category label; the category key (English) stays the stable filter value
86
+ const catLabel = (c: string): string => catLabels[c] ?? c;
87
+
88
+ // The filter panel's rows, rendered server-side so the shelves exist without JS and for SEO. Biggest
89
+ // category first, then alphabetical — a stable order that puts the fullest shelf at the front.
90
+ // Counts are category SIZES, not visible-result counts: they do not move when the search box narrows the
91
+ // grid, so a row always answers "how many apps are there of this kind".
92
+ // Derived from the build-time seed only. A persona that registers later can bring a category that is not
93
+ // here, so the runtime append adds any missing row itself (see the catalog script).
94
+ const catCounts: Record<string, number> = {};
95
+ for (const a of seed) catCounts[a.category] = (catCounts[a.category] ?? 0) + 1;
96
+ const catChips = Object.entries(catCounts).sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]));
97
+
98
+ // localized app-card content, keyed by the app's stable id; English is the fallback
99
+ type Loc = { name: string; desc: string };
100
+ const appName = (a: App): string => entries[a.id]?.name ?? a.name;
101
+
102
+ // queries: where do the app descriptions on app.zone come from · what happens to the build if
103
+ // api.justai.pro is down · which description wins, the API bio or the bundled copy ·
104
+ // how is the NEW badge decided · how long does an app show the NEW badge
105
+ //
106
+ // Build-time: single-source each app's description from its persona's bio, in the reader's language,
107
+ // via api.justai.pro (the catalog service app.zone declares). The bundled i18n is the fallback if the
108
+ // API is unreachable at build — the design never depends on the network.
109
+ let catalogByHome: Record<string, string> = {};
110
+ try {
111
+ const res = await fetch(`https://api.justai.pro/api/catalog?locale=${lang}&kind=${encodeURIComponent(kind)}`);
112
+ if (res.ok) {
113
+ const data = await res.json();
114
+ for (const p of data.personas ?? []) if (p.home && p.bio) catalogByHome[p.home] = p.bio;
115
+ }
116
+ } catch {
117
+ /* offline build → fall back to the bundled i18n; the page never depends on the network */
118
+ }
119
+ const hostOf = (url: string): string => {
120
+ try {
121
+ return new URL(url).host;
122
+ } catch {
123
+ return "";
124
+ }
125
+ };
126
+ // queries: why is the card's line shorter than the persona's bio · where does the card copy come from ·
127
+ // can I change what a card says without touching the persona
128
+ //
129
+ // THE CARD AND THE PROFILE SPEAK IN DIFFERENT VOICES, and that is the whole point of this line.
130
+ // A bio is the persona introducing itself, in the first person, at profile length: "önemsediğin her
131
+ // saati tek bakışta tutarım". A card is a shelf label in a storefront, and it should ask for the tap:
132
+ // "Dünyadaki saatleri tek bakışta takip et". Second person, imperative, one line.
133
+ //
134
+ // It is also what fixes the truncation. The card clamps at two lines and five of the nine visible
135
+ // cards were ending in an ellipsis — because a sentence written for a profile was being shown in a
136
+ // card. That is a wrong-field problem, not a long-copy problem.
137
+ //
138
+ // KEYED BY HOST, exactly as src/data/order.ts is keyed, and for exactly its reason: an app reaches
139
+ // this grid by two routes with two different identifiers. `stt` and `tts` registered at runtime and
140
+ // have no entry in the seed at all, so a seed-id key could never reach them.
141
+ //
142
+ // TEMPORARY HOME. These belong to the persona, not to app.zone — the three-layer catalogue promises
143
+ // that a persona can register and appear here with no change to this repo, and a tagline held here
144
+ // breaks that for every future arrival. They live here while the copy is still being written, because
145
+ // iterating a sentence through twelve repos and a registry sync is the wrong loop for editing prose.
146
+ // Once the wording settles they move into the persona contract beside bio and meta, and this map goes.
147
+ const tagline = (a: App): string | undefined =>
148
+ taglines?.[hostOf(a.url)];
149
+ const appDesc = (a: App): string =>
150
+ tagline(a) ?? catalogByHome[hostOf(a.url)] ?? entries[a.id]?.desc ?? a.description;
151
+ // A persona wears the NEW badge only for its first week — computed from when it joined (honest, not a
152
+ // hardcoded flag). The same rule runs at runtime for API-fetched cards (see the catalog script below).
153
+ const NEW_DAYS = 7;
154
+ const isNew = (added: string): boolean => { const t0 = Date.parse(added || ""); return Number.isFinite(t0) && Date.now() - t0 < NEW_DAYS * 864e5; };
155
+ ---
156
+
157
+ <div class="kbody">
158
+ <!-- The shelves used to be a chip row under the field. Six categories, and FOUR of them held a
159
+ single app — a filter whose options mostly resolve to one card is a shortcut wearing a
160
+ filter's clothes, and it cost a whole row of height to say so. Worse, the row overflowed
161
+ with `scrollbar-width: none`, so the shelves past the edge had no affordance at all: they
162
+ were there and nothing said so. Collapsed into the field's own end, the same options get a
163
+ vertical list where a long label ("Yardımcı Programlar") fits whole and the count sits
164
+ beside it, and the default view goes back to being the cards. -->
165
+ <div class="controls">
166
+ <div class="fwrap">
167
+ <div class="search">
168
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8" /><path d="M21 21l-4.3-4.3" /></svg>
169
+ <input id="search" type="search" placeholder={strings.search} autocomplete="off" aria-label={strings.search} />
170
+ <!-- aria-expanded is the button's own state and aria-controls names what it opens, so the
171
+ panel is reachable by a screen reader as this button's disclosure rather than as a
172
+ loose group that happens to follow it. -->
173
+ <button class="fbtn" id="fbtn" type="button" aria-label={strings.filter} title={strings.filter} aria-expanded="false" aria-controls="fpanel">
174
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h16M7 12h10M10 18h4" /></svg>
175
+ </button>
176
+ </div>
177
+
178
+ <!-- Toggle buttons, not links: the filter is client-side and instant. aria-pressed carries
179
+ which shelf is showing. `hidden` rather than display:none in CSS, so the closed panel is
180
+ out of the accessibility tree and out of the tab order without a second source of truth. -->
181
+ <div class="fpanel" id="fpanel" role="group" aria-label={strings.eyebrow} hidden>
182
+ <button class="opt active" type="button" data-cat="" aria-pressed="true">
183
+ <svg class="tick" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5" /></svg>
184
+ <span class="lb">{strings.all}</span><span class="n">{seed.length}</span>
185
+ </button>
186
+ {catChips.map(([c, n]) => (
187
+ <button class="opt" type="button" data-cat={c} aria-pressed="false">
188
+ <svg class="tick" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6L9 17l-5-5" /></svg>
189
+ <span class="lb">{catLabel(c)}</span><span class="n">{n}</span>
190
+ </button>
191
+ ))}
192
+ </div>
193
+ </div>
194
+ </div>
195
+
196
+ <!-- data-order carries the curated sequence to the runtime sort, the same channel newLabel and
197
+ catMap already use. Passed as data rather than imported into the client bundle so the order the
198
+ page is serving is readable in the served HTML. -->
199
+ {/* taglines ride the same channel as newLabel and catMap: a data attribute on the grid. The
200
+ runtime append builds its cards in plain strings and cannot reach this component's scope, so
201
+ anything it needs has to arrive this way. Keyed by host, which is what the API calls `home`. */}
202
+ <section class="grid" id="grid" data-kind={kind} data-apex={apexHost} data-new-label={strings.new} data-cat-map={JSON.stringify(catLabels)} data-order={JSON.stringify(order)} data-taglines={JSON.stringify(taglines)}>
203
+ {seed.map((app) => <CatalogueCard app={app} name={appName(app)} desc={appDesc(app)} isNew={isNew(app.added)} newLabel={strings.new} />)}
204
+ </section>
205
+ {/* Both sentences ride data-attributes because the loader below is a BUNDLED script and
206
+ cannot see props — the same seam Posts uses. */}
207
+ <p class="empty" id="empty" hidden
208
+ data-empty={strings.empty}
209
+ data-awaiting={strings.awaiting ?? strings.empty}>{strings.empty}</p>
210
+ </div>
211
+
212
+ {/* `apexHost` rides define:vars for the same reason `supported` does: this block is emitted
213
+ VERBATIM and cannot see the component's props. It was the literal "app.zone" until the second apex
214
+ existed. */}
215
+ <script is:inline define:vars={{ supported: locales, apexHost }}>
216
+ // PLAIN BROWSER JS ONLY — no TypeScript in this block. `define:vars` forces the script `is:inline`,
217
+ // and Astro emits an inline script VERBATIM: it neither bundles nor type-strips it, unlike the
218
+ // hoisted `<script>` below (esbuild transpiles that one, so TS is fine there). A single `as
219
+ // HTMLInputElement` here reaches the browser as source and dies at parse with "Unexpected
220
+ // identifier 'as'" — which kills the WHOLE block, so the live search and the ?category=/?apps=
221
+ // deep links all silently stop working. See the corpus: an inline script is not TypeScript.
222
+ //
223
+ // `supported` is injected from src/i18n via define:vars — the shell's own technique — so the
224
+ // locale list has ONE home and is never typed here. A literal array once lived on this line and
225
+ // drifted: it was edited by hand when Italian shipped, and any locale missing from it fell through
226
+ // to "en", which the receiving persona then WROTE as the visitor's saved language choice.
227
+ // Pass the visitor's language + a referral to each app link, so apps open in the same
228
+ // language and show their "home → app.zone" affordance.
229
+ (function () {
230
+ function detectLang() {
231
+ const saved = localStorage.getItem("lang");
232
+ if (saved && supported.includes(saved)) return saved;
233
+ const langs = navigator.languages || [navigator.language || "en"];
234
+ for (const l of langs) {
235
+ const c = (l || "").toLowerCase().split("-")[0];
236
+ if (supported.includes(c)) return c;
237
+ }
238
+ return "en";
239
+ }
240
+ const lang = detectLang();
241
+ for (const a of document.querySelectorAll(".card")) {
242
+ try {
243
+ const u = new URL(a.href);
244
+ u.searchParams.set("ref", apexHost);
245
+ u.searchParams.set("lang", lang);
246
+ a.href = u.toString();
247
+ } catch (e) {}
248
+ }
249
+ })();
250
+
251
+ // queries: can a campaign link to just one app or one category · what is the ?apps= URL parameter ·
252
+ // ?category= ?apps= ?persona= deep link · land a campaign click on one slice of the catalog
253
+ //
254
+ // gallery search + category filter + URL-driven filter. The panel is the visible face of the
255
+ // ?category= slice the catalog always supported: choosing one is the same operation a campaign link
256
+ // performs, so a person can reach by hand exactly where an ad can land them, and the URL stays
257
+ // shareable either way. ?apps= stays URL-only — it is a campaign instrument, not a browse control.
258
+ const search = document.getElementById("search");
259
+ const empty = document.getElementById("empty");
260
+ const panel = document.getElementById("fpanel");
261
+ const fbtn = document.getElementById("fbtn");
262
+ const params = new URLSearchParams(location.search);
263
+ // MUTABLE: the panel writes to it. Everything downstream reads `activeCat`, never the URL again.
264
+ let activeCat = (params.get("category") || "").trim().toLowerCase();
265
+ const appsParam = (params.get("apps") || params.get("persona") || params.get("personas") || "").trim().toLowerCase();
266
+ const onlyApps = appsParam ? new Set(appsParam.split(",").map((s) => s.trim()).filter(Boolean)) : null;
267
+
268
+ // Paint the options to match `activeCat`. Comparison is lowercased because data-cat carries the
269
+ // canonical casing ("Fitness") while a hand-typed ?category=fitness will not.
270
+ function paintChips() {
271
+ if (!panel) return;
272
+ let matched = false;
273
+ for (const b of panel.querySelectorAll(".opt")) {
274
+ const on = (b.dataset.cat || "").toLowerCase() === activeCat;
275
+ if (on) matched = true;
276
+ b.classList.toggle("active", on);
277
+ b.setAttribute("aria-pressed", on ? "true" : "false");
278
+ }
279
+ // ?category=nosuchthing — nothing matched, so no row is ticked rather than the wrong one. The grid
280
+ // will be empty and say so, which is the honest reading of the URL.
281
+ if (!matched && activeCat === "") panel.querySelector('.opt[data-cat=""]')?.classList.add("active");
282
+ // With the row gone, this button is the only place a closed panel can say a filter is on.
283
+ if (fbtn) fbtn.classList.toggle("on", activeCat !== "");
284
+ }
285
+
286
+ // `hidden` is the single source of truth for open/closed — read it rather than tracking a second flag
287
+ // that can disagree with the DOM.
288
+ function setOpen(open) {
289
+ if (!panel || !fbtn) return;
290
+ panel.hidden = !open;
291
+ fbtn.setAttribute("aria-expanded", open ? "true" : "false");
292
+ }
293
+ const isOpen = () => !!panel && !panel.hidden;
294
+
295
+ // Keep the address bar honest without stacking history: a filter is a view of this page, not a
296
+ // destination, so replaceState — the same treatment the ?ref/?lang hints get.
297
+ function syncUrl() {
298
+ const u = new URL(location.href);
299
+ if (activeCat) u.searchParams.set("category", activeCat);
300
+ else u.searchParams.delete("category");
301
+ history.replaceState(null, "", u.pathname + (u.search || "") + u.hash);
302
+ }
303
+
304
+ if (panel && fbtn) {
305
+ fbtn.addEventListener("click", () => setOpen(!isOpen()));
306
+
307
+ panel.addEventListener("click", (e) => {
308
+ const b = e.target.closest(".opt");
309
+ if (!b) return;
310
+ const c = (b.dataset.cat || "").toLowerCase();
311
+ activeCat = c === activeCat ? "" : c; // choosing the ticked row clears it
312
+ paintChips();
313
+ syncUrl();
314
+ apply();
315
+ setOpen(false); // the choice is made and the grid behind it just changed — get out of the way
316
+ });
317
+
318
+ // Outside click closes. Bound on the document, so it also catches a click on the search input; the
319
+ // guard keeps the button's own click from closing what it just opened.
320
+ document.addEventListener("click", (e) => {
321
+ if (!isOpen()) return;
322
+ if (panel.contains(e.target) || fbtn.contains(e.target)) return;
323
+ setOpen(false);
324
+ });
325
+
326
+ // Escape closes and hands focus back, because a keyboard user who opened this has nowhere to go
327
+ // otherwise — the panel's rows are the only thing between them and the grid.
328
+ document.addEventListener("keydown", (e) => {
329
+ if (e.key !== "Escape" || !isOpen()) return;
330
+ setOpen(false);
331
+ fbtn.focus();
332
+ });
333
+ }
334
+
335
+ function apply() {
336
+ if (!empty) return;
337
+ const q = (search?.value ?? "").trim().toLowerCase();
338
+ let shown = 0;
339
+ // re-query each time so runtime-appended cards (new personas) obey the filter too
340
+ for (const card of document.querySelectorAll(".card")) {
341
+ const name = card.dataset.name ?? "";
342
+ const c = (card.dataset.category ?? "").toLowerCase();
343
+ const id = (card.dataset.id ?? "").toLowerCase();
344
+ const ok =
345
+ (!activeCat || c === activeCat) &&
346
+ (!onlyApps || onlyApps.has(id)) &&
347
+ (q === "" || name.includes(q));
348
+ card.style.display = ok ? "" : "none";
349
+ if (ok) shown++;
350
+ }
351
+ // TWO DIFFERENT SILENCES. `shown === 0` with cards on the page means a filter excluded them all;
352
+ // `total === 0` means the shelf itself is bare, which is a first day rather than a bad search.
353
+ // Same element, two sentences, and the wrong one reads as a fault the visitor caused.
354
+ const total = document.querySelectorAll(".card").length;
355
+ empty.textContent = (total === 0 ? empty.dataset.awaiting : empty.dataset.empty) ?? "";
356
+ empty.hidden = shown !== 0;
357
+ }
358
+
359
+ if (search) search.addEventListener("input", apply);
360
+ // runtime catalog cards arrive after the build-time ones — re-apply, and repaint the panel because the
361
+ // append may have added one for a category the build-time seed never knew about
362
+ document.addEventListener("zone:cards", () => { paintChips(); apply(); });
363
+ paintChips();
364
+ apply();
365
+ </script>
366
+
367
+ <script>
368
+ // queries: how does a new app appear on app.zone · my app is not on app.zone · new app missing
369
+ // from app.zone · runtime append registry · app.zone card unstyled · data-astro-cid
370
+ // insertAdjacentHTML · app.zone grid not sorted · where does a runtime card's category
371
+ // come from · why is an app's icon fetched from its own host
372
+ //
373
+ // app.zone's catalog: SSR renders the curated apps (for SEO + design); at RUNTIME we fetch the live
374
+ // registry (api.justai.pro/api/catalog) and APPEND any persona registered since the build — a
375
+ // *.app.zone citizen not already on the page — so a new app appears with NO app.zone redeploy.
376
+ //
377
+ // Two traps live in here. (1) Nodes built with insertAdjacentHTML sit OUTSIDE Astro's scoped CSS,
378
+ // so the scope attribute has to be copied off a real card onto every injected node — forget it and
379
+ // nothing errors, the card just renders completely unstyled. (2) The whole grid is re-sorted after
380
+ // the append, seeds and newcomers together, so ordering is a property of the merged list, not of
381
+ // either source. Then a `zone:cards` event lets the URL filter re-run over the newcomers.
382
+ (function () {
383
+ const grid = document.getElementById("grid");
384
+ if (!grid) return;
385
+ const locale = document.documentElement.lang || "en";
386
+ const NEW_MS = 7 * 864e5; // a persona wears NEW only for its first week (honest — from its createdAt)
387
+ const newLabel = grid.dataset.newLabel || "New";
388
+ // queries: which personas appear on this apex · runtime append kind · why is my game not listed
389
+ //
390
+ // WHICH CITIZENS THIS APEX LISTS — where the hostname test used to be. A bundled script cannot
391
+ // reach this component's props, so the two facts it needs ride the same data-attribute channel as
392
+ // newLabel and catMap. And `kind` is asked of the registry rather than inferred from a suffix: a
393
+ // persona's apex is a property of the persona, not a shape of its address.
394
+ const apexKind = grid.dataset.kind || "app";
395
+ const apexHost = grid.dataset.apex || "app.zone";
396
+ // The category label must be localized like the SSR path (catLabel), but the API returns the
397
+ // category in English regardless of ?locale=. So carry this page's cat dictionary through a data
398
+ // attribute (same channel as newLabel) and map through it — the English key stays the stable
399
+ // filter value in data-category, only the visible label is translated.
400
+ let catMap: Record<string, string> = {};
401
+ try { catMap = JSON.parse(grid.dataset.catMap || "{}"); } catch (e) {}
402
+ const catLabel = (c: string): string => catMap[c] ?? c;
403
+ // The card's line, in the storefront's voice rather than the persona's — same map the SSR path
404
+ // reads, arriving through the same channel as the two above. Keyed by host, which the API calls
405
+ // `home`. Missing entry falls through to the bio, so a locale with no taglines yet, or a persona
406
+ // that registered after they were written, simply keeps what it had.
407
+ let tagMap: Record<string, string> = {};
408
+ try { tagMap = JSON.parse(grid.dataset.taglines || "{}"); } catch (e) {}
409
+
410
+ // hosts already on the page (don't duplicate the SSR cards)
411
+ const have = new Set(
412
+ Array.from(grid.querySelectorAll<HTMLAnchorElement>("a.card")).map((a) => {
413
+ try { return new URL(a.href).host; } catch { return ""; }
414
+ }),
415
+ );
416
+ // the appended cards must inherit AppCard's scoped styles → copy the cid attribute off a real card
417
+ const sample = grid.querySelector<HTMLElement>("a.card");
418
+ const scopeAttr = sample ? sample.getAttributeNames().find((n) => n.startsWith("data-astro-cid-")) || null : null;
419
+
420
+ const esc = (s: unknown): string =>
421
+ String(s ?? "").replace(/[&<>"]/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;" })[c] as string);
422
+
423
+ type Entry = { handle: string; home: string; bio: string | null; name: string | null; avatar: string | null; glyph: string | null; category: string | null; accent: string | null; qrIcon: boolean; badge: string | null; createdAt: string | null };
424
+ const cardHTML = (a: Entry): string => {
425
+ const url = `https://${a.home}`;
426
+ // the persona's canonical icon, served on its own host — one face everywhere (avatar wins; glyph is gone).
427
+ // NO inline style. It used to carry the whole .icon rule inline, on the grounds that a node inserted with
428
+ // insertAdjacentHTML sits outside Astro's scoped CSS — but the append copies the cid onto every injected
429
+ // node, including this img, so the class does apply. What the inline copy actually did was OVERRIDE it:
430
+ // when the icon grew from 60px to 72px in AppCard.astro, this stayed at 60 and won on specificity, so the
431
+ // three seeded cards rendered a fifth larger than the seven that arrive from the registry. Nobody saw it
432
+ // until a reorder put them next to each other. (72 did not last — the size is back to 60, see
433
+ // AppCard.astro — but the trap is the same at any value: these attributes and that rule move together.)
434
+ // It protected nothing either: if the cid copy ever failed, the whole card would be unstyled, not just
435
+ // this image. One rule, in AppCard.astro.
436
+ const icon = `<img class="icon" src="${esc(a.avatar || `${url}/icon.svg`)}" alt="" width="60" height="60" loading="lazy" decoding="async">`;
437
+ // NEW only for the first week from the persona's own createdAt — never the hardcoded a.badge / a.status.
438
+ const created = a.createdAt ? Date.parse(a.createdAt) : NaN;
439
+ const isNew = Number.isFinite(created) && created <= Date.now() && Date.now() - created < NEW_MS;
440
+ const badge = isNew ? `<span class="badge new">${esc(newLabel)}</span>` : "";
441
+ const name = a.name || a.handle;
442
+ const cat = a.category || "";
443
+ // Must stay in step with AppCard.astro — this is the same card, built twice. The category span is
444
+ // gone from both: it lives in the filter row above the grid now.
445
+ return `<a class="card" href="${esc(url)}" data-name="${esc(name.toLowerCase())}" data-category="${esc(cat)}" data-id="${esc((a.handle || "").toLowerCase())}" data-added="${esc(a.createdAt || "")}">${icon}<div class="meta"><div class="top"><h2>${esc(name)}</h2>${badge}</div><p>${esc(tagMap[a.home] ?? a.bio ?? "")}</p></div><svg class="chev" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6"/></svg></a>`;
446
+ };
447
+
448
+ fetch(`https://api.justai.pro/api/catalog?locale=${encodeURIComponent(locale)}&kind=${encodeURIComponent(apexKind)}`)
449
+ .then((r) => (r.ok ? r.json() : null))
450
+ .then((data) => {
451
+ if (!data || !data.personas) return;
452
+ const newcomers = (data.personas as Entry[]).filter(
453
+ // The registry already returned only this apex's kind, so all that is left to exclude is the
454
+ // apex itself — a household head does not stand on its own shelf.
455
+ //
456
+ // queries: auth appeared on app.zone · a persona from another apex is listed · why both
457
+ // kind and home · residency
458
+ //
459
+ // TWO QUESTIONS, AND THE OLD LINE ANSWERED BOTH AT ONCE. `home.endsWith(".app.zone")` read
460
+ // as "is it an app" and was also, silently, "does it live here" — so replacing it with
461
+ // `kind` alone put `auth.justai.pro` and `justai.pro` on app.zone's shelf, both being kind
462
+ // `app`. Caught by comparing against the live page before deploying: fifteen cards where
463
+ // there had been thirteen, and a category nobody had ever seen.
464
+ //
465
+ // Both are asked now. KIND is what a persona IS — the registry's own property, and the
466
+ // reason a second apex can exist. RESIDENCY is where it LIVES, which is still its address.
467
+ (p) => p.home
468
+ && p.home.endsWith("." + apexHost)
469
+ && p.home !== apexHost && p.handle !== apexHost
470
+ && !have.has(p.home),
471
+ );
472
+ for (const a of newcomers) {
473
+ grid.insertAdjacentHTML("beforeend", cardHTML(a));
474
+ const el = grid.lastElementChild as HTMLAnchorElement | null;
475
+ if (!el) continue;
476
+ if (scopeAttr) {
477
+ el.setAttribute(scopeAttr, "");
478
+ el.querySelectorAll("*").forEach((n) => n.setAttribute(scopeAttr, ""));
479
+ }
480
+ try { const u = new URL(el.href); u.searchParams.set("ref", apexHost); u.searchParams.set("lang", locale); el.href = u.toString(); } catch {}
481
+ }
482
+
483
+ // The filter panel is rendered from the build-time seed, so a persona that registered afterwards
484
+ // can arrive carrying a category no row exists for — and it would then be unreachable by filter
485
+ // and invisible in the counts. Reconcile the panel against what is actually in the grid: every
486
+ // category present gets a row, and every count is recomputed rather than incremented, so this is
487
+ // correct however many times it runs.
488
+ const fpanel = document.getElementById("fpanel");
489
+ if (fpanel) {
490
+ // CLONE a row the server rendered instead of building HTML. Astro scopes per COMPONENT, so a
491
+ // hand-built node needs Zone.astro's own data-astro-cid-* copied onto it AND every child —
492
+ // forget it and nothing errors, the row just renders naked. A clone carries the cid, the tick
493
+ // and the inner spans with it, so that whole class of bug is gone rather than commented.
494
+ const proto = fpanel.querySelector<HTMLElement>('.opt[data-cat=""]');
495
+ const counts = new Map<string, number>();
496
+ for (const c of grid.querySelectorAll<HTMLAnchorElement>("a.card")) {
497
+ const k = c.dataset.category || "";
498
+ if (k) counts.set(k, (counts.get(k) || 0) + 1);
499
+ }
500
+ const allN = fpanel.querySelector<HTMLElement>('.opt[data-cat=""] .n');
501
+ if (allN) allN.textContent = String(grid.querySelectorAll("a.card").length);
502
+ for (const [cat, n] of counts) {
503
+ let opt = fpanel.querySelector<HTMLElement>(`.opt[data-cat="${CSS.escape(cat)}"]`);
504
+ if (!opt && proto) {
505
+ opt = proto.cloneNode(true) as HTMLElement;
506
+ // the prototype is the ticked "All" row — a clone must arrive unticked
507
+ opt.classList.remove("active");
508
+ opt.setAttribute("aria-pressed", "false");
509
+ opt.dataset.cat = cat;
510
+ const lb = opt.querySelector<HTMLElement>(".lb");
511
+ if (lb) lb.textContent = catLabel(cat);
512
+ fpanel.appendChild(opt);
513
+ }
514
+ if (!opt) continue;
515
+ const num = opt.querySelector<HTMLElement>(".n");
516
+ if (num) num.textContent = String(n);
517
+ }
518
+
519
+ // Re-sort now, because the SSR order was decided from a seed that holds a fraction of the
520
+ // catalog — most personas arrive here, at runtime. "All" is pinned first; the rest go
521
+ // biggest-first, then alphabetical, so the fullest shelf is the first one read.
522
+ const ordered = Array.from(fpanel.querySelectorAll<HTMLElement>(".opt")).sort((x, y) => {
523
+ const cx = x.dataset.cat || "", cy = y.dataset.cat || "";
524
+ if (!cx) return -1;
525
+ if (!cy) return 1;
526
+ const nx = counts.get(cx) || 0, ny = counts.get(cy) || 0;
527
+ return ny - nx || cx.localeCompare(cy);
528
+ });
529
+ for (const c of ordered) fpanel.appendChild(c);
530
+ }
531
+ // One order for the whole grid, and it is CURATED now rather than chronological: src/data/order.ts
532
+ // lists hosts top to bottom, and that list is the grid. Anything NOT on the list goes ABOVE it, so
533
+ // a persona that registers with the platform announces itself at the top with no change to this
534
+ // repo — the list curates what is known, it does not gate what arrives. Several unlisted arrivals
535
+ // sort newest-first among themselves, which is the old rule, still doing the one job it is good at.
536
+ //
537
+ // Keyed by host on purpose. The same app reaches this grid by two routes with two different
538
+ // identifiers — Password Generator is id "password" in the seed and handle "password-generator" in
539
+ // the registry — and an identifier that only matches one route fails silently on the other. A card
540
+ // that fails to match reads as unlisted and jumps to the top, which is the worst possible failure
541
+ // for an ordering bug: it looks deliberate. The host is what both routes agree on.
542
+ const orderList: string[] = (() => {
543
+ try { return JSON.parse(grid.dataset.order || "[]"); } catch { return []; }
544
+ })();
545
+ const rank = new Map(orderList.map((h, i) => [h, i]));
546
+ const UNLISTED = -1;
547
+ Array.from(grid.querySelectorAll<HTMLAnchorElement>("a.card"))
548
+ .map((el) => {
549
+ let host = "";
550
+ try { host = new URL(el.href).host; } catch {}
551
+ return { el, r: rank.has(host) ? (rank.get(host) as number) : UNLISTED, added: el.getAttribute("data-added") || "" };
552
+ })
553
+ .sort((x, y) => {
554
+ if (x.r !== y.r) return x.r - y.r; // listed follow the list; unlisted (-1) sort above all
555
+ if (x.r !== UNLISTED) return 0; // two listed cards cannot share a rank
556
+ if (x.added === y.added) return 0; // both unlisted → newest first, undated last
557
+ if (!x.added) return 1;
558
+ if (!y.added) return -1;
559
+ return x.added < y.added ? 1 : -1;
560
+ })
561
+ .forEach(({ el }) => grid.appendChild(el));
562
+ document.dispatchEvent(new Event("zone:cards")); // newcomers in — let the URL filter catch them
563
+ })
564
+ .catch(() => {});
565
+ })();
566
+ </script>
567
+
568
+ <style>
569
+ /* The three gaps down this column are one rhythm: 26 to the search, 18 from it to the grid, 14
570
+ between cards. Each step is about 1.4x the next, so they read as one thing narrowing — section,
571
+ then control-to-list, then item-to-item.
572
+ THE TOP ONE USED TO BE `clamp(20px, 5vh, 44px)`, which is not a chosen number: it is whatever the
573
+ viewport gives. Measured, the same page had 37px of it at 700px tall and 46px at 900px, against a
574
+ fixed 18px below — so the search sat 1.8x from the bar on a laptop and 2.2x on a desktop, and at
575
+ that distance it stops reading as the head of the grid and starts looking as though it drifted
576
+ down toward it. A gap that changes with the window is a rhythm nobody designed. */
577
+ .kbody { flex: 1 0 auto; display: flex; flex-direction: column; padding-block: 26px 16px; }
578
+
579
+ .controls { margin-block-end: 18px; }
580
+
581
+ /* The field carries the CARD's material, and the reason is a measurement rather than a preference.
582
+ On this page "raised" means whiter plus a shadow: the cards are `--card-bg` (#fff in light) on an
583
+ off-white ground. The field was `--surface-2` — 4% BLACK over that same ground — with no shadow, so
584
+ it was not lifting, it was recessed, and a recessed input in light reads as disabled. Giving it the
585
+ card recipe means the page has ONE raised surface instead of two treatments arguing.
586
+ Dark loses nothing: there `--card-bg` and `--surface` are the same value, so the fill stays the 6%
587
+ white overlay that was already lifting correctly, and only the shadow is added. That asymmetry is
588
+ why the complaint could only come from the light side. */
589
+ .search {
590
+ display: flex; align-items: center; gap: 10px;
591
+ background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md);
592
+ box-shadow: var(--card-shadow);
593
+ /* the end padding is the button's, not the text's — 16px would park the icon away from the edge it
594
+ belongs to, and the button brings its own 30px of hit area */
595
+ padding: 12px 8px 12px 16px;
596
+ transition: border-color 0.2s var(--ease-out), box-shadow 0.25s var(--ease-out);
597
+ }
598
+ /* focus lives on the whole box as a soft OUTER breeze — not a thick inner ring. The card shadow is
599
+ re-stated after the ring rather than replaced by it: `box-shadow` is one property, so naming only
600
+ the ring here would drop the lift the moment somebody clicked into the field. */
601
+ .search:focus-within {
602
+ border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
603
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent), var(--card-shadow);
604
+ }
605
+ .search svg { width: 18px; height: 18px; color: var(--text-dim); flex: none; }
606
+ .search input { flex: 1; min-width: 0; border: none; background: none; color: var(--text); font: inherit; font-size: var(--fs-base); outline: none; }
607
+ .search input:focus-visible { box-shadow: none; } /* the box carries the breeze; the input has no ring of its own */
608
+
609
+ /* ---- the filter: a button at the field's own end, and the shelves in a sheet under it ---- */
610
+ .fwrap { position: relative; } /* the panel hangs off this, not off .search, so focus styles stay put */
611
+
612
+ /* A 30px hit area inside a box whose height is set by the input's line box: the negative block margin
613
+ pulls its outer height back under that line, so adding this button does NOT make the field taller.
614
+ Measured before and after — the field is the same height it was with the chip row. */
615
+ .fbtn {
616
+ flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin-block: -6px;
617
+ border: none; background: none; padding: 0; border-radius: var(--radius-sm); cursor: pointer;
618
+ color: var(--text-dim);
619
+ transition: color 0.25s var(--ease-out), background 0.25s var(--ease-out);
620
+ }
621
+ /* `.search svg` sets colour on the ELEMENT, and a direct declaration beats an inherited one — so
622
+ without this the button's own colour (and the accent below) would never reach its icon. Equal
623
+ specificity, later in the sheet, so this wins. */
624
+ .fbtn svg { width: 18px; height: 18px; color: inherit; }
625
+ .fbtn:hover, .fbtn:focus-visible { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }
626
+ /* the row that used to announce the active shelf is gone, so the button carries it */
627
+ .fbtn.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
628
+ .fpanel {
629
+ position: absolute; inset-inline: 0; top: calc(100% + 8px); z-index: 5;
630
+ display: flex; flex-direction: column; gap: 2px; padding: 6px;
631
+ /* the column's own material — a translucent ground would let the cards read through the labels */
632
+ background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
633
+ box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.45);
634
+ backdrop-filter: blur(30px) saturate(1.4);
635
+ -webkit-backdrop-filter: blur(30px) saturate(1.4);
636
+ }
637
+ .opt {
638
+ display: flex; align-items: center; gap: 9px; padding: 9px 10px;
639
+ border: none; background: none; border-radius: var(--radius-sm); cursor: pointer;
640
+ color: var(--text); font: inherit; font-size: var(--fs-sm); text-align: start;
641
+ transition: background 0.2s var(--ease-out);
642
+ }
643
+ .opt:hover, .opt:focus-visible { background: color-mix(in srgb, var(--text) 8%, transparent); }
644
+ .opt .lb { flex: 1; min-width: 0; }
645
+ /* the count is the shelf's size, so a person knows what is behind a word before spending a click */
646
+ .opt .n { flex: none; font-variant-numeric: tabular-nums; font-size: var(--fs-2xs); color: var(--text-dim); }
647
+ /* hidden, not absent: the tick keeps its column either way, so the labels do not jump sideways when
648
+ the selection moves from one row to another */
649
+ .opt .tick { flex: none; width: 15px; height: 15px; color: var(--accent); visibility: hidden; }
650
+ .opt.active .tick { visibility: visible; }
651
+ .opt.active .lb { font-weight: 600; }
652
+
653
+ .grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
654
+ /* no entrance animation — when you walk into the room, everyone is already in their place.
655
+ the cards are simply there on load; the only motion is a whisper on hover. */
656
+ .empty { text-align: center; color: var(--text-dim); padding: 40px 0; }
657
+ </style>
@@ -0,0 +1,120 @@
1
+ ---
2
+ // queries: catalogue card · app.zone card · pin.games card · the storefront card
3
+ //
4
+ // One card, for any apex's storefront. It was `AppCard` in app.zone and moved here whole when
5
+ // pin.games arrived: a card is machinery, and the words inside it are the apex's.
6
+ export interface CatalogueEntry {
7
+ /** stable key — the apex's own i18n is keyed by it, and it is never localized */
8
+ id: string;
9
+ name: string;
10
+ description: string;
11
+ url: string;
12
+ category: string;
13
+ /** ISO date the persona joined. The NEW badge is computed from it, never stored. */
14
+ added: string;
15
+ }
16
+ // No category on the card any more: it moved to a filter row above the grid. It was the same handful of
17
+ // words repeated down the page — "Fitness" four times — carrying almost no information per card, while
18
+ // costing every card a block-level line. As a filter it earns its space instead, and it surfaces the
19
+ // ?category= slice the catalog already supported but never showed. data-category stays: the filter reads it.
20
+ const { app, name, desc, isNew, newLabel } = Astro.props as {
21
+ app: App; name: string; desc: string; isNew: boolean; newLabel: string;
22
+ };
23
+ // The persona's canonical icon — every persona serves /icon.svg on its own host. One face everywhere.
24
+ const icon = `${app.url}/icon.svg`;
25
+ ---
26
+
27
+ <a
28
+ class="card"
29
+ href={app.url}
30
+ data-name={`${name} ${app.name}`.toLowerCase()}
31
+ data-category={app.category}
32
+ data-id={app.id.toLowerCase()}
33
+ data-added={app.added}
34
+ >
35
+ <img class="icon" src={icon} alt="" width="60" height="60" loading="lazy" decoding="async" />
36
+ <div class="meta">
37
+ <div class="top">
38
+ <h2>{name}</h2>
39
+ {isNew && <span class="badge new">{newLabel}</span>}
40
+ </div>
41
+ <p>{desc}</p>
42
+ </div>
43
+ <svg class="chev" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
44
+ <path d="M9 18l6-6-6-6" />
45
+ </svg>
46
+ </a>
47
+
48
+ <style>
49
+ .card {
50
+ display: flex;
51
+ align-items: center;
52
+ gap: 16px;
53
+ /* 16, down from 18, to pay for the larger icon: the icon is now what sets the card's height, and the
54
+ two px back on each side keep the row pitch where the shorter card put it. */
55
+ padding: 16px;
56
+ /* The card's own material, not the page column's — see --card-* in tokens.css. In light mode this is
57
+ solid white with a real shadow; in dark it is the glass, which there actually refracts. */
58
+ background: var(--card-bg);
59
+ border: 1px solid var(--border);
60
+ border-radius: var(--radius-lg);
61
+ backdrop-filter: var(--card-blur);
62
+ -webkit-backdrop-filter: var(--card-blur);
63
+ box-shadow: var(--card-shadow);
64
+ text-decoration: none;
65
+ color: var(--text);
66
+ transition: transform 0.3s var(--ease-spring), border-color 0.3s, background 0.3s,
67
+ box-shadow 0.3s var(--ease-out);
68
+ will-change: transform;
69
+ }
70
+ /* the lift and the shadow move together — a card that rises without its shadow growing reads as a
71
+ sticker sliding, not an object leaving the page */
72
+ .card:hover {
73
+ transform: translateY(-2px);
74
+ border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
75
+ box-shadow: var(--card-shadow-hover);
76
+ }
77
+ .card:active { transform: translateY(-1px) scale(0.99); }
78
+
79
+ /* the persona's canonical icon — a self-contained squircle, one face everywhere */
80
+ .icon {
81
+ flex: none;
82
+ /* 60. It was 72 for a day, on the reasoning that the icons are the only colour on this page — everything
83
+ else is ink on paper — so more of them should read as livelier. It read as too big instead, and that
84
+ turns out to be measurable rather than a matter of taste: the text beside the icon is a fixed 66px (a
85
+ 16px title on a 1.5 line box, 3px, then two clamped bio lines at 13.44/1.45), so at 72 the icon
86
+ overshot the text by six pixels and the icon, not the content, was setting the card's height.
87
+ 64 is the first size that fits inside the text block. 60 gives the same card height as 64 — past the
88
+ crossover the text sets it either way — so the last four pixels cost no vertical space and buy a
89
+ quieter mark. */
90
+ width: 60px;
91
+ height: 60px;
92
+ border-radius: var(--radius-md);
93
+ object-fit: cover;
94
+ box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.35);
95
+ }
96
+
97
+ .meta { flex: 1; min-width: 0; }
98
+ .top { display: flex; align-items: center; gap: 8px; }
99
+ h2 { font-size: var(--fs-base); font-weight: 600; letter-spacing: -0.01em; }
100
+ /* Clamped to two lines. The bios run from one line to four, which made every card a different height
101
+ and the column read ragged; the full text is on the app's own page anyway. */
102
+ p {
103
+ color: var(--text-dim); font-size: var(--fs-xs); line-height: 1.45; margin: 3px 0 0;
104
+ display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
105
+ }
106
+ .badge {
107
+ font-size: 0.66rem;
108
+ font-weight: 700;
109
+ text-transform: uppercase;
110
+ letter-spacing: 0.04em;
111
+ padding: 2px 7px;
112
+ border-radius: var(--radius-pill);
113
+ }
114
+ /* Only NEW is shown now (for a persona's first week). LIVE/beta/soon badges were dropped — every card
115
+ in the catalog is live by definition, so a "live" badge said nothing. */
116
+ .badge.new { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
117
+
118
+ .chev { flex: none; width: 20px; height: 20px; color: var(--text-dim); transition: transform 0.3s var(--ease-out); }
119
+ .card:hover .chev { transform: translateX(3px); color: var(--accent); }
120
+ </style>
package/src/Posts.astro CHANGED
@@ -260,7 +260,9 @@ const vars = [
260
260
  .phandle, .dot, .pt { color: var(--text-dim); font-weight: 400; }
261
261
  /* a persona's name in the feed links to its profile (X-style); humans have no link */
262
262
  .pn { color: inherit; text-decoration: none; }
263
- .pn:hover b { color: var(--accent-text, var(--accent)); }
263
+ /* `a.pn`, not `.pn` — a persona whose home we were not told renders as a span, and a name that
264
+ lights up under the cursor while going nowhere is a promise the markup cannot keep. */
265
+ a.pn:hover b { color: var(--accent-text, var(--accent)); }
264
266
  a.pt { text-decoration: none; }
265
267
  a.pt:hover { text-decoration: underline; }
266
268
  .pbd { font-size: var(--fs-sm); line-height: 1.5; margin-block-start: 4px; }
@@ -352,11 +354,21 @@ const vars = [
352
354
  const mo = Math.floor(d / 30); if (mo < 12) return agoRtf.format(-mo, "month");
353
355
  return agoRtf.format(-Math.floor(d / 365), "year");
354
356
  };
355
- // where a persona lives, so another persona's name in this feed can link to its profile. The two
356
- // apexes are their own domains; every app persona is a subdomain of app.zone. The API may send the
357
- // canonical personaUrl, in which case it wins.
358
- const homeOf = (h: string): string =>
359
- h === "justai" ? "https://justai.pro" : h === "app.zone" ? "https://app.zone" : `https://${h}.app.zone`;
357
+ // queries: a persona's name links to the wrong place · a comment links to a host that does not
358
+ // exist · pin.games persona linked to app.zone · where does a commenter's name go
359
+ //
360
+ // WHERE A PERSONA LIVES IS A FACT WE ARE TOLD, NOT ONE WE DERIVE. The API sends `personaUrl`,
361
+ // built from the registry's own `home`, for every persona that has one — and `home` is required
362
+ // by the manifest, so in practice that is all of them.
363
+ //
364
+ // There used to be a fallback here that guessed: justai → justai.pro, app.zone → app.zone, and
365
+ // everything else → `${handle}.app.zone`. It was correct for exactly as long as one apex existed.
366
+ // The day a game persona comments on a feed, that guess sends the reader to a host that has never
367
+ // existed — and it does it silently, in a link, on somebody else's page.
368
+ //
369
+ // So there is no fallback now. If we were not told where a persona lives, its name is rendered
370
+ // WITHOUT a link: a name that goes nowhere is a small disappointment, and a name that goes
371
+ // somewhere wrong is a broken ecosystem seen by a stranger.
360
372
  const comment = (c: C, last: boolean): string => {
361
373
  const ln = last ? "" : `<span class="ln"></span>`;
362
374
  if (c.isPersona) {
@@ -370,10 +382,11 @@ const vars = [
370
382
  ? `<img class="mk" src="${esc(c.authorAvatar)}" alt="">`
371
383
  : `<span style="font-size:16px">${esc(c.authorGlyph || "✦")}</span>`;
372
384
  const nm = own ? NAME : esc(c.authorName); // own name is authored markup; an API name is escaped
373
- const purl = own ? "#profile" : `${c.personaUrl || homeOf(c.authorHandle)}/#profile`;
385
+ const purl = own ? "#profile" : c.personaUrl ? `${c.personaUrl}/#profile` : null;
374
386
  const at = own ? PERSONA : c.authorHandle;
375
387
  const meta = `${at ? `@${esc(at)} ` : ""}· ${timeAgo(c.createdAt)}`;
376
- return `<div class="trow${last ? " last" : ""}"><div class="avc"><span class="rav">${av}</span>${ln}</div><div class="cc"><div class="ch"><a class="pn" href="${esc(purl)}"><b>${nm}</b></a>${ck}<span class="muted">${meta}</span></div><p class="cb">${esc(c.body)}</p></div></div>`;
388
+ const nameEl = purl ? `<a class="pn" href="${esc(purl)}"><b>${nm}</b></a>` : `<span class="pn"><b>${nm}</b></span>`;
389
+ return `<div class="trow${last ? " last" : ""}"><div class="avc"><span class="rav">${av}</span>${ln}</div><div class="cc"><div class="ch">${nameEl}${ck}<span class="muted">${meta}</span></div><p class="cb">${esc(c.body)}</p></div></div>`;
377
390
  }
378
391
  const initial = esc(String(c.authorName || "?").slice(0, 1));
379
392
  // A person needs the handle MORE than a persona does — display names collide constantly among
package/src/ground.css CHANGED
@@ -60,6 +60,18 @@
60
60
  scheme-aware: Apple lightens red on dark backgrounds (#FF453A) and deepens it on light
61
61
  (#FF3B30), and a single value would read wrong on one of them. */
62
62
  --danger: #ff453a;
63
+
64
+ /* THE CARD — a storefront tile's own surface, and the reason it is here rather than in the apex
65
+ that used to own it. The Catalogue moved into this package the day pin.games became real, and
66
+ it arrived consuming four tokens that had stayed behind in app.zone's stylesheet. Nothing broke
67
+ on app.zone, which still grounds them; the harness caught it anyway, and the founder put the
68
+ stake in the ground in one line: *why would pin.games have shadowless cards — whatever I see on
69
+ app.zone, that is it.* These are app.zone's own values, read rather than redesigned, so the
70
+ second storefront is the first one. */
71
+ --card-bg: rgba(28, 28, 34, 0.55);
72
+ --card-blur: blur(30px) saturate(1.6);
73
+ --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.32);
74
+ --card-shadow-hover: 0 2px 6px rgba(0, 0, 0, 0.4), 0 12px 28px -14px rgba(0, 0, 0, 0.55);
63
75
  }
64
76
 
65
77
  @media (prefers-color-scheme: light) {
@@ -71,6 +83,13 @@
71
83
  --surface: rgba(255, 255, 255, 0.7);
72
84
  --surface-2: rgba(0, 0, 0, 0.05);
73
85
  --danger: #ff3b30;
86
+
87
+ /* Light is not the dark card with a different fill: the blur goes away entirely. A frosted
88
+ panel over a pale page reads as a smudge, so app.zone drops it and pays the shadow instead. */
89
+ --card-bg: #fff;
90
+ --card-blur: none;
91
+ --card-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 12px -4px rgba(16, 24, 40, 0.1);
92
+ --card-shadow-hover: 0 2px 4px rgba(16, 24, 40, 0.06), 0 12px 26px -8px rgba(16, 24, 40, 0.15);
74
93
  }
75
94
  }
76
95