From 9a4de4a23dbe66e986046e7f392c5c0a54f30386 Mon Sep 17 00:00:00 2001 From: Shinuwa Date: Thu, 5 Nov 2026 19:26:49 +0100 Subject: [PATCH] Hide the redundant Aniimo skill heading for a single selection The skill heading only helps tell two selected elements apart, so it now shows for double selections alone. Co-Authored-By: Claude Opus 5.5 --- DESIGN_SYSTEM.md | 7 ++++--- e2e/aniimo-elements.spec.js | 12 +++++++----- website/src/features/games/aniimo/AniimoElements.jsx | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/DESIGN_SYSTEM.md b/DESIGN_SYSTEM.md index 9c9b120..facf5ba 100644 --- a/DESIGN_SYSTEM.md +++ b/DESIGN_SYSTEM.md @@ -921,9 +921,10 @@ de 1100 px, puis s'empilent en dessous. Dans chaque compétence, les trois group offensifs et défensifs utilisent trois colonnes régulières. Les boxes utilisent une hauteur pilotée par leur contenu, égale au sein de chaque rangée, et repassent sur une colonne quand leur panneau mesure moins de 460 px. Chaque compétence -sélectionnée est introduite par une barre `nds-section-heading` : le libellé -« Compétence » et le badge doré contenant l'icône et le nom de l'élément sont -regroupés à gauche. Elle conserve ses propres groupes offensifs (« Peu efficace », « Efficacité normale », +sélectionnée est introduite par une barre `nds-section-heading` uniquement lors +d'une sélection double : le libellé « Compétence » et le badge doré contenant +l'icône et le nom de l'élément sont regroupés à gauche. Pour une sélection simple, +la barre redondante est masquée. Chaque compétence conserve ses propres groupes offensifs (« Peu efficace », « Efficacité normale », « Efficace »). Les groupes défensifs vont de « Très résistant » à « Très vulnérable » et affichent le produit des affinités sélectionnées. Les groupes vides sont omis. Chaque box associe un libellé explicite, le multiplicateur numérique et la liste diff --git a/e2e/aniimo-elements.spec.js b/e2e/aniimo-elements.spec.js index 825df3d..8e1e4e1 100644 --- a/e2e/aniimo-elements.spec.js +++ b/e2e/aniimo-elements.spec.js @@ -26,11 +26,7 @@ for (const width of [768, 1440]) { await expect(defense).toHaveClass(/nds-panel/); const group = (panel, name) => panel.getByRole("region", { name, exact: true }); const waterAttack = attack.getByRole("region", { name: /Compétence.*Eau/ }); - const skillHeading = waterAttack.getByRole("heading", { level: 3, name: /Compétence.*Eau/ }); - await expect(skillHeading).toHaveClass(/nds-section-heading/); - await expect(skillHeading).toHaveCSS("justify-content", "flex-start"); - await expect(skillHeading).toHaveCSS("column-gap", "12px"); - await expect(skillHeading.locator(".aniimo-skill-element")).toContainText("Eau"); + await expect(waterAttack.locator(".aniimo-skill-heading")).toHaveCount(0); await expect(group(waterAttack, "Efficace")).toContainText("×1,6"); await expect(group(waterAttack, "Efficace").getByRole("listitem")).toHaveText(["Feu", "Roche"]); await expect(group(defense, "Résistant")).toContainText("×0,625"); @@ -43,6 +39,12 @@ for (const width of [768, 1440]) { await expect(ice).toHaveAttribute("aria-pressed", "true"); await expect(picker.getByRole("button", { name: "Feu", exact: true })).toBeDisabled(); const iceAttack = attack.getByRole("region", { name: /Compétence.*Glace/ }); + const skillHeading = waterAttack.getByRole("heading", { level: 3, name: /Compétence.*Eau/ }); + await expect(skillHeading).toHaveClass(/nds-section-heading/); + await expect(skillHeading).toHaveCSS("justify-content", "flex-start"); + await expect(skillHeading).toHaveCSS("column-gap", "12px"); + await expect(skillHeading.locator(".aniimo-skill-element")).toContainText("Eau"); + await expect(iceAttack.locator(".aniimo-skill-heading")).toHaveCount(1); await expect(group(waterAttack, "Efficace").getByRole("listitem")).toHaveText(["Feu", "Roche"]); await expect(group(iceAttack, "Peu efficace")).toContainText("×0,625"); await expect(group(iceAttack, "Peu efficace").getByRole("listitem")).toHaveText(["Feu", "Roche", "Glace"]); diff --git a/website/src/features/games/aniimo/AniimoElements.jsx b/website/src/features/games/aniimo/AniimoElements.jsx index 178deb7..2298956 100644 --- a/website/src/features/games/aniimo/AniimoElements.jsx +++ b/website/src/features/games/aniimo/AniimoElements.jsx @@ -58,8 +58,8 @@ export function AniimoElements({ game, aniimo, content }) { {results ?

{content.attack}

{content.attackHelp}

- {selected.map((element, index) =>
-

{content.skill}

+ {selected.map((element, index) =>
1 ? `aniimo-attack-${element}` : undefined}> + {selected.length > 1 ?

{content.skill}

: null} ({ element: row.element, multiplier: row.attack[index].multiplier }))} prefix={`aniimo-attack-${element}-band`} content={content} t={t} />
)}