Files
bambuddy/backend
maziggy 31ea824db8 fix(spoolbuddy): show the colour name the rest of Bambuddy shows (issue #3090)
SpoolBuddy said "Unknown color" under a correctly-coloured swatch for
    spools the inventory page names without trouble.

    The name was never in the spool record. Bambu's RFID tags frequently
    carry no readable colour name -- some carry an internal code instead --
    so Bambuddy has always resolved the swatch's own hex against the colour
    catalog, and the kiosk was rendering the empty column. Exactly one
    SpoolBuddy file already did it right, which is what marks this as an
    inconsistency rather than a kiosk simplification.

    Route every SpoolBuddy colour-name display through resolveSpoolColorName,
    which also stops the spools that do carry a code from showing "A06-D0" at
    the user. The write-tag edit form keeps the raw stored value on purpose:
    offering a derived name for editing invites the user to save it as though
    they had typed it.

    Spoolman has no colour-name field at all, so _map_spoolman_spool puts the
    spool's subtype there and sets color_name_is_synthesized. That flag now
    travels on the tag-matched broadcast, and resolveSpoolColorName takes a
    third argument to honour it -- a synthesised name loses to the catalog
    and survives only as a last resort. Spoolman installs were reading
    "Silk+" as a colour on the Inventory page and the AMS hover card too, so
    those call sites pass the flag as well.

    Searching by a colour you can read on screen now finds it, in the kiosk
    and in Bambuddy: the shared inventory filter matches the resolved name as
    well as the stored one. That makes the filter depend on the catalog,
    which loads asynchronously, so the three memoised call sites take its
    version as a dependency -- without that, a query typed before the catalog
    arrives keeps its empty result and reproduces the very symptom being
    fixed.

    The fallback label was hardcoded English in components that already
    import useTranslation; it is now spoolbuddy.spool.unknownColor in all 14
2026-09-20 13:37:39 +02:00
..