mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 11:12:35 +02:00
Two compounding bugs let an H2C-bound filament land in slot 1 of an A1 slice silently. (1) `_slicer_rejection_message` discarded the actual CLI diagnostic - `filament preset Generic PLA @BBL H2C (slot 1) is not compatible with printer Bambu Lab A1 0.4 nozzle.` - when the sidecar's headline error_string was Bambu Studio's catch-all `The input preset file is invalid and can not be parsed.` placeholder. The real reason was in the stdout `[error] run NNNN:` line, trimmed off before reaching the SliceJob's error_detail. (2) `pickFilamentForSlot` used a soft `-100` mismatch penalty rather than a hard skip, leaving the "never auto-fill an incompatible preset while a compatible one exists" contract implicit. The unused-slot substitution in `substitute_unused_plate_filaments` then propagated whatever slot 1 held across every unused slot - one bad pick poisoned the array. (1) Mine `[error] <msg>` (with or without `run NNNN:`) from the full pre-trim response; substitute the placeholder, keep meaningful headlines. (2) Partition candidates into compatible/unknown vs mismatch; prefer compatible whenever the bucket is non-empty, fall back to mismatch only on graceful-degrade. Picker helpers moved out of `SliceModal.tsx` into `utils/slicePresetPicker.ts` so the modal file stays component-only (react-refresh lint).