Browse Source

Fix local profiles not shown in AMS slot configuration

  The compatible_printers filter on local presets parsed the stored JSON
  array (e.g. '["BBL X1C 0.4 nozzle"]') as a semicolon-delimited string,
  so matching always failed and every local preset was silently skipped.
  Removed the filter entirely — user-imported profiles should be usable
  on any printer.
maziggy 2 months ago
parent
commit
add4c0ef5a

+ 3 - 0
CHANGELOG.md

@@ -4,6 +4,9 @@ All notable changes to Bambuddy will be documented in this file.
 
 ## [0.2.2] - Unreleased
 
+### Fixed
+- **Local Profiles Not Shown in AMS Slot Configuration** — Imported local filament profiles were hidden in the AMS slot configure modal when a printer model was set. The `compatible_printers` filter parsed the stored JSON array as a semicolon-delimited string, so the matching always failed and every local preset was silently skipped. Removed the filter entirely — user-imported profiles should be available on any printer.
+
 ## [0.2.2b3] - 2026-03-11
 
 ### New Features

+ 1 - 11
frontend/src/components/ConfigureAmsSlotModal.tsx

@@ -524,22 +524,12 @@ export function ConfigureAmsSlotModal({
       }
     }
 
-    // 2. Local presets
+    // 2. Local presets (always shown — user-imported profiles work on any printer)
     if (localPresets?.filament) {
       for (const lp of localPresets.filament) {
         const localId = `local_${lp.id}`;
         const isSaved = savedId === localId;
         if (!isSaved && query && !lp.name.toLowerCase().includes(query)) continue;
-        // Filter by compatible_printers if set (skip for saved preset)
-        if (!isSaved && printerModel && lp.compatible_printers) {
-          const compatModels = lp.compatible_printers.split(';').map(p => {
-            // Extract model from "BBL X1C" → "X1C"
-            const trimmed = p.trim();
-            const bblMatch = trimmed.match(/^BBL\s+(.+)/i);
-            return bblMatch ? bblMatch[1].trim().toUpperCase() : trimmed.toUpperCase();
-          }).filter(Boolean);
-          if (compatModels.length > 0 && !compatModels.includes(printerModel.toUpperCase())) continue;
-        }
         items.push({ id: localId, name: lp.name, source: 'local', isUser: false });
       }
     }

File diff suppressed because it is too large
+ 0 - 0
static/assets/index-tM2oTG9k.js


+ 1 - 1
static/index.html

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

Some files were not shown because too many files changed in this diff