|
@@ -344,7 +344,7 @@ export function FilamentHoverCard({ data, children, disabled, className = '', sp
|
|
|
dismiss();
|
|
dismiss();
|
|
|
navigate(`/inventory?spool=${spoolman.linkedSpoolId}`);
|
|
navigate(`/inventory?spool=${spoolman.linkedSpoolId}`);
|
|
|
}}
|
|
}}
|
|
|
- className="w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors bg-bambu-green/20 hover:bg-bambu-green/30 text-bambu-green"
|
|
|
|
|
|
|
+ className="w-full flex items-center justify-start gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors bg-bambu-green/20 hover:bg-bambu-green/40 text-bambu-green"
|
|
|
title={t('inventory.openInInventory')}
|
|
title={t('inventory.openInInventory')}
|
|
|
>
|
|
>
|
|
|
<Package className="w-3.5 h-3.5" />
|
|
<Package className="w-3.5 h-3.5" />
|
|
@@ -397,7 +397,7 @@ export function FilamentHoverCard({ data, children, disabled, className = '', sp
|
|
|
dismiss();
|
|
dismiss();
|
|
|
navigate(`/inventory?spool=${inventory.assignedSpool!.id}`);
|
|
navigate(`/inventory?spool=${inventory.assignedSpool!.id}`);
|
|
|
}}
|
|
}}
|
|
|
- className="w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors bg-bambu-green/20 hover:bg-bambu-green/30 text-bambu-green"
|
|
|
|
|
|
|
+ className="w-full flex items-center justify-start gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors bg-bambu-green/20 hover:bg-bambu-green/40 text-bambu-green"
|
|
|
title={t('inventory.openInInventory')}
|
|
title={t('inventory.openInInventory')}
|
|
|
>
|
|
>
|
|
|
<Package className="w-3.5 h-3.5" />
|
|
<Package className="w-3.5 h-3.5" />
|
|
@@ -411,7 +411,7 @@ export function FilamentHoverCard({ data, children, disabled, className = '', sp
|
|
|
dismiss();
|
|
dismiss();
|
|
|
inventory.onUnassignSpool?.();
|
|
inventory.onUnassignSpool?.();
|
|
|
}}
|
|
}}
|
|
|
- className="w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors bg-red-100 dark:bg-red-500/20 hover:bg-red-200 dark:hover:bg-red-500/30 text-red-700 dark:text-red-400"
|
|
|
|
|
|
|
+ className="w-full flex items-center justify-start gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors bg-red-100 dark:bg-red-500/20 hover:bg-red-200 dark:hover:bg-red-500/40 text-red-700 dark:text-red-400"
|
|
|
>
|
|
>
|
|
|
<Unlink className="w-3.5 h-3.5" />
|
|
<Unlink className="w-3.5 h-3.5" />
|
|
|
{t('inventory.unassignSpool')}
|
|
{t('inventory.unassignSpool')}
|
|
@@ -426,8 +426,8 @@ export function FilamentHoverCard({ data, children, disabled, className = '', sp
|
|
|
inventory.onAssignSpool?.();
|
|
inventory.onAssignSpool?.();
|
|
|
}}
|
|
}}
|
|
|
disabled={!!inventory.isAssigned}
|
|
disabled={!!inventory.isAssigned}
|
|
|
- className={`w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors bg-bambu-blue/20 text-bambu-blue ${
|
|
|
|
|
- inventory.isAssigned ? 'opacity-50 cursor-not-allowed' : 'hover:bg-bambu-blue/30'
|
|
|
|
|
|
|
+ className={`w-full flex items-center justify-start gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors bg-bambu-blue/20 text-bambu-blue ${
|
|
|
|
|
+ inventory.isAssigned ? 'opacity-50 cursor-not-allowed' : 'hover:bg-bambu-blue/40'
|
|
|
}`}
|
|
}`}
|
|
|
>
|
|
>
|
|
|
<Package className="w-3.5 h-3.5" />
|
|
<Package className="w-3.5 h-3.5" />
|
|
@@ -446,7 +446,7 @@ export function FilamentHoverCard({ data, children, disabled, className = '', sp
|
|
|
dismiss();
|
|
dismiss();
|
|
|
configureSlot.onConfigure?.();
|
|
configureSlot.onConfigure?.();
|
|
|
}}
|
|
}}
|
|
|
- className="w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors bg-bambu-blue/20 hover:bg-bambu-blue/30 text-bambu-blue"
|
|
|
|
|
|
|
+ className="w-full flex items-center justify-start gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors bg-bambu-blue/20 hover:bg-bambu-blue/40 text-bambu-blue"
|
|
|
title={t('ams.configureSlot')}
|
|
title={t('ams.configureSlot')}
|
|
|
>
|
|
>
|
|
|
<Settings2 className="w-3.5 h-3.5" />
|
|
<Settings2 className="w-3.5 h-3.5" />
|
|
@@ -506,7 +506,7 @@ export function FilamentHoverCard({ data, children, disabled, className = '', sp
|
|
|
spoolman?.onUnlinkSpool?.();
|
|
spoolman?.onUnlinkSpool?.();
|
|
|
setShowUnlinkConfirm(false);
|
|
setShowUnlinkConfirm(false);
|
|
|
}}
|
|
}}
|
|
|
- className="flex-1 px-3 py-2 text-sm font-medium rounded transition-colors bg-red-100 dark:bg-red-500/20 hover:bg-red-200 dark:hover:bg-red-500/30 text-red-700 dark:text-red-400"
|
|
|
|
|
|
|
+ className="flex-1 px-3 py-2 text-sm font-medium rounded transition-colors bg-red-100 dark:bg-red-500/20 hover:bg-red-200 dark:hover:bg-red-500/40 text-red-700 dark:text-red-400"
|
|
|
>
|
|
>
|
|
|
{t('inventory.unassignSpool')}
|
|
{t('inventory.unassignSpool')}
|
|
|
</button>
|
|
</button>
|
|
@@ -622,6 +622,20 @@ export function EmptySlotHoverCard({ children, className = '', configureSlot, on
|
|
|
{/* Configure slot button */}
|
|
{/* Configure slot button */}
|
|
|
{(configureSlot?.enabled || onAssignSpool || actions) && (
|
|
{(configureSlot?.enabled || onAssignSpool || actions) && (
|
|
|
<div className="px-2 pb-2 space-y-1">
|
|
<div className="px-2 pb-2 space-y-1">
|
|
|
|
|
+ {/* Assign before Configure, matching the filled-slot card
|
|
|
|
|
+ above (#2791). The two cards are separate render paths
|
|
|
|
|
+ and had drifted into opposite orders, so the menu
|
|
|
|
|
+ reshuffled itself depending on whether the slot happened
|
|
|
|
|
+ to hold filament. */}
|
|
|
|
|
+ {onAssignSpool && (
|
|
|
|
|
+ <button
|
|
|
|
|
+ onClick={(e) => { e.stopPropagation(); dismiss(); onAssignSpool(); }}
|
|
|
|
|
+ className="w-full flex items-center justify-start gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors bg-bambu-blue/20 hover:bg-bambu-blue/40 text-bambu-blue"
|
|
|
|
|
+ >
|
|
|
|
|
+ <Package className="w-3.5 h-3.5" />
|
|
|
|
|
+ {t('inventory.assignSpool')}
|
|
|
|
|
+ </button>
|
|
|
|
|
+ )}
|
|
|
{configureSlot?.enabled && (
|
|
{configureSlot?.enabled && (
|
|
|
<button
|
|
<button
|
|
|
onClick={(e) => {
|
|
onClick={(e) => {
|
|
@@ -629,22 +643,13 @@ export function EmptySlotHoverCard({ children, className = '', configureSlot, on
|
|
|
dismiss();
|
|
dismiss();
|
|
|
configureSlot.onConfigure?.();
|
|
configureSlot.onConfigure?.();
|
|
|
}}
|
|
}}
|
|
|
- className="w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors bg-bambu-blue/20 hover:bg-bambu-blue/30 text-bambu-blue"
|
|
|
|
|
|
|
+ className="w-full flex items-center justify-start gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors bg-bambu-blue/20 hover:bg-bambu-blue/40 text-bambu-blue"
|
|
|
title={t('ams.configureSlot')}
|
|
title={t('ams.configureSlot')}
|
|
|
>
|
|
>
|
|
|
<Settings2 className="w-3.5 h-3.5" />
|
|
<Settings2 className="w-3.5 h-3.5" />
|
|
|
{t('ams.configure')}
|
|
{t('ams.configure')}
|
|
|
</button>
|
|
</button>
|
|
|
)}
|
|
)}
|
|
|
- {onAssignSpool && (
|
|
|
|
|
- <button
|
|
|
|
|
- onClick={(e) => { e.stopPropagation(); dismiss(); onAssignSpool(); }}
|
|
|
|
|
- className="w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors bg-bambu-blue/20 hover:bg-bambu-blue/30 text-bambu-blue"
|
|
|
|
|
- >
|
|
|
|
|
- <Package className="w-3.5 h-3.5" />
|
|
|
|
|
- {t('inventory.assignSpool')}
|
|
|
|
|
- </button>
|
|
|
|
|
- )}
|
|
|
|
|
{actions && (
|
|
{actions && (
|
|
|
<div className="pt-1 mt-1 border-t border-bambu-dark-tertiary space-y-1">
|
|
<div className="pt-1 mt-1 border-t border-bambu-dark-tertiary space-y-1">
|
|
|
{actions}
|
|
{actions}
|