Просмотр исходного кода

Fix spool assignment on empty AMS slots (#784)

  Remove "Assign Spool" and "Configure" buttons from empty AMS slot
  hover popups (standard AMS and HT AMS). Assigning a spool to a
  physically empty slot created a stuck state — no unassign button
  exists for empty slots, so the assignment couldn't be removed.
  External spool holders are unaffected.
maziggy 2 месяцев назад
Родитель
Сommit
27e96c9827
4 измененных файлов с 5 добавлено и 47 удалено
  1. 2 0
      CHANGELOG.md
  2. 2 46
      frontend/src/pages/PrintersPage.tsx
  3. 0 0
      static/assets/index-BE5xwBJ5.js
  4. 1 1
      static/index.html

+ 2 - 0
CHANGELOG.md

@@ -4,6 +4,8 @@ All notable changes to Bambuddy will be documented in this file.
 
 
 ## [0.2.3.b1] - Unreleased
 ## [0.2.3.b1] - Unreleased
 
 
+### Fixed
+- **Spool Assignment on Empty AMS Slots** ([#784](https://github.com/maziggy/bambuddy/issues/784)) — Empty AMS slots (no physical spool detected) showed "Assign Spool" and "Configure" buttons in the hover popup. Assigning a spool to an empty slot created a stuck state because no "Unassign" button is available for empty slots. Removed both buttons from empty AMS and HT AMS slot popups. External spool holders are unaffected. Reported by @RosdasHH.
 
 
 ## [0.2.2.1] - 2026-03-22
 ## [0.2.2.1] - 2026-03-22
 
 

+ 2 - 46
frontend/src/pages/PrintersPage.tsx

@@ -3439,29 +3439,7 @@ function PrinterCard({
                                         {slotVisual}
                                         {slotVisual}
                                       </FilamentHoverCard>
                                       </FilamentHoverCard>
                                     ) : (
                                     ) : (
-                                      <EmptySlotHoverCard
-                                        configureSlot={{
-                                          enabled: hasPermission('printers:control'),
-                                          onConfigure: () => setConfigureSlotModal({
-                                            amsId: ams.id,
-                                            trayId: slotIdx,
-                                            trayCount: ams.tray.length,
-                                            extruderId: mappedExtruderId,
-                                          }),
-                                        }}
-                                        inventory={spoolmanEnabled ? undefined : {
-                                          onAssignSpool: () => setAssignSpoolModal({
-                                            printerId: printer.id,
-                                            amsId: ams.id,
-                                            trayId: slotIdx,
-                                            trayInfo: {
-                                              type: '',
-                                              color: '',
-                                              location: `${getAmsLabel(ams.id, ams.tray.length)} Slot ${slotIdx + 1}`,
-                                            },
-                                          }),
-                                        }}
-                                      >
+                                      <EmptySlotHoverCard>
                                         {slotVisual}
                                         {slotVisual}
                                       </EmptySlotHoverCard>
                                       </EmptySlotHoverCard>
                                     )}
                                     )}
@@ -3757,29 +3735,7 @@ function PrinterCard({
                                     {slotVisual}
                                     {slotVisual}
                                   </FilamentHoverCard>
                                   </FilamentHoverCard>
                                 ) : (
                                 ) : (
-                                  <EmptySlotHoverCard
-                                    configureSlot={{
-                                      enabled: hasPermission('printers:control'),
-                                      onConfigure: () => setConfigureSlotModal({
-                                        amsId: ams.id,
-                                        trayId: htSlotId,
-                                        trayCount: ams.tray.length,
-                                        extruderId: mappedExtruderId,
-                                      }),
-                                    }}
-                                    inventory={spoolmanEnabled ? undefined : {
-                                      onAssignSpool: () => setAssignSpoolModal({
-                                        printerId: printer.id,
-                                        amsId: ams.id,
-                                        trayId: htSlotId,
-                                        trayInfo: {
-                                          type: '',
-                                          color: '',
-                                          location: getAmsLabel(ams.id, ams.tray.length),
-                                        },
-                                      }),
-                                    }}
-                                  >
+                                  <EmptySlotHoverCard>
                                     {slotVisual}
                                     {slotVisual}
                                   </EmptySlotHoverCard>
                                   </EmptySlotHoverCard>
                                 )}
                                 )}

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
static/assets/index-BE5xwBJ5.js


+ 1 - 1
static/index.html

@@ -23,7 +23,7 @@
 
 
     <!-- Splash screens for iOS -->
     <!-- Splash screens for iOS -->
     <link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
     <link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
-    <script type="module" crossorigin src="/assets/index-BS4UxbHO.js"></script>
+    <script type="module" crossorigin src="/assets/index-BE5xwBJ5.js"></script>
     <link rel="stylesheet" crossorigin href="/assets/index-CJ-drcFM.css">
     <link rel="stylesheet" crossorigin href="/assets/index-CJ-drcFM.css">
   </head>
   </head>
   <body>
   <body>

Некоторые файлы не были показаны из-за большого количества измененных файлов