From 2ea91c066a713770df4592dce88bbdd401d58cec Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Sun, 14 Jun 2026 20:03:41 -0700 Subject: [PATCH] Refresh the scene dashboard around a crew bubble column MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the roster banner and the standalone character-sheet panel with a left-hand column of crew bubbles. Each bubble shows the player's role icon, name, rank, current hand size, and a ๐Ÿ›ž for the Captain; clicking one pops out that player's character sheet as a modal. - New CrewColumn.svelte: bubbles (Pi-Rats first, Deep last) + an Objectives button that opens a crew-objectives popup. - CharacterSheet.svelte is now a target-driven modal: description, likes/hates, and personal objectives for anyone; secret J/Q/K only on your own sheet; the Duel UI (no "Challenge whom?" โ€” target is fixed) only when a living Pi-Rat views another living Pi-Rat. - ScenePhase.svelte โ†’ 3-column layout (crew | obstacles | hand/deep); crew column collapses to a horizontal strip on narrow screens. - Shared .modal-backdrop/.modal-box/.modal-close moved into components.css; removed the now-dead roster-banner and captain-badge styles. Backend unchanged โ€” the state blob already carries hands, roles, ranks, objectives, and the captain. Co-Authored-By: Claude Opus 4.8 --- TODO.md | 2 +- frontend/src/assets/css/components.css | 72 +++-- frontend/src/assets/css/scene-play.css | 135 ++++++--- frontend/src/components/ScenePhase.svelte | 48 +--- .../components/scene/CharacterSheet.svelte | 265 +++++++++--------- .../src/components/scene/CrewColumn.svelte | 81 ++++++ 6 files changed, 367 insertions(+), 236 deletions(-) create mode 100644 frontend/src/components/scene/CrewColumn.svelte diff --git a/TODO.md b/TODO.md index 03766be..fa6b80d 100644 --- a/TODO.md +++ b/TODO.md @@ -45,7 +45,7 @@ - [ ] **Look for dead code.** While implementing the rollback feature, we discovered /scene/rollback, an unused and buggy single-card-play rollback route that was added but never hooked up to the UI. Look for other code that matches that pattern -- orphan functions and routes that never get called. -- [ ] **Scene dashboard design refresh.** There should be a column of bubbles/buttons to the left of the obstacle list panel. These represent the crew. You can click a Pi-Rat to pop out their character sheet. If the other player is a Pi-Rat in the scene, there's the "challenge them" UI, which no longer needs the "Challenge whom?" since it's tied to a particular character sheet. Finally, there's the personal objective list. There's also an objectives button (at the top level of the hierarchy) which shows a popup for crew objectives. This entirely replaces the character sheet panel on the current dashboard, as well as the roster at the top of the obstacle list. The captain has a steering wheel emoji next to them. The display should also show current hand size for all players. +- [x] **Scene dashboard design refresh.** There should be a column of bubbles/buttons to the left of the obstacle list panel. These represent the crew. You can click a Pi-Rat to pop out their character sheet. If the other player is a Pi-Rat in the scene, there's the "challenge them" UI, which no longer needs the "Challenge whom?" since it's tied to a particular character sheet. Finally, there's the personal objective list. There's also an objectives button (at the top level of the hierarchy) which shows a popup for crew objectives. This entirely replaces the character sheet panel on the current dashboard, as well as the roster at the top of the obstacle list. The captain has a steering wheel emoji next to them. The display should also show current hand size for all players. - [ ] Interaction during a challenge should be promoted to the top of the UI diff --git a/frontend/src/assets/css/components.css b/frontend/src/assets/css/components.css index 7455e4d..6c6cd0f 100644 --- a/frontend/src/assets/css/components.css +++ b/frontend/src/assets/css/components.css @@ -398,25 +398,6 @@ color: var(--ghost); } -.captain-badge { - background: color-mix(in srgb, var(--accent) 14%, transparent); - border: 1px solid var(--accent); - color: var(--accent); - padding: 0.4rem 1rem; - border-radius: 20px; - font-size: 1rem; - font-weight: 700; - font-family: var(--font-heading); - display: inline-flex; - align-items: center; - gap: 0.5rem; -} - -.captain-badge.vacant { - background: color-mix(in srgb, var(--text) 4%, transparent); - border: 1px dashed var(--edge); - color: var(--text-muted); -} /* --- Waiting indicator --- */ .waiting-box, .waiting-indicator { @@ -428,3 +409,56 @@ gap: 0.75rem; } +/* --- Modal overlay (shared by popups) --- */ +.modal-backdrop { + position: fixed; + inset: 0; + z-index: 2000; + display: flex; + align-items: center; + justify-content: center; + padding: 20px; + background: color-mix(in srgb, var(--bg-deep) 70%, transparent); + backdrop-filter: blur(6px); +} + +.modal-box { + position: relative; + max-width: 440px; + width: 100%; + max-height: 88vh; + overflow-y: auto; + padding: 1.75rem; + border: 1px solid var(--edge); + border-radius: var(--radius-md); + box-shadow: var(--shadow-deep); +} + +.modal-box h3 { + margin-top: 0; +} + +.modal-box.sheet-modal { + max-width: 520px; + text-align: left; +} + +.modal-close { + position: absolute; + top: 0.6rem; + right: 0.75rem; + background: transparent; + border: none; + color: var(--text-muted); + font-size: 1.6rem; + line-height: 1; + cursor: pointer; + padding: 0.1rem 0.4rem; + border-radius: var(--radius-sm); +} + +.modal-close:hover { + color: var(--text); + background: color-mix(in srgb, var(--text) 10%, transparent); +} + diff --git a/frontend/src/assets/css/scene-play.css b/frontend/src/assets/css/scene-play.css index 56df859..0d76e1e 100644 --- a/frontend/src/assets/css/scene-play.css +++ b/frontend/src/assets/css/scene-play.css @@ -1,8 +1,9 @@ /* --- Scene board layout --- */ .scene-view-layout { display: grid; - grid-template-columns: 1.4fr 1fr; - gap: 2rem; + grid-template-columns: 180px 1.4fr 1fr; + gap: 1.5rem; + align-items: start; } @media (max-width: 1100px) { @@ -11,6 +12,98 @@ } } +/* --- Crew bubble column --- */ +.crew-column { + display: flex; + flex-direction: column; + gap: 0.75rem; +} + +.crew-objectives-btn { + width: 100%; + padding: 0.6rem 0.5rem; + background: color-mix(in srgb, var(--accent) 14%, transparent); + border: 1px solid var(--accent); + border-radius: var(--radius-md); + color: var(--text); + font-family: var(--font-heading); + font-size: 0.9rem; + cursor: pointer; + transition: var(--transition-smooth); +} + +.crew-objectives-btn:hover { + background: color-mix(in srgb, var(--accent) 24%, transparent); +} + +.crew-bubbles { + display: flex; + flex-direction: column; + gap: 0.6rem; +} + +.crew-bubble { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 0.1rem; + width: 100%; + text-align: left; + padding: 0.55rem 0.7rem; + background: var(--well); + border: 1px solid var(--edge); + border-left: 4px solid var(--pirat); + border-radius: var(--radius-md); + cursor: pointer; + transition: var(--transition-smooth); +} + +.crew-bubble:hover { + background: color-mix(in srgb, var(--text) 8%, transparent); + transform: translateX(2px); +} + +.crew-bubble.is-deep { + border-left-color: var(--deep); + background: color-mix(in srgb, var(--deep) 6%, transparent); +} + +.crew-bubble.is-you { + border-color: var(--accent); + border-left-color: var(--accent); +} + +.crew-bubble.is-ghost { opacity: 0.7; filter: grayscale(0.6); } +.crew-bubble.is-dead { opacity: 0.6; filter: grayscale(0.8); } + +.crew-bubble .bubble-icon { + font-size: 1.1rem; +} + +.crew-bubble .bubble-name { + font-weight: 700; + font-size: 0.9rem; + line-height: 1.15; + overflow-wrap: anywhere; +} + +.crew-bubble .bubble-meta { + font-size: 0.75rem; + color: var(--text-muted); +} + +/* On narrow screens the crew column becomes a horizontal strip above the board */ +@media (max-width: 1100px) { + .crew-bubbles { + flex-direction: row; + flex-wrap: wrap; + } + .crew-bubble { + width: auto; + flex: 1 1 140px; + } +} + .card-header { display: flex; justify-content: space-between; @@ -32,44 +125,6 @@ font-weight: 700; } -/* Scene status banner (captain + roster) */ -.scene-status-banner { - margin-bottom: 1.5rem; - padding: 1rem; - background: var(--well); - border: 1px solid var(--edge); - border-radius: var(--radius-md); - display: flex; - justify-content: space-between; - align-items: center; - flex-wrap: wrap; - gap: 1rem; -} - -.roster-chips { - display: flex; - gap: 0.5rem; - flex-wrap: wrap; - align-items: center; -} - -.roster-chips .roster-label { - font-size: 0.85rem; - color: var(--text-muted); - font-family: var(--font-heading); - margin-right: 0.25rem; -} - -.roster-chips .player-chip { - font-size: 0.8rem; - padding: 0.25rem 0.6rem; - border-radius: 12px; - margin: 0; - display: inline-flex; - align-items: center; - gap: 0.25rem; -} - /* --- Obstacles --- */ .obstacles-container { display: flex; diff --git a/frontend/src/components/ScenePhase.svelte b/frontend/src/components/ScenePhase.svelte index c370ea7..e44ff15 100644 --- a/frontend/src/components/ScenePhase.svelte +++ b/frontend/src/components/ScenePhase.svelte @@ -1,24 +1,22 @@
- -
+ + - + +

๐ŸŒŠ The Obstacle List

@@ -26,45 +24,13 @@
- -
- -
- {#if captain} - - ๐Ÿดโ€โ˜ ๏ธ Captain: {displayName(captain)} (Rank {captain.rank}){isCaptain ? ' โ€” You!' : ''} - - {:else} - - ๐Ÿดโ€โ˜ ๏ธ Captain: None{state.game.completed_crew_1 ? '' : ' (steal a ship first!)'} - - {/if} -
- - -
- Active Roster: - {#each state.players as p} - {#if p.role === 'deep'} - - ๐ŸŒŠ {displayName(p)} (Deep) - - {:else if p.role === 'pirat'} - - {#if p.is_ghost}๐Ÿ‘ป{:else if p.is_dead}๐Ÿ’€{:else}๐Ÿ€{/if} {displayName(p)} (Rank {p.rank}){p.id === state.game.captain_player_id ? ' โญ' : ''} - - {/if} - {/each} -
-
-
- +
{#if state.player.role === "deep"} @@ -90,8 +56,6 @@ {/each}
- - {/if}
diff --git a/frontend/src/components/scene/CharacterSheet.svelte b/frontend/src/components/scene/CharacterSheet.svelte index 1c01306..b295834 100644 --- a/frontend/src/components/scene/CharacterSheet.svelte +++ b/frontend/src/components/scene/CharacterSheet.svelte @@ -1,170 +1,167 @@ -
-

๐Ÿ€ {state.player.name}'s Character Sheet

- {#if state.player.player_name && state.player.player_name !== state.player.name} -

- Played by {state.player.player_name}{#if !state.player.completed_personal_2} โ€” they'll go by their smell until they earn a Name!{/if} -

- {/if} + e.key === 'Escape' && close()} /> -
- {#if error} -
{error}
+