Explorar el Código

Fix filament hover card overlapping navigation bar (#259)

The FilamentHoverCard positioning logic now accounts for the fixed 56px
header when calculating available space above the trigger element.

Previously, when hovering over AMS slots near the top of the page, the
hover card would appear above the slot but go behind the navigation bar.
Now it correctly detects there isn't enough usable space and flips to
show below the slot instead.

Closes #259
maziggy hace 7 meses
padre
commit
cf6f374fee

+ 16 - 5
CHANGELOG.md

@@ -14,6 +14,15 @@ All notable changes to Bambuddy will be documented in this file.
   - Updated translations for proxy mode steps in English, German, and Japanese
   - Updated translations for proxy mode steps in English, German, and Japanese
 
 
 ### Fixed
 ### Fixed
+- **Authentication Required Error After Initial Setup** (Issue #257):
+  - Fixed "Authentication required" error when using printer controls after fresh install with auth enabled
+  - Token clearing on 401 responses is now more selective - only clears on invalid token messages
+  - Generic "Authentication required" errors (which may be timing issues) no longer clear the token
+  - Also fixed smart plug discovery scan endpoints missing auth headers
+- **Filament Hover Card Overlapping Navigation Bar** (Issue #259):
+  - Fixed filament info popup being partially covered by the navigation bar
+  - Hover card positioning now accounts for the fixed 56px header
+  - Cards near the top of the page now correctly flip to show below the slot
 - **Filament Statistics Incorrectly Multiplied by Quantity** (Issue #229):
 - **Filament Statistics Incorrectly Multiplied by Quantity** (Issue #229):
   - Fixed filament totals being inflated by incorrectly multiplying by quantity
   - Fixed filament totals being inflated by incorrectly multiplying by quantity
   - The `filament_used_grams` field already contains the total for the entire print job
   - The `filament_used_grams` field already contains the total for the entire print job
@@ -30,11 +39,13 @@ All notable changes to Bambuddy will be documented in this file.
   - Fixed header buttons overflowing outside the screen on iPhone/mobile devices
   - Fixed header buttons overflowing outside the screen on iPhone/mobile devices
   - Headers now stack vertically on small screens with proper wrapping
   - Headers now stack vertically on small screens with proper wrapping
   - Applied consistent responsive pattern from PrintersPage
   - Applied consistent responsive pattern from PrintersPage
-- **AMS Auto-Matching Ignores Sliced Spool Selection** (Issue #245):
-  - Fixed AMS slot mapping to use `tray_info_idx` from 3MF files for exact spool matching
-  - When multiple trays have the same filament type/color, the exact spool selected during slicing is now used
-  - Priority: tray_info_idx match > exact color match > similar color match > type-only match
-  - Resolves "extrusion motor overloaded" errors caused by wrong tray selection on H2D Pro and other printers with multiple identical spools
+- **AMS Auto-Matching Selects Wrong Slot** (Issue #245):
+  - Fixed AMS slot mapping when multiple trays have the same `tray_info_idx` (filament type identifier)
+  - `tray_info_idx` (e.g., "GFA00" for generic PLA) identifies filament TYPE, not unique spools
+  - When multiple trays match the same type, color is now used as a tiebreaker
+  - Previously used `find()` which always returned the first match regardless of color
+  - Fixed in both backend (print_scheduler.py) and frontend (useFilamentMapping.ts)
+  - Resolves wrong tray selection (e.g., A4 instead of B1) when multiple AMS units have same filament type
 
 
 ### Added
 ### Added
 - **Windows Portable Launcher** (contributed by nmori):
 - **Windows Portable Launcher** (contributed by nmori):

+ 4 - 2
frontend/src/components/FilamentHoverCard.tsx

@@ -87,10 +87,12 @@ export function FilamentHoverCard({ data, children, disabled, className = '', sp
     if (isVisible && triggerRef.current && cardRef.current) {
     if (isVisible && triggerRef.current && cardRef.current) {
       const triggerRect = triggerRef.current.getBoundingClientRect();
       const triggerRect = triggerRef.current.getBoundingClientRect();
       const cardHeight = cardRef.current.offsetHeight;
       const cardHeight = cardRef.current.offsetHeight;
-      const spaceAbove = triggerRect.top;
+      // Account for fixed header (56px) - space above should exclude header area
+      const headerHeight = 56;
+      const spaceAbove = triggerRect.top - headerHeight;
       const spaceBelow = window.innerHeight - triggerRect.bottom;
       const spaceBelow = window.innerHeight - triggerRect.bottom;
 
 
-      // Prefer top, but flip to bottom if not enough space
+      // Prefer top, but flip to bottom if not enough space (accounting for header)
       if (spaceAbove < cardHeight + 12 && spaceBelow > spaceAbove) {
       if (spaceAbove < cardHeight + 12 && spaceBelow > spaceAbove) {
         setPosition('bottom');
         setPosition('bottom');
       } else {
       } else {

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
static/assets/index-3wkUCoeq.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-DzQ3-JjU.js"></script>
+    <script type="module" crossorigin src="/assets/index-3wkUCoeq.js"></script>
     <link rel="stylesheet" crossorigin href="/assets/index-fdAEMOwp.css">
     <link rel="stylesheet" crossorigin href="/assets/index-fdAEMOwp.css">
   </head>
   </head>
   <body>
   <body>

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio