Let administrators save particles on mythic variations
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 22m41s
Validate and deploy Sokko G / deploy (push) Successful in 14s

Lightning, twinkles and fireflies move from a visual lab prototype to real
settings. The catalog declares the animations, their motifs, sliders and zones;
migration 24 stores each variation's particles; the service validates and
normalizes them behind a dedicated admin route and records the change in the
history. Published editions carry the particle fields, so every card of the
variation shows them in collections, card sheets and openings. The Particles
tab of the variation editor now saves with the same Enregistrer button as the
finish and tunings, including when a variation is created.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-22 16:44:32 +01:00
parent f77a0ca577
commit 6737a89a1c
21 changed files with 419 additions and 124 deletions

View file

@ -665,7 +665,7 @@ test("administrator navigates sections, manages mythic content and previews visu
await dragonVariations.nth(1).getByRole("button", { name: "Régler Prisme spectral — Cosmique" }).click();
await expect(dragonVariations.nth(1)).toHaveAttribute("data-selected", "true");
await expect(mythicEditorPanel.locator(".nebula-admin-card-opening-block")).toContainText("Prisme spectral — Cosmique");
// La variation sélectionnée se règle dans un panneau à onglets : Holo, puis Particules, sans animation pour l'instant.
// La variation sélectionnée se règle dans un panneau à onglets : Holo, puis Particules (aucune animation au départ).
const cosmicSettings = mythicEditorPanel.getByRole("region", { name: "Réglages de Prisme spectral — Cosmique" });
await expect(cosmicSettings.getByRole("tab")).toHaveText(["Holo", "Particules"]);
// Un effet dont la carte n'a pas les fichiers reste visible mais désactivé, avec la liste des fichiers manquants.
@ -681,7 +681,7 @@ test("administrator navigates sections, manages mythic content and previews visu
await expect(trashButton).toHaveClass(/nds-icon-button/);
await expect(trashButton).not.toHaveText(/./);
await cosmicSettings.getByRole("tab", { name: "Particules" }).click();
await expect(selectTrigger(cosmicSettings, "Animation")).toBeDisabled();
await expect(selectTrigger(cosmicSettings, "Animation")).toBeEnabled();
await expect(selectTrigger(cosmicSettings, "Animation")).toHaveText("Aucune");
await cosmicSettings.getByRole("tab", { name: "Holo" }).click();
// Changer la finition d'une variation possédée : confirmation, même identifiant, nouvelle finition visible.
@ -751,6 +751,22 @@ test("administrator navigates sections, manages mythic content and previews visu
await expect.poll(async () => { const edition = await tunedEdition(); return [edition.holoIntensity, edition.holoLevel]; }).toEqual([undefined, undefined]);
await expect(tunedCard).not.toHaveAttribute("data-holo-level");
await expect(tunedCard).not.toHaveAttribute("data-holo-intensity");
// Les particules s'enregistrent avec le même bouton : la carte les affiche avant, la configuration publiée après.
await tunedSettings.getByRole("tab", { name: "Particules" }).click();
await chooseOption(tunedSettings, "Animation", "Lucioles");
await expect(tunedSettings.getByRole("slider", { name: "Nombre" })).toBeVisible();
await expect(tunedCard).toHaveAttribute("data-flare", "fireflies");
await expect(dragonVariations.first()).toContainText("Non enregistrée");
await tunedSettings.getByRole("button", { name: "Enregistrer" }).click();
await expect.poll(async () => (await tunedEdition()).flareId).toBe("fireflies");
await expect(dragonVariations.first()).not.toHaveAttribute("data-modified");
await expect(tunedSettings.locator('.nebula-admin-mythic-settings-preview .nebula-card-flare[data-flare="fireflies"]')).toHaveCount(1);
// Retirer les particules : « Aucune », puis Enregistrer.
await chooseOption(tunedSettings, "Animation", "Aucune");
await tunedSettings.getByRole("button", { name: "Enregistrer" }).click();
await expect.poll(async () => (await tunedEdition()).flareId).toBeUndefined();
await expect(tunedCard).not.toHaveAttribute("data-flare");
await tunedSettings.getByRole("tab", { name: "Holo" }).click();
await mythicEditorPanel.getByRole("button", { name: "Fermer" }).click();
await expect(mythicEditorPanel).toHaveCount(0);
await expect(dragonTileButton).toHaveAttribute("aria-pressed", "false");