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

@ -3,7 +3,7 @@
import { useState } from "react";
import { SelectDropdown } from "../../../components/SelectDropdown.jsx";
import { Tabs } from "../../../components/Tabs.jsx";
import { DEFAULT_FLARE_SCOPE, DEFAULT_FLARE_TUNING, FLARE_EFFECTS, FLARE_SCOPES, MATCH_HOLO_FLARE_LABEL, MATCH_HOLO_FLARE_PALETTE } from "../holoFlares.js";
import { DEFAULT_FLARE_SCOPE, DEFAULT_FLARE_TUNING, flareMotifOf, MATCH_HOLO_FLARE_LABEL, MATCH_HOLO_FLARE_PALETTE } from "../holoFlares.js";
import { EffectTuningFields, TuningRange } from "./EffectTuningFields.jsx";
import { variationSummary } from "./effectTuning.js";
import { effectMissingHint, fittingFormat, formatMissingHint } from "./finishAvailability.js";
@ -33,7 +33,8 @@ export function VariationCustomizer({ catalog, card, value, showEffect = true, d
return { value: item.id, label: item.label, disabled: Boolean(hint), hint };
}).toSorted(enabledFirst);
const flare = value.flare;
const flareEffect = FLARE_EFFECTS.find((item) => item.id === flare?.id);
const flareEffects = catalog.flareEffects || [];
const flareEffect = flareEffects.find((item) => item.id === flare?.id);
const changeFlare = (next) => onChange({ ...value, flare: { ...flare, ...next } });
const changeEffect = (effectPresetId) => onChange({ ...value, effectPresetId, formatId: fittingFormat(catalog, card, effectPresetId, value.formatId) });
return <div className="nebula-admin-customizer">
@ -48,10 +49,10 @@ export function VariationCustomizer({ catalog, card, value, showEffect = true, d
<EffectTuningFields catalog={catalog} effect={effect} value={value} disabled={disabled} onChange={(tuning) => onChange({ ...value, ...tuning })} />
</> : flare ? <>
<div className="nebula-admin-customizer-choices">
<SelectDropdown className="nebula-admin-inline-field" label="Animation" size="sm" value={flare.id} disabled={disabled} options={[{ value: "", label: "Aucune" }, ...FLARE_EFFECTS.map((item) => ({ value: item.id, label: item.label }))]} onChange={(id) => changeFlare({ id })} />
{flareEffect?.motifs && <SelectDropdown className="nebula-admin-inline-field" label="Motif" size="sm" value={flareEffect.motifs.some((item) => item.id === flare.motifId) ? flare.motifId : flareEffect.motifs[0].id} disabled={disabled} options={flareEffect.motifs.map((item) => ({ value: item.id, label: item.label }))} onChange={(motifId) => changeFlare({ motifId })} />}
<SelectDropdown className="nebula-admin-inline-field" label="Animation" size="sm" value={flare.id} disabled={disabled} options={[{ value: "", label: "Aucune" }, ...flareEffects.map((item) => ({ value: item.id, label: item.label }))]} onChange={(id) => changeFlare({ id })} />
{flareEffect?.motifs && <SelectDropdown className="nebula-admin-inline-field" label="Motif" size="sm" value={flareMotifOf(flareEffect, flare.motifId)} disabled={disabled} options={flareEffect.motifs.map((item) => ({ value: item.id, label: item.label }))} onChange={(motifId) => changeFlare({ motifId })} />}
{flareEffect && <SwatchDropdown className="nebula-admin-inline-field" label="Palette" accessibleLabel="Palette des particules" value={flare.paletteId} options={[{ id: MATCH_HOLO_FLARE_PALETTE, label: MATCH_HOLO_FLARE_LABEL }, ...catalog.effectPalettes]} disabled={disabled} onChange={(paletteId) => changeFlare({ paletteId })} />}
{flareEffect && <SelectDropdown className="nebula-admin-inline-field" label="Zone" size="sm" value={flare.scope || DEFAULT_FLARE_SCOPE} disabled={disabled} options={FLARE_SCOPES.map((item) => ({ value: item.id, label: item.label }))} onChange={(scope) => changeFlare({ scope })} />}
{flareEffect && <SelectDropdown className="nebula-admin-inline-field" label="Zone" size="sm" value={flare.scope || DEFAULT_FLARE_SCOPE} disabled={disabled} options={(catalog.flareScopes || []).map((item) => ({ value: item.id, label: item.label }))} onChange={(scope) => changeFlare({ scope })} />}
</div>
{flareEffect && <div className="nebula-admin-tuning">
{flareEffect.tunings.map((scale) => <TuningRange key={scale.key} scale={scale} value={flare[scale.key] || DEFAULT_FLARE_TUNING} disabled={disabled} onChange={(next) => changeFlare({ [scale.key]: next })} />)}