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:
@@ -24,9 +24,11 @@
|
||||
<header>Moderator</header>
|
||||
<div class="log" bind:this={scrollEl}>
|
||||
{#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="text">{moderatorText(a.text, a.payload)}</span>
|
||||
<span class="text">{isAttempt ? `${actor} — ` : ''}{moderatorText(a.text, a.payload)}</span>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="empty muted">The moderator is silent.</div>
|
||||
@@ -67,7 +69,7 @@
|
||||
border-bottom: 1px dashed rgba(255,255,255,0.05);
|
||||
}
|
||||
.entry:last-child { border-bottom: none; }
|
||||
.entry.err .text { color: #f87171; }
|
||||
.entry.attempt .text { color: var(--text-dim); font-style: italic; }
|
||||
.ply {
|
||||
color: var(--text-dim);
|
||||
font-family: ui-monospace, monospace;
|
||||
|
||||
Reference in New Issue
Block a user