From bc867c95a156c63ffd55cdde88c9dc6fc4a63077 Mon Sep 17 00:00:00 2001 From: Tim McCarthy Date: Fri, 12 Jun 2026 01:17:30 -0700 Subject: [PATCH] Add player re-join links to admin page Each player row now has Open/Copy actions for their dashboard link, so the creator can recover access for players who lose their URL. Co-Authored-By: Claude Fable 5 --- TODO.md | 20 ++++++++++---------- frontend/src/pages/Admin.svelte | 22 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/TODO.md b/TODO.md index 44e4dc5..d6c2181 100644 --- a/TODO.md +++ b/TODO.md @@ -4,20 +4,20 @@ - [ ] **Allow Deep players to roll back game events.** This may require some updates to how game state is handled. Feel free to propose significant overhauls/refactors to enable this cleanly, I am not attached to the current architecture at all. +- [ ] **Dead Pi-Rat re-roll flow.** I suspect this is badly broken, as it was implemented in a rush by an older model. In particular, other players will need to contribute likes/hates and techniques, which I believe are not currently implemented. This flow should also be used for new players who join after initial character creation, and should take place as a between-scenes phase after Deep Upkeep. + ## Missing Features -- [ ] **Smell-based temporary nicknames at game start.** When joining, players type an arbitrary lobby name; only re-rolled recruits get "Recruit {smell}". We should keep the lobby names, but be clear that these refer to the players, not the Pi-Rats, who should be identified by their smell until they earn a Name. -- [ ] **Tooltip reminders of card suit themes**. When you mouse over a card, there should be reminders that e.g. hearts are thematically social skills. Check the manual for the other suits. -- [ ] **Name string transfer on a refused Name Tax.** Mechanically the Objective (and Rank) transfer and the winner gets a "claim your name" prompt; this should be updated so that the stealer literally takes the other Pi-Rat's name, leaving them demoted to "Recruit {smell}". -- [ ] **First-scene framing requirement** ("must establish the Pi-Rats are on a ship they can steal; don't start far from water") is not surfaced anywhere in the scene-setup UI. We could add an interstitial phase that prompts the Deep to explain the scene before we move to the scene UI with the objectives. -- [ ] **Dead Pi-Rat re-roll flow.** I suspect this is badly broken, as it was implemented in a rush by an older model. In particular, other players will need to contribute likes/hates and techniques, which I believe are not currently implemented. This flow should also be used for new players who join after initial character creation, and should take place as a between-scenes phase after Deep Upkeep. -- [ ] **Event log visibility**. The event log should be visible in all phases, not just during a scene. -- [ ] **Admin page link**. The admin/creator player should always have a link to the admin page available to them. +- [x] **Incomplete admin page.**: The Admin page should include links for players to re-join the game. +- [ ] **Less intrusive link copied notification.** When you copy a join link from the lobby page, it pops up an alert() to let you know the link was copied. I'd prefer something more subtle, and more importantly not modal. +- [ ] **Rules endpoint** Make a nicely formatted HTML version of the rulebook. It should probably also be linked from a help menu somewhere that's always available, rather than only being surfaced on the splash page of the site (which joining players don't even see). Work from "Rats with Gats beta.pdf" rather than "RULEBOOK.md", which is a low fidelity AI summary of the former. + +## Cosmetic + +- [ ] **Refactor the CSS.** Make it easy to re-theme by keeping the definitions of primary/background/highlight/etc colors confined to a few specific styles. If this requires adopting some kind of CSS framework/preprocessing, so be it. +- [ ] **Re-styling**. The entire app could use a face lift, but in particular the splash page is ugly. ## Worth Double-Checking / Minor - [ ] **Dev/prod server flows.** Investigate where assets are served from in both development and production workflows. Make sure we're not committing any compiled svelte code. In production, the app should be used through the Nix flake, which should handle the compile step when the flake is built. -- [ ] **Refactor the CSS.** Make it easy to re-theme by keeping the definitions of primary/background/highlight/etc colors confined to a few specific styles. If this requires adopting some kind of CSS framework/preprocessing, so be it. - [ ] **More formal database migration procedures.** -- [ ] **Rules endpoint** Make a nicely formatted HTML version of the rulebook. It should probably also be linked from a help menu somewhere that's always available, rather than only being surfaced on the splash page of the site (which joining players don't even see) -- [ ] **Re-styling**. The entire app could use a face lift, but in particular the splash page is ugly. diff --git a/frontend/src/pages/Admin.svelte b/frontend/src/pages/Admin.svelte index 1becf0a..9302878 100644 --- a/frontend/src/pages/Admin.svelte +++ b/frontend/src/pages/Admin.svelte @@ -8,6 +8,19 @@ let data = null; let error = ''; + let copiedPlayerId = null; + let copiedTimer = null; + + function rejoinLink(playerId) { + return `${window.location.origin}/#/game/${gameId}/player/${playerId}`; + } + + function copyRejoinLink(playerId) { + navigator.clipboard.writeText(rejoinLink(playerId)); + copiedPlayerId = playerId; + clearTimeout(copiedTimer); + copiedTimer = setTimeout(() => { copiedPlayerId = null; }, 2000); + } onMount(() => { // Try to load admin_key from local storage @@ -58,6 +71,7 @@ Role Status Rank + Re-join Link @@ -78,6 +92,14 @@ {/if} {p.rank} + + + {/each}