mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 03:01:21 +02:00
The per-archive Print Log table cell at ArchivesPage.tsx:3882 rendered
filament_color as a single swatch with
`backgroundColor: entry.filament_color.startsWith('#') ? ... : undefined`.
For multi-color prints, the backend writes filament_color as a comma-joined
string ("#FFFFFF,#000000,#FF0000"). The whole string trivially passed the
startsWith('#') check but isn't a valid CSS color — the browser silently
drops the declaration and the swatch falls back to its black/20% border,
which on the dark theme reads as a barely-visible grey dot. Reporter's
screenshots showed "PLA" text with no visible swatch at all. DB column
was correct; render dropped the colors.
The Archive Card view at ArchivesPage.tsx:1072-1083 and :2114-2125 already
splits on comma and renders one swatch per color — only the Print Log
table cell had been missed when multi-color support landed elsewhere.
Fix mirrors the card pattern: wrap swatches in a flex container, split
on comma, trim, render one w-3 h-3 swatch per color with
backgroundColor and title={trimmed}. Single-color prints render one
swatch (no behaviour change). Empty / non-hex entries fall through to
no backgroundColor rather than poisoning the CSS for siblings.
Does NOT cover the reporter's second symptom — new multi-color prints
missing from filament usage history. That's usage_tracker._track_from_3mf
and the slot-to-tray mapping chain; needs a support bundle (PRINT START
+ PRINT COMPLETE [UsageTracker] log lines + captured ams_mapping) before
shape can be confirmed. Tracking as #1731 part 2.