diff --git a/src/app/(dashboard)/dashboard/combos/page.js b/src/app/(dashboard)/dashboard/combos/page.js index 60f633a5..6e0367bd 100644 --- a/src/app/(dashboard)/dashboard/combos/page.js +++ b/src/app/(dashboard)/dashboard/combos/page.js @@ -734,8 +734,15 @@ function CapacityAdapterCap({ cap, entry, onChange, activeProviders, getCaps }) const patch = (p) => onChange({ ...entry, ...p }); const handleAdd = (model) => { - if (models.includes(model.value)) return; - patch({ models: [...models, model.value] }); + const value = model?.value || model?.name || model; + if (!value || models.includes(value)) return; + patch({ models: [...models, value] }); + }; + + const handleDeselect = (model) => { + const value = model?.value || model?.name || model; + const next = models.filter((m) => m !== value); + patch({ models: next.length === 0 ? [DEFAULT_FALLBACK_MODEL] : next }); }; const handleRemove = (index) => { @@ -754,7 +761,7 @@ function CapacityAdapterCap({ cap, entry, onChange, activeProviders, getCaps }) return (
- {/* Master toggle + icon + label + chips */} + {/* Master toggle + icon + label */}
{cap.label} — {cap.desc}
-
- {models.length === 0 ? ( - No models - ) : ( - models.slice(0, 3).map((model, index) => ( - - {model} - - - - - - )) - )} - {models.length > 3 && ( - +{models.length - 3} more - )} -
@@ -823,11 +803,97 @@ function CapacityAdapterCap({ cap, entry, onChange, activeProviders, getCaps }) + {/* Model pool list/table */} + {models.length === 0 ? ( +
+ No models in pool (will fallback to {DEFAULT_FALLBACK_MODEL}) +
+ ) : ( +
+ + + + + + + + + + + {models.map((model, index) => ( + + + + + + + ))} + +
#ModelOrder
+ #{index + 1} + +
+ {model} + + {model === DEFAULT_FALLBACK_MODEL && ( + + free default + + )} +
+
+
+ + +
+
+ +
+
+ )} + {showModelSelect && ( setShowModelSelect(false)} onSelect={handleAdd} + onDeselect={handleDeselect} activeProviders={activeProviders} title={`Add ${cap.label} Model`} addedModelValues={models}