diff --git a/apps/web/src/app/(app)/admin/models/page.tsx b/apps/web/src/app/(app)/admin/models/page.tsx index c143dee..68cbdd1 100644 --- a/apps/web/src/app/(app)/admin/models/page.tsx +++ b/apps/web/src/app/(app)/admin/models/page.tsx @@ -116,6 +116,10 @@ export default function AdminModelsPage() { const [outputPrice, setOutputPrice] = React.useState(""); const [creating, setCreating] = React.useState(false); const [formError, setFormError] = React.useState(null); + /** The id of the model just added, briefly highlighted so the owner sees the + * list updated without hunting for it (the list sits below the form). */ + const [justAddedId, setJustAddedId] = React.useState(null); + const listRef = React.useRef(null); const load = React.useCallback(async () => { setLoading(true); @@ -253,6 +257,9 @@ export default function AdminModelsPage() { reasoning_effort: effort || undefined, }); setModels((current) => [created, ...current]); + setJustAddedId(created.id); + window.setTimeout(() => setJustAddedId(null), 2500); + listRef.current?.scrollIntoView({ behavior: "smooth", block: "start" }); setModelId(""); setEffort(""); setInputPrice(""); @@ -328,9 +335,11 @@ export default function AdminModelsPage() { options={ !accountId ? [{ value: "", label: "ابتدا یک اکانت انتخاب کنید" }] - : modelOptions.length === 0 - ? [{ value: "", label: "کاتالوگی برای این اکانت نیست" }] - : modelOptions + : catalogLoading + ? [{ value: "", label: "در حال بارگذاری کاتالوگ…" }] + : modelOptions.length === 0 + ? [{ value: "", label: "کاتالوگی برای این اکانت نیست" }] + : modelOptions } disabled={!accountId || catalogLoading || modelOptions.length === 0} /> @@ -421,6 +430,7 @@ export default function AdminModelsPage() { description="بدون مدل فعال، هیچ حالت مسیریابی قابل اجرا نیست." /> ) : ( +
فهرست مدل‌ها
@@ -437,7 +447,13 @@ export default function AdminModelsPage() { {models.map((model) => ( - + {model.internal_name}

@@ -477,6 +493,7 @@ export default function AdminModelsPage() {

+
)} );