Also display ModelSelector skeleton if providers are loading

This commit is contained in:
Alex Gleason committed 2025-12-20 20:48:18 -06:00
1 parent 88c6b80484
commit 246b23167b
2 files changed
+6 -4

No files matched your search

+5 -3
View File
@@ -314,9 +314,9 @@ export const ModelSelector = memo(function ModelSelector({
className={cn(
"h-8 p-0 gap-1 text-xs border-0 bg-transparent hover:bg-transparent hover:text-foreground focus-visible:ring-0 focus-visible:ring-offset-0 text-muted-foreground text-right min-w-0 max-w-[280px]"
)}
disabled={disabled || isLoadingSettings}
disabled={disabled || isLoading || isLoadingSettings}
>
{isLoadingSettings ? (
{(isLoading || isLoadingSettings) ? (
<Skeleton className="h-4 w-32" />
) : selectedModelDisplay ? (
<>
@@ -339,7 +339,9 @@ export const ModelSelector = memo(function ModelSelector({
{placeholder || defaultPlaceholder}
</span>
)}
{!isLoadingSettings && <ChevronDown className="size-3 shrink-0 opacity-50" />}
{(!isLoading && !isLoadingSettings) && (
<ChevronDown className="size-3 shrink-0 opacity-50" />
)}
</Button>
</PopoverTrigger>
<PopoverContent className="p-0 w-80" align="end">
+1 -1
View File
@@ -56,7 +56,7 @@ export function useProviderModels(): ModelFetchResult {
// Fetch models with timeout
try {
const response = await openai.models.list({
signal: AbortSignal.timeout(10_000),
signal: AbortSignal.timeout(8_000),
});
// Transform models to our format