Open any toolbox from a list in Sokko TCG's toolbox drawer
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 23m40s
Validate and deploy Sokko G / deploy (push) Successful in 16s

Every Sokko TCG section now offers the top bar's toolbox button. Instead of
linking a toolbox, the drawer lists all toolboxes (linked to a game or not)
as wide rows with a large cover, opens the one chosen, and remembers it on
the device. Memos and alerts follow the toolbox shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-30 14:31:53 +01:00
parent e8fe27a90f
commit 8253f74c90
17 changed files with 359 additions and 45 deletions

View file

@ -0,0 +1,27 @@
// Rôle : retient, sur cet appareil, la toolbox choisie dans le tiroir de Sokko TCG, pour la rouvrir directement à la visite suivante.
// Une préférence d'affichage, pas une donnée de toolbox : elle n'entre ni dans les liaisons ni dans les exports.
import { useCallback, useState } from "react";
const CARDS_TOOLBOX_STORAGE_KEY = "sokkog:cards-toolbox";
function readChoice() {
try {
return globalThis.localStorage?.getItem(CARDS_TOOLBOX_STORAGE_KEY) || "";
} catch {
return "";
}
}
export function useCardsToolboxChoice() {
const [toolboxId, setToolboxId] = useState(readChoice);
const choose = useCallback((nextId) => {
setToolboxId(nextId || "");
try {
if (nextId) globalThis.localStorage?.setItem(CARDS_TOOLBOX_STORAGE_KEY, nextId);
else globalThis.localStorage?.removeItem(CARDS_TOOLBOX_STORAGE_KEY);
} catch {
// Stockage refusé (navigation privée, quota) : le choix vaut pour la session.
}
}, []);
return [toolboxId, choose];
}