- Enhanced skip objects feature with visual improvements and better UX

- Skip Objects Modal:
    - Object ID markers overlaid on preview image (grid layout)
    - Large prominent ID badges to match printer display
    - Info banner explaining to match IDs with printer screen
    - Layer warning when skip unavailable (layer <= 1)
    - Red badge on button showing skipped count
    - Preview image now shown when paused (not just running)
    - Close with ESC key or click outside modal
    - Full light/dark theme support

  - Backend:
    - Extract object positions from 3MF (include_positions=True)
    - API returns x/y coordinates for objects (when available)
    - Parse s_obj from printer MQTT for skipped state persistence
    - Cover URL available in PAUSE/PAUSED states

  - Tests:
    - Added test for objects with position data
This commit is contained in:
maziggy
2026-01-01 18:01:41 +01:00
parent fe250b9b7f
commit 2dcd1a2ef2
16 changed files with 1237 additions and 401 deletions
+20
View File
@@ -163,6 +163,8 @@ export interface PrinterStatus {
mc_print_sub_stage: number;
// Timestamp of last AMS data update (for RFID refresh detection)
last_ams_update: number;
// Number of printable objects in current print (for skip objects feature)
printable_objects_count: number;
}
export interface PrinterCreate {
@@ -1289,6 +1291,24 @@ export const api = {
method: 'POST',
}),
// Skip Objects
getPrintableObjects: (printerId: number) =>
request<{
objects: Array<{ id: number; name: string; x: number | null; y: number | null; skipped: boolean }>;
total: number;
skipped_count: number;
is_printing: boolean;
}>(`/printers/${printerId}/print/objects`),
skipObjects: (printerId: number, objectIds: number[]) =>
request<{ success: boolean; message: string; skipped_objects: number[] }>(
`/printers/${printerId}/print/skip-objects`,
{
method: 'POST',
body: JSON.stringify(objectIds),
}
),
// AMS Control
refreshAmsSlot: (printerId: number, amsId: number, slotId: number) =>
request<{ success: boolean; message: string }>(