Credibility pass: comments say what the code can't, and the seams are gone
Engine: pit-rim exits live in one helper (pitRimExits) shared by the resolver and the automaton; chargeReach names the six-stride cap; dust sight is inDust + dustAtEnd; PushPending is exported once; the force-field counter builds its events in one list; drawUnderSlowDeath says what it draws under. Test groups are named for the rule they pin, not the revision that introduced it. Client: one smoothstep; one edgeScar per battle-scarred edge; one board-zone rule (which also seats the caption strip on phones); the compass names live in SIDE_NAMES; net.flash() is the one toast; MediaQuery replaces two hand-rolled matchMedia listeners; sprites carry their sizes as plain numbers and their CSS in one rule each; canvas helpers are formatted like the rest of the tree. Comments that told how a cel or a fallback used to look now say what it draws. The actions-over notice no longer blames a pickup when slime ended the turn. Server and ops: dataRoot() is the one data directory; headlineOf builds its deeds without a cast; the rollup and skills read the same way the code behaves. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
85690f0e23
commit
6e49fc9020
@@ -204,9 +204,10 @@ function safeBase(rawHost: string, rawProto: string): string {
|
||||
* carried home, a blow that landed, a spell cast — before the bare fact
|
||||
* of whose turn it was. */
|
||||
function headlineOf(data: ShareData): string | null {
|
||||
// A card retired since the share was written keeps its id as its name.
|
||||
const name = (id: string | null) => { if (!id) return "a spell"; try { return cardDef(id).name; } catch { return id; } };
|
||||
let best: { rank: number; text: string } | null = null;
|
||||
const offer = (rank: number, text: string) => { if (!best || rank > best.rank) best = { rank, text }; };
|
||||
const deeds: { rank: number; text: string }[] = [];
|
||||
const offer = (rank: number, text: string) => { deeds.push({ rank, text }); };
|
||||
for (const step of data.steps) {
|
||||
for (const e of step.events) {
|
||||
switch (e.type) {
|
||||
@@ -225,7 +226,9 @@ function headlineOf(data: ShareData): string | null {
|
||||
}
|
||||
}
|
||||
}
|
||||
return best ? (best as { text: string }).text : null;
|
||||
let best: { rank: number; text: string } | null = null;
|
||||
for (const d of deeds) if (!best || d.rank > best.rank) best = d;
|
||||
return best?.text ?? null;
|
||||
}
|
||||
|
||||
function shareHtml(id: string, data: ShareData, rawHost: string, rawProto: string): string {
|
||||
|
||||
Reference in New Issue
Block a user