mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-18 03:54:17 +02:00
feat(slice-modal): Bundle tier for picking presets from imported .bbscfg
Closes the loop on the bundle work: users who imported a Printer
Preset Bundle via Settings → Slicer Bundles can now pick it in the
SliceModal and slice through the bundle dispatch path the backend
already supports.
UX:
- New "Slicer bundle" picker at the top of the modal, rendered only
when at least one bundle is imported (GET /slicer/bundles non-empty)
- Selecting a bundle replaces cloud/local/standard preset dropdowns
with bundle-scoped pickers (process + per-slot filament names from
the bundle). Printer is implicit (each .bbscfg has exactly one).
- Submit routes through SliceRequest.bundle so the backend skips
PresetRef resolution and asks the sidecar to materialise the JSON
triplet from the stored bundle by name.
- "None" leaves the modal on the original preset triplet path.
Frontend types: SliceBundleSpec + bundle?: SliceBundleSpec on SliceRequest.
This commit is contained in:
@@ -1155,6 +1155,13 @@ export interface PresetRef {
|
||||
source: PresetSource;
|
||||
id: string;
|
||||
}
|
||||
export interface SliceBundleSpec {
|
||||
bundle_id: string;
|
||||
printer_name: string;
|
||||
process_name: string;
|
||||
// Per-slot filament names in plate order. Index 0 = slot 1, etc.
|
||||
filament_names: string[];
|
||||
}
|
||||
export interface SliceRequest {
|
||||
printer_preset_id?: number;
|
||||
process_preset_id?: number;
|
||||
@@ -1167,6 +1174,11 @@ export interface SliceRequest {
|
||||
// backend validator promotes a singular into a one-element list when this
|
||||
// is omitted, so legacy single-color clients keep working unchanged.
|
||||
filament_presets?: PresetRef[];
|
||||
// Bundle dispatch: when set, the backend skips PresetRef resolution and
|
||||
// picks the JSON triplet from a sidecar-stored .bbscfg by name. Mutually
|
||||
// exclusive with the preset fields above (validator accepts both, but
|
||||
// dispatch ignores the preset side when bundle is set).
|
||||
bundle?: SliceBundleSpec;
|
||||
plate?: number;
|
||||
export_3mf?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user