sokko-g/website/src/features/cards
Shinuwa ced3bc818d
Some checks failed
Validate and deploy Sokko G / validate (push) Failing after 19m52s
Validate and deploy Sokko G / deploy (push) Has been skipped
Add an expedition set workshop to build sets without equipping
- "Créer un set" opens a workshop from the explorer frame, or from the
  tab bar while preparation is hidden, even during an expedition: pick
  an explorer, draft its equipment, see the stats against its current
  gear and the tag synergies with cross-highlight, then save the set.
- The server accepts a set's equipment as a validated draft
  (SET_EQUIPMENT_INVALID for closed slots, unowned or duplicate commons).
- Tag search from the workshop opens the commons picker with that tag
  chosen; empty pickers and the empty sets window get a centered
  empty state with a clear or create action.
- Card tags read as a calm list and synergy shows inside the stats box;
  CardPicker moves to its own file.
- Tests, e2e paths and design docs cover the workshop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 15:40:19 +01:00
..
admin Rebalance expedition powers: Adaptation trades surplus for a big boost on the weakest stat, the storm lantern pays loot per unparried danger, forced march no longer costs loot, the rally bell drops its solo penalty, and tune the loot powers to comparable values 2026-12-05 12:41:08 +01:00
daily Let players finish a daily quest game started before midnight instead of being sent back to the start 2026-12-04 10:12:45 +01:00
expeditions Add an expedition set workshop to build sets without equipping 2026-12-05 15:40:19 +01:00
mirror Let players finish a daily quest game started before midnight instead of being sent back to the start 2026-12-04 10:12:45 +01:00
mobile Let players use Sokko TCG from a phone through a mobile fallback mode 2026-12-03 23:55:35 +01:00
rendering Let players use Sokko TCG from a phone through a mobile fallback mode 2026-12-03 23:55:35 +01:00
team Let players finish a daily quest game started before midnight instead of being sent back to the start 2026-12-04 10:12:45 +01:00
AccountPanel.jsx Turn the comments that describe functions into JSDoc so the editor shows them on hover 2026-12-01 11:51:47 +01:00
cardCache.js Turn the comments that describe functions into JSDoc so the editor shows them on hover 2026-12-01 11:51:47 +01:00
CardDetailModal.jsx Split dailyShare.js and document the shared exported functions with JSDoc 2026-12-01 13:32:20 +01:00
cardsApi.js Add an expedition set workshop to build sets without equipping 2026-12-05 15:40:19 +01:00
CardsDashboard.jsx Let players use Sokko TCG from a phone through a mobile fallback mode 2026-12-03 23:55:35 +01:00
CardsFilterMenu.jsx Turn the comments that describe functions into JSDoc so the editor shows them on hover 2026-12-01 11:51:47 +01:00
CardsHomePanel.jsx Let players use Sokko TCG from a phone through a mobile fallback mode 2026-12-03 23:55:35 +01:00
CardsPage.jsx Let players use Sokko TCG from a phone through a mobile fallback mode 2026-12-03 23:55:35 +01:00
cardsReserve.js Turn the comments that describe functions into JSDoc so the editor shows them on hover 2026-12-01 11:51:47 +01:00
cardsRoutes.js Let players use Sokko TCG from a phone through a mobile fallback mode 2026-12-03 23:55:35 +01:00
cardStats.js Let players compare card stats in the collection, rebalance card profiles with a full refunded reset of upgrades, and fix best boosts that sometimes fired in the previous zone 2026-12-04 23:17:23 +01:00
CollectionPanel.jsx Let players switch collection views from clear tiles, filter explorer and equipment pickers with a tag and name autocomplete and multi-stat builds, read card stats as gauges with art badges for affinity, tags and worn commons, see short power effects, and save expedition sets that move shared commons between explorers 2026-12-05 12:05:04 +01:00
collectionState.js Turn the comments that describe functions into JSDoc so the editor shows them on hover 2026-12-01 11:51:47 +01:00
CollectionStats.jsx Let players compare card stats in the collection, rebalance card profiles with a full refunded reset of upgrades, and fix best boosts that sometimes fired in the previous zone 2026-12-04 23:17:23 +01:00
Currency.jsx Turn the comments that describe functions into JSDoc so the editor shows them on hover 2026-12-01 11:51:47 +01:00
DailyTip.jsx Split dailyShare.js and document the shared exported functions with JSDoc 2026-12-01 13:32:20 +01:00
dailyTips.js Turn the comments that describe functions into JSDoc so the editor shows them on hover 2026-12-01 11:51:47 +01:00
dropRates.js Turn the comments that describe functions into JSDoc so the editor shows them on hover 2026-12-01 11:51:47 +01:00
GuildPanel.jsx Let players use Sokko TCG from a phone through a mobile fallback mode 2026-12-03 23:55:35 +01:00
guildQuests.js Turn the comments that describe functions into JSDoc so the editor shows them on hover 2026-12-01 11:51:47 +01:00
HistoryPanel.jsx Let players compare card stats in the collection, rebalance card profiles with a full refunded reset of upgrades, and fix best boosts that sometimes fired in the previous zone 2026-12-04 23:17:23 +01:00
OpeningReserve.jsx Document Sokko G's architecture and folders, and move JavaScript file headers to JSDoc @file blocks 2026-12-01 09:42:13 +01:00
PackPanel.jsx Let players use Sokko TCG from a phone through a mobile fallback mode 2026-12-03 23:55:35 +01:00
PrivacyNotice.jsx Document Sokko G's architecture and folders, and move JavaScript file headers to JSDoc @file blocks 2026-12-01 09:42:13 +01:00
rarityWords.js Turn the comments that describe functions into JSDoc so the editor shows them on hover 2026-12-01 11:51:47 +01:00
README.md Add an expedition set workshop to build sets without equipping 2026-12-05 15:40:19 +01:00
rewardText.js Turn the comments that describe functions into JSDoc so the editor shows them on hover 2026-12-01 11:51:47 +01:00
ShopPanel.jsx Split dailyShare.js and document the shared exported functions with JSDoc 2026-12-01 13:32:20 +01:00
stardustFormat.js Turn the comments that describe functions into JSDoc so the editor shows them on hover 2026-12-01 11:51:47 +01:00
textFormat.js Split dailyShare.js and document the shared exported functions with JSDoc 2026-12-01 13:32:20 +01:00
TransferComposer.jsx Put trading and giving up front and suggest the players who need each card 2026-12-01 17:01:56 +01:00
TransfersPanel.jsx Centre the finished transfers toggle under the trade and gift tiles 2026-12-02 10:12:02 +01:00
transferSuggestions.js Put trading and giving up front and suggest the players who need each card 2026-12-01 17:01:56 +01:00
useCardsConfig.js Give Sokko TCG's interface files headers that explain their role, callers and pitfalls 2026-12-01 09:56:58 +01:00
useCardsHref.js Let players use Sokko TCG from a phone through a mobile fallback mode 2026-12-03 23:55:35 +01:00
useDayEnded.js Let players finish a daily quest game started before midnight instead of being sent back to the start 2026-12-04 10:12:45 +01:00

Interface de Sokko TCG

Les pages du jeu de cartes dans le navigateur : tableau de bord du joueur (#/cards/...) et administration (#/cards/admin/...). Le serveur fait autorité : cette interface affiche l'état qu'il renvoie et lui envoie les actions. Serveur : services/cards/README.md.

Les fichiers et classes CSS portent souvent le préfixe nebula : c'est l'ancien nom de code du TCG (voir le glossaire d'ARCHITECTURE.md).

Par où commencer

  1. CardsPage.jsx : point d'entrée de la route. Lit la session et l'état (/session, /state), gère le cache hors connexion, choisit la section affichée et fournit runMutation aux panneaux pour envoyer une action. Les sections du joueur sont listées dans PLAYER_NAVIGATION ; les quêtes de la Guilde sont des sous-sections (SUBSECTION_PARENTS).
  2. cardsApi.js : une fonction par route du serveur. Garde le jeton CSRF reçu avec la session et l'ajoute à chaque requête d'écriture.
  3. CardsDashboard.jsx : cadre commun des tableaux de bord joueur et administration (menu des sections, encart sous le menu).
  4. rendering/NebulaCard.jsx : rendu d'une carte (inclinaison, finitions holographiques, animation de révélation), utilisé partout.

Organisation

La racine garde la page, l'état partagé et les sections hors Guilde ; chaque quête de la Guilde et le rendu des cartes ont leur sous-dossier.

Chemin Contenu
racine : CardsPage, cardsApi.js, cardCache.js, cardsReserve.js, useCardsConfig.js, CardsDashboard Page, appels au serveur, cache, configuration, cadre des tableaux de bord
racine : cardsRoutes.js, useCardsHref.js Adresses des sections en version complète et en mode mobile, sections proposées sur téléphone (MOBILE_SECTIONS), règle de redirection ; liens internes des panneaux (useCardsHref)
racine : useDayEnded.js Passage de minuit pour la Carte du jour, le Miroir et la Course : la partie commencée la veille reste affichée et jouable, un bandeau propose ensuite celle du nouveau jour
racine : CardsHomePanel, DailyTip, PackPanel, OpeningReserve, CollectionPanel, CollectionStats, CardDetailModal, ShopPanel, TransfersPanel, TransferComposer, HistoryPanel, AccountPanel, PrivacyNotice Sections du joueur hors Guilde (DailyTip est l'« Astuce du jour » de l'accueil, pas la Carte du jour). La collection a deux affichages : l'album et « Stats » (CollectionStats), qui compare les profils des cartes possédées des Expéditions et classe un build
racine : GuildPanel, guildQuests.js Hall de la Guilde et liste des quêtes
racine : textFormat.js, stardustFormat.js, rarityWords.js, rewardText.js, collectionState.js, cardStats.js, dropRates.js, Currency.jsx Règles d'affichage partagées. cardStats.js donne le type de profil d'une carte (Spécialiste, Duo, Trio, Polyvalente, Équilibrée) et le classement d'un build (la plus faible des stats choisies, puis leur somme). textFormat.js contient fillTemplate (remplissage des textes de site.json) et formatCountdown
daily/ Carte du jour (dailyFormat.js : recherche par nom, verdict d'un essai, texte à partager)
expeditions/ Expéditions, amélioration des cartes (CardPlan, AwakeningPicker), expeditionFormat.js ; filtres des fenêtres de choix de l'explorateur et des communes (PickerFilters.jsx : recherche à menu d'étiquettes et de noms, tri et build ; règles dans pickerFilters.js) ; sets d'explorateur et d'équipements (ExpeditionSets.jsx ; atelier « Créer un set » sous les onglets, en brouillon, ExpeditionSetBuilder.jsx ; prévision, résumé et stats du brouillon dans expeditionSets.js)
team/ Équipe du jour et Course des courants (Race*, raceRun.js)
mirror/ Miroir brisé
mobile/ Mode mobile de dépannage : application sans le shell (MobileCardsApp), cadre avec barre d'onglets (MobileCardsLayout), reconnaissance d'un téléphone et choix « Version complète » (mobileDevice.js), carte révélée vue en grand (OpeningCardZoom)
rendering/ NebulaCard, dos des collections, particules holographiques (holo*.js, Canvas 2D), effets d'ouverture
admin/ Administration : AdminPanel.jsx (navigation), un fichier par section, useAdminDashboard.js (données)

Une nouvelle quête de la Guilde reçoit son propre sous-dossier.

Les fichiers *Format.js ne contiennent que de l'affichage. Les règles du jeu sont sur le serveur ; quand l'interface doit rejouer un calcul (la Course des courants dans team/raceRun.js et team/RaceLive.jsx), elle importe directement les règles pures du serveur (services/cards/race-rules.js) au lieu de les recopier.

À savoir avant de modifier

  • Textes : dans website/public/data/site.json, clé cards (passée aux panneaux en content). Pas de texte en dur dans le JSX.
  • Styles : website/src/styles/_nebula-*.scss, chargés avec la route par cards-route.scss, pas par main.scss.
  • Administration : chargée à la demande (React.lazy), seulement pour un administrateur. Le serveur vérifie les droits de son côté.
  • Réponses tardives : une réponse réseau ancienne ne doit pas écraser un état plus récent. CardsPage numérote ses lectures et ses mutations (stateGeneration, latestMutation). Les pages qui ont leur propre vue ignorent aussi une lecture dépassée : ExpeditionsPanel avec un compteur (latest), MirrorPanel avec un drapeau active remis à faux quand la lecture est remplacée. Reprendre ce principe pour toute nouvelle page qui se relit seule.
  • Mode mobile de dépannage : #/mobile/cards réutilise ces panneaux sans le shell du site, pour les sections de MOBILE_SECTIONS (cardsRoutes.js). main.jsx y redirige un téléphone qui ouvre #/cards/..., sauf choix « Version complète ». Ses adaptations restent sous .nebula-mobile (cards-mobile-route.scss), et sous body.nebula-mobile-body pour les fenêtres, rendues hors de la page. Quand une mise en page diffère vraiment (lignes du choix d'un explorateur ou des communes, fiche du recrutement), le composant la choisit avec useCardsMobile() ; principes dans DESIGN_SYSTEM.md.
  • Liens entre sections : un panneau du joueur passe par useCardsHref(), jamais par #/cards/... écrit en dur, sinon un joueur sur téléphone repart vers la version complète (tests/nebula-cards-mobile.test.mjs le vérifie). Les liens à partager (invitation d'expédition, Carte du jour) gardent l'adresse complète : la redirection s'occupe des téléphones.
  • Ajouter une quête : voir la recette de CONTRIBUTING.md.

Vérifier

npm run check:cards
npx playwright test e2e/nebula-cards.spec.js --config playwright.cards.config.js
# mode mobile seul, sans repasser les parcours ordinateur
npx playwright test --config playwright.cards.config.js --project phone-cards --no-deps