Triage: #18101 — duplicate/non-functional nozzle entries in the nozzle dropdown
Reproducible here? Yes (Linux, Xvfb or a unit test). This is pure profile/string logic — no printer, network, cloud, or OS-specific behavior involved. The reporter is on Windows, but the code path is platform independent.
Where it comes from
PresetCollection::diameters_of_selected_printer() (src/libslic3r/Preset.cpp:4101-4110) builds the nozzle list by inserting the raw printer_variant string of every printer preset whose printer_model matches, into a std::set<std::string>. No numeric normalization happens, so "0.10" and "0.1" are two different keys.
Plater then fills the combo (src/slic3r/GUI/Plater.cpp:4101-4118): it computes nozzle_dia = get_diameter_string(nozzle_diameter->values[i]) (get_diameter_string at src/slic3r/GUI/Plater.cpp:388, i.e. the trailing-zeros-trimmed "0.1"), and at line 4112 appends it as a "custom option" whenever the string is not literally present in the variant list. Selection/matching is also plain string comparison (FindString, diameters[i] == selected_variant, keep_variant at line 4104).
- Consequence matches the report exactly: a profile whose variant string reads
0.10 yields both a 0.10mm entry (backed by a real preset → works) and an extra 0.1mm entry created from the formatted nozzle_diameter (backed by no preset → selecting it appears to do nothing). The second reproduction path ("name a copy of a profile with a changed nozzle size") hits the same mismatch, since the name-derived variant and the numeric value are formatted differently.
How to verify on this machine
- Drop two user printer presets for the same
printer_model into a test config dir: one with printer_variant = 0.10 / nozzle_diameter = 0.1, one with the stock 0.4 variant.
- Launch under Xvfb, select the
0.10 printer, open the nozzle dropdown and check for two entries ("0.10mm" + "0.1mm") and that the second is a no-op; or unit-test the list-building/matching logic with those two inputs.
Suggested fix direction (for the owner)
Normalize nozzle identity to a numeric value (or a canonical trimmed string) both when collecting variants in diameters_of_selected_printer() and when matching/selecting in Plater.cpp, so "0.10", "0.1" and nozzle_diameter = 0.1 collapse to a single list item that maps to the owning preset. Named variants ("0.4HS", "0.4 High Flow") must keep working — the existing keep_variant logic at Plater.cpp:4104 already compares the numeric prefix, so the same "numeric prefix, preserve suffix" normalization should be used for dedup.