More UX improvements.

This commit is contained in:
Greyson Parrelli
2026-07-24 09:07:54 -04:00
parent 962e3bb5ff
commit 10b6346874
7 changed files with 60 additions and 20 deletions
+6 -5
View File
@@ -5,21 +5,22 @@ import { CardView } from './CardView'
interface Props {
canGrant: boolean // shop phase — grants only land then
pack: string // active pack, so the catalog matches the game
send: (msg: ClientMessage) => void
}
// DebugPanel is a testing aid (server DEBUG mode only): a collapsible drawer
// listing every card in the game, tier by tier. Clicking one drops it into
// your deck for free, off-turn.
export function DebugPanel({ canGrant, send }: Props) {
// listing every card in the active pack, tier by tier. Clicking one drops it
// into your deck for free, off-turn.
export function DebugPanel({ canGrant, pack, send }: Props) {
const [open, setOpen] = useState(false)
const [catalog, setCatalog] = useState<Card[]>([])
useEffect(() => {
fetchCatalog()
fetchCatalog(pack)
.then(setCatalog)
.catch(() => setCatalog([]))
}, [])
}, [pack])
const tiers = [...new Set(catalog.map((c) => c.tier ?? 0))].sort((a, b) => a - b)
+1 -1
View File
@@ -157,7 +157,7 @@ export function Table({ session, onLeave }: { session: Session; onLeave: () => v
)}
{error && <div className="toast">{error}</div>}
{view.debug && (
<DebugPanel canGrant={view.phase === 'shop'} send={send} />
<DebugPanel canGrant={view.phase === 'shop'} pack={view.pack} send={send} />
)}
</div>
)