The status line on your move says what the other side just did, in place of "Checkmate their King", which told the player nothing

"Vritra’s Warrior went to 2a2.", "took the Hero on 2e5", "struck 2g4 from the air", "and is a Hero now"; "The first move is yours." before any move.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CCLa2PaEeCj8njQZSWGqHx
This commit is contained in:
Eric WagonerandClaude Fable 5.1 committed 2026-10-27 18:03:02 -04:00
1 parent 3c453c86b2
commit 2de6e1f6ba
1 file changed
+12 -2
+12 -2
View File
@@ -116,6 +116,16 @@
}
const shownStory = $derived(shownPly > 0 ? storyOf(shownPly) : '');
/** What the other side just did, in a few words, for the status line when it is your move. */
const lastLine = $derived.by(() => {
const m = g.moves.at(-1);
if (!m) return '';
const who = nameOfSide(m.by);
if (m.afar) return `${who}’s Dragon struck ${squareName(m.to)} from the air.`;
const did = m.captured ? `took the ${NAMES[m.captured]} on` : 'went to';
return `${who}’s ${NAMES[m.kind]} ${did} ${squareName(m.to)}${m.promoted ? ' and is a Hero now' : ''}.`;
});
// --- Choosing and moving ---
let selected = $state<number | null>(null);
const targets = $derived(selected === null ? [] : legalMovesFrom(g.cells, selected, g.setup));
@@ -200,7 +210,7 @@
{:else if room.spectating}
<strong>{nameOfSide(g.toMove)} to move</strong> · {SIDE_NAMES[g.toMove]}{#if inCheckNow}&nbsp;· <span class="check">in check</span>{/if} · <span class="muted">move {g.moves.length + 1}</span>
{:else if yourMove}
<strong>Your move</strong> · {SIDE_NAMES[mySide!]}{#if inCheckNow}&nbsp;· <span class="check">your King is in check</span>{/if} · <span class="goal">Checkmate {nameOfSide(g.toMove === 'gold' ? 'scarlet' : 'gold')}’s King.</span>
<strong>Your move</strong> · {SIDE_NAMES[mySide!]}{#if inCheckNow}&nbsp;· <span class="check">your King is in check</span>{/if} · <span class="last">{lastLine || 'The first move is yours.'}</span>
{:else if room.view.playingOn}
<strong>The drakes play on</strong> · <span class="muted">a move every few seconds</span>&nbsp;<button type="button" class="link" onclick={() => room.hurry()}>play the rest at once</button>
{:else}
@@ -302,7 +312,7 @@
color: var(--ember);
}
.goal {
.last {
color: var(--bone);
}