From e502155af70164eb6690ccaa5f593e6b37746817 Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Fri, 12 Jun 2026 21:05:20 -0700 Subject: [PATCH] More detailed card tooltips Card tooltips now show what a card represents *as* an Obstacle (the rulebook obstacle table entry) in addition to its suit theme, which is relevant when challenging another Pi-Rat. The obstacle tables are served from the backend via GET /api/obstacles (single source of truth in cards.py) and cached client-side in cards.js, with a retry so a transient first-load failure doesn't silently disable the tooltips. Enriched everywhere cards appear in the challenge flow: hand/board cards (Card.svelte), PvP defend buttons and the temporary-obstacle line (ChallengePanel), and the duel card selector, which also shows an inline description of what the chosen card becomes as an Obstacle. Co-Authored-By: Claude Fable 5 --- TODO.md | 1 - frontend/src/components/Card.svelte | 7 +-- .../components/scene/ChallengePanel.svelte | 6 +-- .../components/scene/CharacterSheet.svelte | 11 ++++- frontend/src/lib/cards.js | 49 +++++++++++++++++-- frontend/src/main.js | 4 ++ src/pirats/routes_scene.py | 12 +++++ 7 files changed, 77 insertions(+), 13 deletions(-) diff --git a/TODO.md b/TODO.md index d183187..9f81124 100644 --- a/TODO.md +++ b/TODO.md @@ -5,7 +5,6 @@ ## Minor Gameplay Polish -- [ ] **More detailed card tooltips.** Currently cards have a tooltip that show what they represent when played on obstacles, but they don't show what they represent *as* obstacles, which is relevant when issuing challenges to other Pi-Rats. - [ ] **Add invite link to Admin panel** - [ ] **Add crew/player/rat name to page title, if available**. This will make it easier to distinguish tabs/browser history entries - [ ] **Save active sessions in browser local storage**. Whenever you create or join a game, your browser local storage should be updated with the game ID, player ID, crew name, and player/rat names (if available). Going to the home page with saved sessions should provide a menu of games to rejoin in addition to the ability to start a new game. It should be possible to delete entries from this list, which only affects the browser local storage, not the backend database, and is undoable (the entry doesn't disappear immediately, it's just marked as deleted until page refresh). diff --git a/frontend/src/components/Card.svelte b/frontend/src/components/Card.svelte index c879341..93c7f55 100644 --- a/frontend/src/components/Card.svelte +++ b/frontend/src/components/Card.svelte @@ -1,5 +1,5 @@ {#if size === 'mini'} diff --git a/frontend/src/components/scene/ChallengePanel.svelte b/frontend/src/components/scene/ChallengePanel.svelte index c31b95c..17afa53 100644 --- a/frontend/src/components/scene/ChallengePanel.svelte +++ b/frontend/src/components/scene/ChallengePanel.svelte @@ -1,6 +1,6 @@