Reveal the Stardust pack in the shop, keep the campaign expiry row inside its card and stabilise the Aniimo e2e tests
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 22m9s
Validate and deploy Sokko G / deploy (push) Successful in 12s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-19 13:35:22 +01:00
parent 99724cb6ba
commit 2c10df0370
7 changed files with 65 additions and 27 deletions

View file

@ -279,7 +279,7 @@ export function CardsPage({ siteContent, cardsConfig, playerSection = "", player
{section === "expeditions" && <ExpeditionsPanel {...panelProps} content={{ ...content.expeditions, cardSheet: content.cardSheet }} joinId={decodeURIComponent(playerSubsection)} />}
{section === "packs" && <PackPanel {...panelProps} content={content.packs} reserveContent={content.home} />}
{section === "collection" && <CollectionPanel {...panelProps} headingContent={content.collection} recyclingContent={content.recycling} onStartTransfer={startTransfer} />}
{section === "shop" && <ShopPanel {...panelProps} content={content.shop} onOpenPacks={openPacks} />}
{section === "shop" && <ShopPanel {...panelProps} content={content.shop} openingContent={content.packs} />}
{section === "transfers" && <TransfersPanel {...panelProps} content={content.transfers} draft={transferDraft} onDraftUsed={clearTransferDraft} />}
{section === "history" && <HistoryPanel catalog={catalog} state={state} content={content.history} />}
{section === "account" && <AccountPanel state={state} busy={busy || offline} content={content.account} privacy={content.privacy} privacyContact={cardsConfig.privacyContact} privacyController={cardsConfig.privacyController} onDelete={deleteAccount} runMutation={runMutation} />}

View file

@ -125,7 +125,8 @@ function OpeningOdds({ catalog, opening, collection, content, shopShare }) {
</section>;
}
function OpeningStage({ catalog, opening, onComplete, onDismiss, onOpenAnother, focusOnMountRef, remaining, busy, content, shopShare }) {
// Révélation d'une ouverture ; la Boutique l'utilise aussi pour son paquet, qui s'ouvre sans quitter la boutique.
export function OpeningStage({ catalog, opening, onComplete, onDismiss, onOpenAnother, focusOnMountRef, remaining, busy, content, shopShare }) {
const [revealed, setRevealed] = useState(new Set());
const [finishedReveals, setFinishedReveals] = useState(new Set());
const [completed, setCompleted] = useState(false);

View file

@ -1,13 +1,14 @@
// Rôle : boutique du joueur ; affiche le solde de poussière d'étoiles, achète des ouvertures de paquet et, quand les Expéditions
// sont ouvertes, change la poussière en Éclats d'étoile (Pont des Veilleurs) et vend les objets de la boutique (Parchemin d'oubli,
// Rose des vents).
import { useState } from "react";
import { buyOpening, buyShopItem, buyShopPack, convertStardust } from "./cardsApi.js";
import { useRef, useState } from "react";
import { buyOpening, buyShopItem, buyShopPack, completeOpening, convertStardust } from "./cardsApi.js";
import { DashboardAside } from "./CardsDashboard.jsx";
import { CollectionCardBack } from "./CollectionCardBack.jsx";
import { EclatsBalance, StardustBalance } from "./Currency.jsx";
import { fillTemplate } from "./dailyShare.js";
import { formatEclats } from "./expeditionFormat.js";
import { OpeningStage } from "./PackPanel.jsx";
import { formatStardust } from "./stardustFormat.js";
@ -96,8 +97,10 @@ function QuantityItem({ id, cover, title, description, quantityLabel, rateLabel,
</article>;
}
export function ShopPanel({ catalog, state, runMutation, busy, content, onOpenPacks }) {
export function ShopPanel({ catalog, state, runMutation, busy, content, openingContent }) {
const [notice, setNotice] = useState("");
const [completedOpening, setCompletedOpening] = useState(null);
const focusOnMount = useRef(false);
const { wallet, shop } = state;
// Les Éclats ne servent qu'aux Expéditions : le Pont n'est proposé que lorsqu'elles sont ouvertes.
@ -106,11 +109,29 @@ export function ShopPanel({ catalog, state, runMutation, busy, content, onOpenPa
const shopPack = catalog.collections.find((collection) => collection.packCategory === "shop" && collection.active);
const packMissing = Math.max(0, shop.shopPackPrice - wallet.stardust);
// L'ouverture attribuée s'affiche dans la section Paquets, qui gère la révélation.
// Le paquet acheté se révèle ici même : « Retour » ramène à la boutique. Une autre ouverture en cours reste dans Paquets.
const isShopOpening = (opening) => catalog.collections.find((collection) => collection.id === opening?.collectionId)?.packCategory === "shop";
const opening = (isShopOpening(state.pendingOpening) ? state.pendingOpening : null) || completedOpening;
if (opening) return <OpeningStage
key={opening.id}
catalog={catalog}
opening={opening}
busy={busy}
content={openingContent}
shopShare={shop.shopPackShare}
remaining={{ reserve: state.recharge.openingsBalance, purchased: wallet.purchasedOpenings }}
onComplete={async () => {
setCompletedOpening(opening);
return runMutation(() => completeOpening(opening.id));
}}
onDismiss={() => setCompletedOpening(null)}
focusOnMountRef={focusOnMount}
onOpenAnother={null}
/>;
async function buyPack() {
setNotice("");
const result = await runMutation(() => buyShopPack());
if (result?.opening) onOpenPacks();
await runMutation(() => buyShopPack());
}
async function buy(count) {