From 7efbb1fc58ea4ab8124d4d9c0bd747af366e7726 Mon Sep 17 00:00:00 2001 From: Matteo Parenti Date: Tue, 17 Feb 2026 17:25:04 +0100 Subject: [PATCH 1/2] Show remaining spool weigth instead of used --- frontend/src/components/AssignSpoolModal.tsx | 2 +- frontend/src/components/FilamentHoverCard.tsx | 8 ++++++-- frontend/src/i18n/locales/it.ts | 4 ++-- frontend/src/pages/PrintersPage.tsx | 3 +++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/AssignSpoolModal.tsx b/frontend/src/components/AssignSpoolModal.tsx index 10011af81..d899435dc 100644 --- a/frontend/src/components/AssignSpoolModal.tsx +++ b/frontend/src/components/AssignSpoolModal.tsx @@ -177,7 +177,7 @@ export function AssignSpoolModal({ isOpen, onClose, printerId, amsId, trayId, tr

{spool.color_name || ''} {spool.label_weight ? ` - ${spool.label_weight}g` : ''} - {spool.weight_used > 0 ? ` (${Math.round(spool.weight_used)}g used)` : ''} + {spool.label_weight ? ` (${Math.max(0, Math.round(spool.label_weight - spool.weight_used))}g remaining)` : ''}

{selectedSpoolId === spool.id && ( diff --git a/frontend/src/components/FilamentHoverCard.tsx b/frontend/src/components/FilamentHoverCard.tsx index f1adb160c..503d02868 100644 --- a/frontend/src/components/FilamentHoverCard.tsx +++ b/frontend/src/components/FilamentHoverCard.tsx @@ -24,7 +24,7 @@ interface SpoolmanConfig { interface InventoryConfig { onAssignSpool?: () => void; onUnassignSpool?: () => void; - assignedSpool?: { id: number; material: string; brand: string | null; color_name: string | null } | null; + assignedSpool?: { id: number; material: string; brand: string | null; color_name: string | null; remainingWeightGrams?: number | null } | null; } interface ConfigureSlotConfig { @@ -148,6 +148,7 @@ export function FilamentHoverCard({ data, children, disabled, className = '', sp }; const colorHex = data.colorHex ? `#${data.colorHex.replace('#', '')}` : null; + const assignedRemainingWeight = inventory?.assignedSpool?.remainingWeightGrams ?? null; return (
- {data.fillLevel !== null ? `${data.fillLevel}%` : '—'} + {data.fillLevel !== null ? `${data.fillLevel}%` : '—'} + {assignedRemainingWeight !== null && data.fillLevel !== null && ( + • {assignedRemainingWeight}g + )} {data.fillSource === 'spoolman' && data.fillLevel !== null && ( {t('spoolman.fillSourceLabel')} )} diff --git a/frontend/src/i18n/locales/it.ts b/frontend/src/i18n/locales/it.ts index 1afc233be..3fbe22252 100644 --- a/frontend/src/i18n/locales/it.ts +++ b/frontend/src/i18n/locales/it.ts @@ -2347,7 +2347,7 @@ export default { kProfiles: 'K-Profiles', addKProfile: 'Aggiungi K-Profile', assignSpool: 'Assegna Bobina', - unassignSpool: 'Deassegna', + unassignSpool: 'Scollega', assignSuccess: 'Bobina assegnata e slot AMS configurato', assignFailed: 'Assegnazione bobina fallita', selectSpool: 'Seleziona una bobina da assegnare a questo slot', @@ -2397,7 +2397,7 @@ export default { externalSpool: 'Bobina esterna', profile: 'Profilo', kFactor: 'K Factor', - fill: 'Riempi', + fill: 'Residuo', configure: 'Configura', }, diff --git a/frontend/src/pages/PrintersPage.tsx b/frontend/src/pages/PrintersPage.tsx index fc0f705ac..932273a66 100644 --- a/frontend/src/pages/PrintersPage.tsx +++ b/frontend/src/pages/PrintersPage.tsx @@ -2906,6 +2906,7 @@ function PrinterCard({ material: assignment.spool.material, brand: assignment.spool.brand, color_name: assignment.spool.color_name, + remainingWeightGrams: Math.max(0, Math.round(assignment.spool.label_weight - assignment.spool.weight_used)), } : null, onAssignSpool: filamentData.vendor !== 'Bambu Lab' ? () => setAssignSpoolModal({ printerId: printer.id, @@ -3144,6 +3145,7 @@ function PrinterCard({ material: assignment.spool.material, brand: assignment.spool.brand, color_name: assignment.spool.color_name, + remainingWeightGrams: Math.max(0, Math.round(assignment.spool.label_weight - assignment.spool.weight_used)), } : null, onAssignSpool: filamentData.vendor !== 'Bambu Lab' ? () => setAssignSpoolModal({ printerId: printer.id, @@ -3330,6 +3332,7 @@ function PrinterCard({ material: assignment.spool.material, brand: assignment.spool.brand, color_name: assignment.spool.color_name, + remainingWeightGrams: Math.max(0, Math.round(assignment.spool.label_weight - assignment.spool.weight_used)), } : null, onAssignSpool: () => setAssignSpoolModal({ printerId: printer.id, From 07015a7f8fdb070ff83aa8bcba0907df00fe826e Mon Sep 17 00:00:00 2001 From: Matteo Parenti Date: Wed, 18 Feb 2026 14:16:03 +0100 Subject: [PATCH 2/2] fix(i18n): update remaining filament labels in multiple languages --- frontend/src/components/AssignSpoolModal.tsx | 2 +- frontend/src/i18n/locales/de.ts | 2 ++ frontend/src/i18n/locales/en.ts | 2 ++ frontend/src/i18n/locales/fr.ts | 2 ++ frontend/src/i18n/locales/it.ts | 4 +++- frontend/src/i18n/locales/ja.ts | 2 ++ 6 files changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/AssignSpoolModal.tsx b/frontend/src/components/AssignSpoolModal.tsx index d899435dc..222e84391 100644 --- a/frontend/src/components/AssignSpoolModal.tsx +++ b/frontend/src/components/AssignSpoolModal.tsx @@ -177,7 +177,7 @@ export function AssignSpoolModal({ isOpen, onClose, printerId, amsId, trayId, tr

{spool.color_name || ''} {spool.label_weight ? ` - ${spool.label_weight}g` : ''} - {spool.label_weight ? ` (${Math.max(0, Math.round(spool.label_weight - spool.weight_used))}g remaining)` : ''} + {spool.label_weight ? ` (${Math.max(0, Math.round(spool.label_weight - spool.weight_used))}g ${t('ams.remainingUnit')})` : ''}

{selectedSpoolId === spool.id && ( diff --git a/frontend/src/i18n/locales/de.ts b/frontend/src/i18n/locales/de.ts index 2c4b87003..90ed1151d 100644 --- a/frontend/src/i18n/locales/de.ts +++ b/frontend/src/i18n/locales/de.ts @@ -2682,6 +2682,8 @@ export default { kFactor: 'K-Faktor', fill: 'Füllstand', configure: 'Konfigurieren', + used: 'verwendet', + remainingUnit: 'verbleibend', }, // Print modal diff --git a/frontend/src/i18n/locales/en.ts b/frontend/src/i18n/locales/en.ts index 36a4a9f43..4a60844a7 100644 --- a/frontend/src/i18n/locales/en.ts +++ b/frontend/src/i18n/locales/en.ts @@ -2686,6 +2686,8 @@ export default { kFactor: 'K Factor', fill: 'Fill', configure: 'Configure', + used: 'used', + remainingUnit: 'remaining', }, // Print modal diff --git a/frontend/src/i18n/locales/fr.ts b/frontend/src/i18n/locales/fr.ts index 08e10d7d8..f176a0fb6 100644 --- a/frontend/src/i18n/locales/fr.ts +++ b/frontend/src/i18n/locales/fr.ts @@ -2674,6 +2674,8 @@ export default { kFactor: 'Facteur K', fill: 'Remplir', configure: 'Configurer', + used: 'utilisé', + remainingUnit: 'restant', }, // Print modal diff --git a/frontend/src/i18n/locales/it.ts b/frontend/src/i18n/locales/it.ts index 3fbe22252..e9ca369e6 100644 --- a/frontend/src/i18n/locales/it.ts +++ b/frontend/src/i18n/locales/it.ts @@ -2397,8 +2397,10 @@ export default { externalSpool: 'Bobina esterna', profile: 'Profilo', kFactor: 'K Factor', - fill: 'Residuo', + fill: 'Livello', configure: 'Configura', + used: 'utilizzato', + remainingUnit: 'rimanente', }, // Print modal diff --git a/frontend/src/i18n/locales/ja.ts b/frontend/src/i18n/locales/ja.ts index 390012f88..2637cd2e1 100644 --- a/frontend/src/i18n/locales/ja.ts +++ b/frontend/src/i18n/locales/ja.ts @@ -2604,6 +2604,8 @@ export default { kFactor: 'K値', fill: '充填率', configure: '設定', + used: '使用済み', + remainingUnit: '残り', }, printModal: { flowCalibration: 'フローキャリブレーション',