Skip to content

Commit 9ea5b50

Browse files
committed
refactor: enhance layout and styling of ModelsDialog component for improved usability
1 parent 1cd5866 commit 9ea5b50

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

web/src/app/home/components/models-dialog/ModelsDialog.tsx

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -429,18 +429,16 @@ export default function ModelsDialog({
429429
}}
430430
>
431431
<DialogContent className="overflow-hidden p-0 h-[80vh] flex flex-col !max-w-[37rem]">
432-
<DialogHeader className="px-6 pt-6 pb-0">
432+
<DialogHeader className="px-6 pt-6 pb-0 flex-shrink-0">
433433
<DialogTitle>{t('models.title')}</DialogTitle>
434434
</DialogHeader>
435435

436-
<div className="flex-1 flex flex-col overflow-hidden px-6 pb-6 mt-0">
437-
{/* Fixed LangBot Models Card */}
438-
<div className="flex-shrink-0">
439-
{langbotProvider && renderProviderCard(langbotProvider, true)}
440-
</div>
436+
<div className="flex-1 overflow-auto px-6 pb-6 mt-0">
437+
{/* LangBot Models Card */}
438+
{langbotProvider && renderProviderCard(langbotProvider, true)}
441439

442440
{/* Add Provider Button */}
443-
<div className="flex-shrink-0 mb-3 flex justify-between items-center">
441+
<div className="mb-3 flex justify-between items-center sticky top-0 bg-background py-2 z-10">
444442
<span className="text-sm text-muted-foreground">
445443
{otherProviders.length === 0
446444
? t(
@@ -460,17 +458,15 @@ export default function ModelsDialog({
460458
</Button>
461459
</div>
462460

463-
{/* Scrollable Provider List */}
464-
<div className="flex-1 overflow-auto">
465-
{otherProviders.length === 0 ? (
466-
<div className="flex flex-col items-center justify-center h-full text-muted-foreground">
467-
<Boxes className="h-12 w-12 mb-3 opacity-50" />
468-
<p className="text-sm">{t('models.noProviders')}</p>
469-
</div>
470-
) : (
471-
otherProviders.map((p) => renderProviderCard(p))
472-
)}
473-
</div>
461+
{/* Provider List */}
462+
{otherProviders.length === 0 ? (
463+
<div className="flex flex-col items-center justify-center py-12 text-muted-foreground">
464+
<Boxes className="h-12 w-12 mb-3 opacity-50" />
465+
<p className="text-sm">{t('models.noProviders')}</p>
466+
</div>
467+
) : (
468+
otherProviders.map((p) => renderProviderCard(p))
469+
)}
474470
</div>
475471
</DialogContent>
476472
</Dialog>

0 commit comments

Comments
 (0)