From 99a438ff1d8845c6f6fb11c070f9404bb5b5dd52 Mon Sep 17 00:00:00 2001 From: Shinuwa Date: Thu, 19 Nov 2026 11:00:33 +0100 Subject: [PATCH] Show the shop shortfall above the buy button so buttons stay aligned MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "Il vous manque … poussières." sat under the button and pushed it below the buttons of the other items in the row. The shortfall and the pending opening notice now come before the button, which stays at the bottom of every card. Co-Authored-By: Claude Opus 5.5 --- e2e/nebula-cards.spec.js | 11 +++++++++++ website/src/features/cards/ShopPanel.jsx | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/e2e/nebula-cards.spec.js b/e2e/nebula-cards.spec.js index 2f9351a..666af84 100644 --- a/e2e/nebula-cards.spec.js +++ b/e2e/nebula-cards.spec.js @@ -509,6 +509,17 @@ test("player opens and reveals a three-card pack", async ({ page }) => { await expect(shopPackItem.locator('img[src="/static/img/cards/stardust/back.webp"]')).toBeVisible(); await expect(shopPackItem.getByRole("button", { name: "Acheter et ouvrir" })).toBeDisabled(); await expect(shopPackItem).toContainText("Il vous manque 60 poussières."); + // Le manque s'affiche au-dessus du bouton : les boutons d'une même rangée d'articles restent alignés. + const buyButtons = await page.locator(".nebula-shop-grid .nebula-shop-item-actions > button:last-child").evaluateAll((buttons) => buttons.map((button) => ({ + row: Math.round(button.closest(".nebula-shop-item").getBoundingClientRect().top), bottom: Math.round(button.getBoundingClientRect().bottom), + last: button === button.parentElement.lastElementChild + }))); + expect(buyButtons.length).toBeGreaterThan(1); + for (const button of buyButtons) { + expect(button.last).toBe(true); + expect(button.bottom).toBe(buyButtons.find((other) => other.row === button.row).bottom); + } + await page.locator(".nebula-shop-grid").screenshot({ path: join(tmpdir(), "sokkog-cards-shop.png") }); // Le solde ne met plus en avant les ouvertures achetées : la boutique est une grille d'articles illustrés. await expect(page.locator(".nebula-shop-wallet")).not.toContainText("Ouvertures achetées"); // Le solde est sous le menu, et la page se limite à son en-tête et à ses articles. diff --git a/website/src/features/cards/ShopPanel.jsx b/website/src/features/cards/ShopPanel.jsx index 102de4c..4e3d421 100644 --- a/website/src/features/cards/ShopPanel.jsx +++ b/website/src/features/cards/ShopPanel.jsx @@ -88,8 +88,9 @@ function QuantityItem({ id, cover, title, description, quantityLabel, rateLabel, {rateLabel} - + {/* Au-dessus du bouton : il reste aligné sur ceux des autres articles. */} {max < 1 &&

Il vous manque {formatStardust(price - stardust)}.

} + ; @@ -149,9 +150,9 @@ export function ShopPanel({ catalog, state, runMutation, busy, content, onOpenPa

{shopPack.name}

{content.packDescription}

- 0 || Boolean(state.pendingOpening)} onClick={buyPack} /> {packMissing > 0 &&

Il vous manque {formatStardust(packMissing)}.

} {state.pendingOpening &&

{content.packPending}

} + 0 || Boolean(state.pendingOpening)} onClick={buyPack} />
}