fix(dashboard): restore expert-mode manual model entry in the combo builder

PR #8285 (global model search) replaced the expert-mode "Manual model"
block positionally with the new GlobalModelSearchPanel, dropping the only
way to type a provider/model pair by hand in expert mode. The supporting
state and handlers (manualModelInput, manualModelError,
manualModelHasDuplicate, handleAddManualModel) survived as dead code, so
neither typecheck nor lint flagged the loss.

Re-render the block above the search panel, unchanged from its pre-#8285
form. Regression guard: tests/e2e/combos-flow.spec.ts "expert mode shows
a single-page combo form with manual model entry", which had been failing
with a 180s timeout on locator.fill for combo-manual-model-input.
This commit is contained in:
Xiangzhe
2026-08-25 20:54:07 -03:00
parent b212a5a3f7
commit 7cde1163f2

View File

@@ -3227,6 +3227,51 @@ function ComboFormModal({ isOpen, combo, onClose, onSave, activeProviders, combo
)}
</div>
{isExpertMode && (
<div className="mt-3 rounded-md border border-black/8 dark:border-white/8 bg-white/70 dark:bg-white/[0.03] px-2.5 py-2">
<label className="text-[10px] font-medium uppercase tracking-wide text-text-muted block mb-1">
{getI18nOrFallback(t, "manualModel", "Manual model")}
</label>
<div className="flex flex-col sm:flex-row gap-2">
<input
type="text"
value={manualModelInput}
onChange={(e) => {
setManualModelInput(e.target.value);
setManualModelError("");
}}
onKeyDown={(e) => {
if (e.key === "Enter") {
e.preventDefault();
handleAddManualModel();
}
}}
placeholder="provider/model"
data-testid="combo-manual-model-input"
className="flex-1 text-xs py-2 px-2 rounded border border-black/10 dark:border-white/10 bg-white dark:bg-white/5 text-text-main focus:border-primary focus:outline-none font-mono"
/>
<Button
onClick={handleAddManualModel}
size="sm"
disabled={!manualModelInput.trim() || !!manualModelHasDuplicate}
data-testid="combo-manual-model-add"
>
{getI18nOrFallback(t, "addModel", "Add model")}
</Button>
</div>
{(manualModelError || manualModelHasDuplicate) && (
<div className="mt-2 rounded-md border border-amber-500/20 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-700 dark:text-amber-300">
{manualModelError ||
getI18nOrFallback(
t,
"builderDuplicateExact",
"This exact provider/model/account step is already in the combo."
)}
</div>
)}
</div>
)}
<GlobalModelSearchPanel
builderSelectionMode={builderSelectionMode}
onSelectionModeChange={setBuilderSelectionMode}