瀏覽代碼

fix(printers): equalize external tray height with regular AMS slots

On dual-nozzle printers (H2C/H2D), the External card stacked a
separate "Ext-L" / "Ext-R" caption below each tray to mark which
extruder it fed. That caption appeared on the External card only,
making the bottom row of the printer card's AMS panel visibly
taller than the row above it.

Fix: the L/R distinction now lives inside the slot's colour circle
in place of the numeric index, and the bottom caption is removed.
FilamentSlotCircle's slotNumber prop is widened to `number | string`
to carry the letter. Single-nozzle externals (one tray, no L/R
distinction) keep the numeric "1".

The Ext-L / Ext-R strings still drive the slot's "location" label
in the filament hover card, so detail context is preserved.
maziggy 2 月之前
父節點
當前提交
3cb0433569

文件差異過大導致無法顯示
+ 0 - 0
CHANGELOG.md


+ 5 - 2
frontend/src/components/FilamentSlotCircle.tsx

@@ -13,7 +13,10 @@
  *                confirmed no spool (state 9/10), "reset" for slots where
  *                the user cleared the assignment but the firmware hasn't
  *                positively confirmed emptiness. Ignored when isEmpty is false.
- *   slotNumber - 1-based slot number to display inside the circle.
+ *   slotNumber - 1-based slot number to display inside the circle. Accepts
+ *                a string for non-numeric labels (e.g. "L" / "R" for the
+ *                dual-nozzle external trays, where carrying a separate
+ *                Ext-L/Ext-R caption underneath made the row taller).
  */
 
 interface FilamentSlotCircleProps {
@@ -21,7 +24,7 @@ interface FilamentSlotCircleProps {
   trayType?: string | null;
   isEmpty: boolean;
   emptyKind?: 'physical' | 'reset' | null;
-  slotNumber: number;
+  slotNumber: number | string;
 }
 
 function isLightFilamentColor(hex: string): boolean {

+ 5 - 4
frontend/src/pages/PrintersPage.tsx

@@ -5300,13 +5300,15 @@ function PrinterCard({
                               const emptyKind = getEmptySlotKind(extTray);
                               const extSlotContent = (
                                 <div className={`w-full bg-bambu-dark-secondary rounded-lg p-1 text-center ${isEmpty ? 'opacity-50' : ''} ${isExtActive ? 'ring-2 ring-bambu-green ring-offset-1 ring-offset-bambu-dark' : ''}`}>
-                                  {/* Filament color circle with 1-based slot number centered inside */}
+                                  {/* Color circle: L/R inside on dual-nozzle external (replaces
+                                      the separate Ext-L/Ext-R caption that made the row taller than
+                                      regular AMS slots), 1-based slot number on single-nozzle. */}
                                   <FilamentSlotCircle
                                     trayColor={extTray.tray_color}
                                     trayType={extTray.tray_type}
                                     isEmpty={isEmpty}
                                     emptyKind={emptyKind}
-                                    slotNumber={slotTrayId + 1}
+                                    slotNumber={isDualNozzle ? (extTrayId === 254 ? 'L' : 'R') : slotTrayId + 1}
                                   />
                                   <div className={`text-[9px] font-bold truncate ${isEmpty ? 'text-white/40' : 'text-white'}`}>
                                     {extTray.tray_type || t('ams.slotEmpty')}
@@ -5322,7 +5324,6 @@ function PrinterCard({
                                       />
                                     )}
                                   </div>
-                                  {extLabel && <div className="text-[7px] text-white/40 mt-0.5 truncate">{extLabel}</div>}
                                 </div>
                               );
 
@@ -5484,7 +5485,7 @@ function PrinterCard({
         {viewMode === 'expanded' && (
           <div className="mt-auto">
         {smartPlug && (
-          <div className="pt-4">
+          <div className="pt-3">
             <div className="flex items-center gap-2 mb-2">
               <span className="text-[10px] uppercase tracking-wider text-bambu-gray font-medium">
                 {t('printers.power', 'Power')}

文件差異過大導致無法顯示
+ 0 - 0
static/assets/index-CFvgt_ZD.css


文件差異過大導致無法顯示
+ 0 - 0
static/assets/index-WvBaLL5O.js


+ 2 - 2
static/index.html

@@ -26,8 +26,8 @@
 
     <!-- Splash screens for iOS -->
     <link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
-    <script type="module" crossorigin src="/assets/index-BgPfOybr.js"></script>
-    <link rel="stylesheet" crossorigin href="/assets/index-D4jvs18I.css">
+    <script type="module" crossorigin src="/assets/index-WvBaLL5O.js"></script>
+    <link rel="stylesheet" crossorigin href="/assets/index-CFvgt_ZD.css">
   </head>
   <body>
     <div id="root"></div>

部分文件因文件數量過多而無法顯示