Keep crew roster order stable across role changes

This commit is contained in:
2026-09-04 19:40:10 -07:00
parent 53df97e3a5
commit 9b673cb8bc
4 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -28,7 +28,7 @@
## Unknown - need to clarify what these mean ## Unknown - need to clarify what these mean
- [ ] Temporary names - [ ] Temporary names
- [ ] Consistent player list order - [x] Consistent player list order
- [ ] Crew objectives reveal area should be connected to button - [ ] Crew objectives reveal area should be connected to button
## Fixes ## Fixes
+1 -2
View File
@@ -8,7 +8,6 @@
let openTargetId = null; let openTargetId = null;
$: captainId = state.game.captain_player_id; $: captainId = state.game.captain_player_id;
$: crew = [...state.players].sort((a, b) => (a.role === 'deep' ? 1 : 0) - (b.role === 'deep' ? 1 : 0));
$: openTarget = openTargetId ? state.players.find(p => p.id === openTargetId) : null; $: openTarget = openTargetId ? state.players.find(p => p.id === openTargetId) : null;
function iconFor(p) { function iconFor(p) {
@@ -64,7 +63,7 @@
<aside class="crew-column phase-crew-column" aria-label="Crew roster"> <aside class="crew-column phase-crew-column" aria-label="Crew roster">
<div class="crew-bubbles"> <div class="crew-bubbles">
{#each crew as p (p.id)} {#each state.players as p (p.id)}
{#if state.game.phase === 'lobby'} {#if state.game.phase === 'lobby'}
<div <div
class="crew-bubble is-static" class="crew-bubble is-static"
@@ -35,8 +35,6 @@
} }
} }
// Pi-Rats first, the Deep last; otherwise keep join order.
$: crew = [...state.players].sort((a, b) => (a.role === 'deep' ? 1 : 0) - (b.role === 'deep' ? 1 : 0));
$: captainId = state.game.captain_player_id; $: captainId = state.game.captain_player_id;
$: openTarget = openTargetId ? state.players.find(p => p.id === openTargetId) : null; $: openTarget = openTargetId ? state.players.find(p => p.id === openTargetId) : null;
$: crewDone = [state.game.completed_crew_1, state.game.completed_crew_2, state.game.completed_crew_3].filter(Boolean).length; $: crewDone = [state.game.completed_crew_1, state.game.completed_crew_2, state.game.completed_crew_3].filter(Boolean).length;
@@ -54,7 +52,7 @@
<div class="crew-column"> <div class="crew-column">
<div class="crew-bubbles"> <div class="crew-bubbles">
{#each crew as p (p.id)} {#each state.players as p (p.id)}
<button <button
class="crew-bubble" class="crew-bubble"
class:is-you={p.id === state.player.id} class:is-you={p.id === state.player.id}
+2 -1
View File
@@ -6,10 +6,11 @@
// - Add a CHANGELOG entry only when a commit changes something players can // - Add a CHANGELOG entry only when a commit changes something players can
// see. Skip refactors, tests, and tooling. Keep wording player-facing. // see. Skip refactors, tests, and tooling. Keep wording player-facing.
export const VERSION = 42; export const VERSION = 43;
// Newest first. Each entry: { version, date: 'YYYY-MM-DD', changes: [string, ...] }. // Newest first. Each entry: { version, date: 'YYYY-MM-DD', changes: [string, ...] }.
export const CHANGELOG = [ export const CHANGELOG = [
{ version: 43, date: '2026-09-04', changes: ['The crew roster keeps players in the same order when roles or ranks change, including when someone becomes the Deep.'] },
{ version: 42, date: '2026-09-04', changes: ['Gats require a description, including older Gats that were left blank. Read descriptions on character sheets or hover over Gat icons in the crew roster.', 'Gat descriptions and prompts follow Gat Taxes correctly and clear when you create a new recruit.'] }, { version: 42, date: '2026-09-04', changes: ['Gats require a description, including older Gats that were left blank. Read descriptions on character sheets or hover over Gat icons in the crew roster.', 'Gat descriptions and prompts follow Gat Taxes correctly and clear when you create a new recruit.'] },
{ version: 41, date: '2026-09-04', changes: ['Dismiss a completed duel once you have read the result. Other players can still read it, and dismissed results stay hidden after a reload.'] }, { version: 41, date: '2026-09-04', changes: ['Dismiss a completed duel once you have read the result. Other players can still read it, and dismissed results stay hidden after a reload.'] },
{ version: 40, date: '2026-09-04', changes: ['Played cards show a check or cross in the upper corner instead of a green or red outline, so results remain clear in stacked cards.'] }, { version: 40, date: '2026-09-04', changes: ['Played cards show a check or cross in the upper corner instead of a green or red outline, so results remain clear in stacked cards.'] },