diff --git a/AGENTS.md b/AGENTS.md index 1f627c7..21541d6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -24,6 +24,8 @@ When you run into a repeatable problem during testing (e.g. port assignment coll - Before browser testing, check whether the default Vite port belongs to this project. If it is occupied by another app, start this frontend with `npm --prefix frontend run dev -- --host 127.0.0.1 --port 5174 --strictPort` and use that URL. Local server binds may require sandbox escalation. +- In-memory SQLite tests that use FastAPI TestClient need `poolclass=StaticPool` as well as `check_same_thread=False`, so request threads share the database after commits. Otherwise they can fail with `no such table`. + ## Versioning & changelog The app shows its version number and a player-facing changelog in the ☰ menu → About. Both come from `frontend/src/lib/changelog.js` (rendered by `frontend/src/components/AboutModal.svelte`). diff --git a/TODO.md b/TODO.md index 09ce290..d11edd2 100644 --- a/TODO.md +++ b/TODO.md @@ -15,7 +15,7 @@ - [x] Remove display of current deck size - [x] Voting status in the between-scenes phase should be visual, not text-based - [x] Players should be able to see who they voted for -- [ ] The "ready" button between scenes is redundant. Allow players to vote, and allow them to change their vote, but once all players have voted, display the result and move on +- [x] The "ready" button between scenes is redundant. Allow players to vote, and allow them to change their vote, but once all players have voted, display the result and move on ## Rules diff --git a/frontend/src/assets/css/upkeep.css b/frontend/src/assets/css/upkeep.css index 9880808..cbe38ac 100644 --- a/frontend/src/assets/css/upkeep.css +++ b/frontend/src/assets/css/upkeep.css @@ -1,7 +1,7 @@ /* --- Between-scenes upkeep --- */ .between-grid { display: grid; - grid-template-columns: 1fr 1fr; + grid-template-columns: minmax(0, 1fr); gap: 2rem; margin: 2rem 0; } diff --git a/frontend/src/components/UpkeepPhase.svelte b/frontend/src/components/UpkeepPhase.svelte index 0d24c5a..66e6545 100644 --- a/frontend/src/components/UpkeepPhase.svelte +++ b/frontend/src/components/UpkeepPhase.svelte @@ -6,7 +6,7 @@ export let state; let voting = false; - let readying = false; + let voteError = ""; let confirming = false; let selectedVoteId = ''; @@ -134,28 +134,18 @@ async function submitVote() { if (!selectedVoteId) return; voting = true; + voteError = ""; try { await apiRequest(`/game/${state.game.id}/player/${state.player.id}/submit-vote`, 'POST', { nominated_id: selectedVoteId }); } catch(e) { - console.error(e); + voteError = e.message; } finally { voting = false; } } - async function setReady() { - readying = true; - try { - await apiRequest(`/game/${state.game.id}/player/${state.player.id}/ready-next`, 'POST'); - } catch(e) { - console.error(e); - } finally { - readying = false; - } - } - async function confirmRefresh() { confirming = true; try { @@ -173,7 +163,9 @@
Upkeep and tallying. Nominate a crewmate to Rank Up, redraw hand cards for resting Deep players, and ready up for the next scene.
+{state.game.phase === 'between_scenes' + ? 'Vote for a crewmate to rank up. You can change your vote until everyone has voted.' + : 'Voting complete. The resting Deep refreshes their hand before the next scene.'}
{#if state.player.is_dead && !state.player.is_ghost && !state.player.needs_reroll} @@ -204,7 +196,9 @@Every player (including the Deep) nominates one crewmate who best exemplified pirate qualities in the previous scene. Previous Deep players are ineligible to receive votes.
+ {#if state.game.phase === 'between_scenes'} +Nominate another Pi-Rat who best showed their pirate spirit this scene. The Deep cannot receive votes.
+ {/if} {#if state.game.phase === 'deep_upkeep'}✔️ Voting complete! No one ranked up this time.
{/if}✓ Your vote: {votedNominee ? displayName(votedNominee) : "Unavailable crewmate"}
No living crewmates left to nominate — you skip voting this round. Go ahead and ready up.
+No eligible crewmates — voting skipped.
{voteError}
{/if} {/if}⚠️ You must nominate a crewmate above before you can ready up.
- - {:else} - {#if state.player.is_ready} -Ready! Waiting for other players to ready up...
- -