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:
maziggy
2026-05-06 09:55:14 +02:00
parent 7e1105dcb6
commit a50958e426
7 changed files with 924 additions and 478 deletions
+12
View File
@@ -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;
}