Polish: legible crew roster, End-Scene enforcement, decluttered Hand
- Crew roster bubbles: explicit text color + opaque distinct surface so they're legible and stand out from the page in both themes (the bug was the <button> defaulting to black-on-dark in dark mode). - End-Scene enforcement: unless Dev Mode is on, a scene can't end until every living Pi-Rat has faced a Deep Challenge or the Obstacle List is empty. end_scene_and_transition now returns (ok, msg) and the route surfaces a 400; the Deep sees a ✓/○ challenge-progress badge on each Pi-Rat bubble. 3 new tests cover the gate. - Hand panel: dropped the how-to-play blurb and the title in favor of a low-profile "Your Hand" label. - Bump VERSION to 8 with changelog entry; check off TODO.md Polish items. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import { slide } from 'svelte/transition';
|
||||
import { apiRequest } from '../../lib/api';
|
||||
import { crewLabel } from '../../lib/cards';
|
||||
import { tooltip } from '../../lib/tooltip';
|
||||
import CharacterSheet from './CharacterSheet.svelte';
|
||||
|
||||
export let state;
|
||||
@@ -12,6 +13,17 @@
|
||||
|
||||
$: isDeep = state.player.role === 'deep';
|
||||
|
||||
// Track which Pi-Rats have faced a Deep Challenge this scene so the Deep can
|
||||
// see who still needs one before ending the scene.
|
||||
$: challengedIds = new Set(
|
||||
(state.challenges || [])
|
||||
.filter(c => c.challenge_type === 'deep')
|
||||
.map(c => c.target_player_id)
|
||||
);
|
||||
function hasBeenChallenged(p) {
|
||||
return p.role === 'pirat' && challengedIds.has(p.id);
|
||||
}
|
||||
|
||||
// The Deep ticks Crew Objectives off here (moved from the old Deep panel).
|
||||
async function toggleCrew(type) {
|
||||
objError = '';
|
||||
@@ -51,6 +63,15 @@
|
||||
title="View {p.name}'s character sheet"
|
||||
on:click={() => openTargetId = p.id}
|
||||
>
|
||||
{#if isDeep && p.role === 'pirat'}
|
||||
<span
|
||||
class="challenge-check"
|
||||
class:done={hasBeenChallenged(p)}
|
||||
use:tooltip={hasBeenChallenged(p)
|
||||
? `${p.name} has faced a Challenge this scene.`
|
||||
: `${p.name} hasn't faced a Challenge yet — the scene can't end until they do (or the Obstacle List is cleared).`}
|
||||
>{hasBeenChallenged(p) ? '✓' : '○'}</span>
|
||||
{/if}
|
||||
<span class="bubble-icon">{roleIcon(p)}</span>
|
||||
<span class="bubble-name">{crewLabel(p, captainId)}</span>
|
||||
<span class="bubble-meta">
|
||||
|
||||
Reference in New Issue
Block a user