Skip to content

feat: make filament Serial field optional in CreatePresetsDialog#10873

Open
BenJule wants to merge 2 commits into
bambulab:masterfrom
BenJule:upstream/feat-optional-filament-serial
Open

feat: make filament Serial field optional in CreatePresetsDialog#10873
BenJule wants to merge 2 commits into
bambulab:masterfrom
BenJule:upstream/feat-optional-filament-serial

Conversation

@BenJule

@BenJule BenJule commented May 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #10866

The filament Serial field in the Create/Edit Filament Presets dialog is currently mandatory — the dialog silently requires a non-empty value to build the preset name. This is confusing for users who want to create a generic filament preset without a specific serial/variant number.

Changes

  • The Serial field is now optional (label updated to "Serial (optional)")
  • When Serial is left blank the preset name is built as <Vendor> <Type> instead of <Vendor> <Type> <Serial>
  • When Serial is filled in but contains only invalid/special characters (i.e. remove_special_key() strips everything), the dialog shows a clear validation error instead of silently dropping the value:

    "The filament serial contains only invalid characters or spaces. Please correct it or leave it blank."

  • Existing validation for the vendor name field is unchanged

Before / After

Before After
Serial field required Serial field optional
Blank serial → preset creation blocked Blank serial → preset named Vendor Type
Invalid serial silently dropped Invalid serial → validation error with message

Testing

Tested the following scenarios:

  • Create preset with Serial filled in → preset name includes serial ✓
  • Create preset with Serial left blank → preset name is Vendor Type
  • Enter !!! as serial (all special chars) → validation error shown, dialog stays open ✓
  • Vendor field left blank → existing error shown as before ✓

BenJule and others added 2 commits May 22, 2026 11:59
## Summary

- The **Serial** field (labeled \"Variant\" in the upstream issue) in
the *Create Filament Preset* dialog is now optional
- Users can leave it blank when a filament has no meaningful variant
(e.g. Polymaker PolyLite PC)
- The field label now reads **Serial (optional)** to make this clear
- When blank, the preset is named `Vendor Type` instead of `Vendor Type
` with a trailing space

## Changes

`src/slic3r/GUI/CreatePresetsDialog.cpp`
- Removed the hard error when Serial is empty
- Relaxed escape-character and all-spaces validation to check only the
Vendor field (Serial can legitimately be empty)
- Preset name construction skips the serial component when it is empty
- Field label changed from `Serial` → `Serial (optional)`

## Test plan

- [ ] Create a filament preset with Serial left blank → preset is
created as `Vendor Type`
- [ ] Create a filament preset with Serial filled in → preset is created
as `Vendor Type Serial` (existing behaviour unchanged)
- [ ] Vendor field still required: leaving Vendor blank still shows an
error

Upstream issue: bambulab#10866
@BenJule BenJule closed this Jun 7, 2026
@BenJule BenJule deleted the upstream/feat-optional-filament-serial branch June 7, 2026 10:09
@BenJule BenJule reopened this Jun 7, 2026
@BenJule BenJule restored the upstream/feat-optional-filament-serial branch June 7, 2026 11:37
@BenJule

BenJule commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

Apologies — this PR was closed by mistake on 2026-06-07, and that was an error on my side, not a deliberate decision to withdraw the change.

It happened as an unintended side effect of a branch cleanup in my fork: deleting the head branch automatically closed this PR. The contribution still stands. I have restored the branch and reopened the PR. Sorry for the noise and any confusion this caused.

@tonghao-bbl

Copy link
Copy Markdown
Contributor

Hi @BenJule Is this an AI generated PR? the feature request in #10866 says variant but in this PR you make serial optional, I don't see how they are related.
also, in this PR, you still checked empty of the serial and popup a dialog which says serial can be empty?

can you help explain these? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the "Variant" field optional

2 participants