mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-21 10:15:04 +02:00
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:
@@ -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[]>([]);
|
||||
|
||||
Reference in New Issue
Block a user