mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-20 11:26:07 +00:00
refactor(web): drop redundant Manual/Scan tabs in model add popover
The model add/scan popover nested a second Manual/Scan tab row inside the Chat/Embedding/Rerank type tabs. But ProviderCard already opens the popover from two distinct entry points (Add -> manual, Scan -> scan via initialMode), so the inner tabs were redundant. Render the manual form or scan UI directly off `mode` and remove the inner Tabs/TabsList, leaving a single clean tab row. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@ import {
|
|||||||
PopoverContent,
|
PopoverContent,
|
||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
} from '@/components/ui/popover';
|
} from '@/components/ui/popover';
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { ScannedProviderModel } from '@/app/infra/entities/api';
|
import { ScannedProviderModel } from '@/app/infra/entities/api';
|
||||||
import {
|
import {
|
||||||
@@ -298,20 +298,8 @@ export default function AddModelPopover({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="overflow-y-auto flex-1 min-h-0">
|
<div className="overflow-y-auto flex-1 min-h-0">
|
||||||
<Tabs
|
{mode === 'manual' ? (
|
||||||
value={mode}
|
<div className="mt-3">
|
||||||
onValueChange={(v) => setMode(v as 'manual' | 'scan')}
|
|
||||||
>
|
|
||||||
{!trigger && (
|
|
||||||
<TabsList className="grid w-full grid-cols-2 mt-3">
|
|
||||||
<TabsTrigger value="manual">
|
|
||||||
{t('models.manualAdd')}
|
|
||||||
</TabsTrigger>
|
|
||||||
<TabsTrigger value="scan">{t('models.scanAdd')}</TabsTrigger>
|
|
||||||
</TabsList>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<TabsContent value="manual" className="mt-3">
|
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<Label>{t('models.modelName')}</Label>
|
<Label>{t('models.modelName')}</Label>
|
||||||
@@ -390,9 +378,9 @@ export default function AddModelPopover({
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</TabsContent>
|
</div>
|
||||||
|
) : (
|
||||||
<TabsContent value="scan" className="space-y-2 mt-0 pt-0">
|
<div className="space-y-2 mt-3">
|
||||||
{scanLoading ? (
|
{scanLoading ? (
|
||||||
<div className="flex items-center justify-center py-4">
|
<div className="flex items-center justify-center py-4">
|
||||||
<RefreshCw className="h-4 w-4 mr-2 animate-spin text-muted-foreground" />
|
<RefreshCw className="h-4 w-4 mr-2 animate-spin text-muted-foreground" />
|
||||||
@@ -565,8 +553,8 @@ export default function AddModelPopover({
|
|||||||
/>
|
/>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</TabsContent>
|
</div>
|
||||||
</Tabs>
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</PopoverContent>
|
</PopoverContent>
|
||||||
|
|||||||
Reference in New Issue
Block a user