Bläddra i källkod

fix(inventory): assign-spool picker note visible on mobile (#793 follow-up)

The original #793 fix added the spool note as an HTML title= tooltip
on each picker button in AssignSpoolModal.tsx. title= only surfaces
on hover, which doesn't exist on touch devices — phone users tapping
a card just selected it, the note never appeared. Users who store
their tracking ID in the note field were blind on mobile (raised by
@EmcetPL on the closed issue).

Render the note as a small muted truncated line directly under the
weight on both the internal-inventory branch (line 436-ish) and the
Spoolman branch (line 510-ish): text-[10px] text-bambu-gray/70 mt-1
truncate, kept inside the truthy `&&` guard so empty notes don't add
a blank row. The existing title={spool.note} is preserved on the new
<p> so desktop hover and mobile long-press still surface the full
untruncated text for notes that overflow the truncate.

Mirrored across both inventory branches per the parity rule
(internal and Spoolman pickers stay shape-equal). No backend change,
no new state, no popover, no new touch target.
maziggy 2 månader sedan
förälder
incheckning
91e4219994
4 ändrade filer med 13 tillägg och 1 borttagningar
  1. 2 0
      CHANGELOG.md
  2. 10 0
      frontend/src/components/AssignSpoolModal.tsx
  3. 0 0
      static/assets/index-CoslqvGC.js
  4. 1 1
      static/index.html

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 2 - 0
CHANGELOG.md


+ 10 - 0
frontend/src/components/AssignSpoolModal.tsx

@@ -438,6 +438,11 @@ export function AssignSpoolModal({ isOpen, onClose, printerId, amsId, trayId, tr
                         {Math.max(0, Math.round(spool.label_weight - spool.weight_used))} / {spool.label_weight}g
                       </p>
                     )}
+                    {spool.note && (
+                      <p className="text-[10px] text-bambu-gray/70 mt-1 truncate" title={spool.note}>
+                        {spool.note}
+                      </p>
+                    )}
                   </button>
                 ))}
               </div>
@@ -513,6 +518,11 @@ export function AssignSpoolModal({ isOpen, onClose, printerId, amsId, trayId, tr
                                 {Math.max(0, Math.round(spool.label_weight - spool.weight_used))} / {spool.label_weight}g
                               </p>
                             )}
+                            {spool.note && (
+                              <p className="text-[10px] text-bambu-gray/70 mt-1 truncate" title={spool.note}>
+                                {spool.note}
+                              </p>
+                            )}
                           </button>
                         ))}
                     </div>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
static/assets/index-CoslqvGC.js


+ 1 - 1
static/index.html

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

Vissa filer visades inte eftersom för många filer har ändrats