feat(client): label attempted-move announcements by player

Attempted-move lines (no_such_piece, no_legal_moves, wont_help, illegal_move)
now show "White — " or "Black — " prefix derived from ply parity. Removed
alarm-red err styling; replaced with neutral dim+italic via .entry.attempt.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
claude (blind_chess)
2026-05-18 20:04:49 -04:00
parent 5282237027
commit 0498f1de43
@@ -24,9 +24,11 @@
<header>Moderator</header> <header>Moderator</header>
<div class="log" bind:this={scrollEl}> <div class="log" bind:this={scrollEl}>
{#each visible as a, i (i)} {#each visible as a, i (i)}
<div class="entry" class:err={a.text === 'illegal_move' || a.text === 'no_such_piece' || a.text === 'no_legal_moves' || a.text === 'wont_help'}> {@const isAttempt = a.text === 'no_such_piece' || a.text === 'no_legal_moves' || a.text === 'wont_help' || a.text === 'illegal_move'}
{@const actor = a.ply % 2 === 0 ? 'White' : 'Black'}
<div class="entry" class:attempt={isAttempt}>
<span class="ply">{a.ply > 0 ? `#${a.ply}` : ''}</span> <span class="ply">{a.ply > 0 ? `#${a.ply}` : ''}</span>
<span class="text">{moderatorText(a.text, a.payload)}</span> <span class="text">{isAttempt ? `${actor} ` : ''}{moderatorText(a.text, a.payload)}</span>
</div> </div>
{:else} {:else}
<div class="empty muted">The moderator is silent.</div> <div class="empty muted">The moderator is silent.</div>
@@ -67,7 +69,7 @@
border-bottom: 1px dashed rgba(255,255,255,0.05); border-bottom: 1px dashed rgba(255,255,255,0.05);
} }
.entry:last-child { border-bottom: none; } .entry:last-child { border-bottom: none; }
.entry.err .text { color: #f87171; } .entry.attempt .text { color: var(--text-dim); font-style: italic; }
.ply { .ply {
color: var(--text-dim); color: var(--text-dim);
font-family: ui-monospace, monospace; font-family: ui-monospace, monospace;