fix(inventory): apply catalog color's gradient + effect, not just hex (#1340)

Picking a color preset from the catalog only copied color_name and
  rgba onto the spool — extra_colors (gradient stops) and effect_type
  (sparkle / wood / etc.) were silently dropped at three layers above
  the API: the SpoolFormModal state shape, the CatalogDisplayColor
  mapping in ColorSection, and the selectColor handler itself. All
  three widened to carry both fields through.

  Picking a catalog swatch now writes both fields from the entry, so
  solid presets cleanly replace previous gradients. Recent-colors and
  the hardcoded-fallback palette stay as plain hex pickers — they
  don't touch extras/effect since they aren't full presets.

  Also fixed the en-US `colour` → `color` drift in 8 locale files
  that the reporter flagged.
This commit is contained in:
maziggy
2026-05-14 14:52:18 +02:00
parent f45aaea97c
commit b51ef33472
14 changed files with 197 additions and 31 deletions
+10 -1
View File
@@ -80,7 +80,16 @@ export function SpoolFormModal({
const [builtinFilaments, setBuiltinFilaments] = useState<BuiltinFilament[]>([]);
// Color catalog
const [colorCatalog, setColorCatalog] = useState<{ manufacturer: string; color_name: string; hex_color: string; material: string | null }[]>([]);
const [colorCatalog, setColorCatalog] = useState<{
manufacturer: string;
color_name: string;
hex_color: string;
material: string | null;
// #1340: gradient + effect carried from the catalog entry through to the
// color picker so they're applied alongside hex + name on selection.
extra_colors?: string | null;
effect_type?: string | null;
}[]>([]);
// Color state
const [recentColors, setRecentColors] = useState<ColorPreset[]>([]);