From 979877e1aa0137c54f4d47a09ac0430081d17879 Mon Sep 17 00:00:00 2001 From: Haileyesus <118998054+blackmammoth@users.noreply.github.com> Date: Thu, 28 May 2026 11:45:21 +0300 Subject: [PATCH] fix: simplify empty-state model selector Keep the provider empty state focused on the setup action users need there: choosing a model. The refresh control, cache timestamp, and refresh explanation made the dialog feel like a cache-management surface. That extra action is out of place in the empty state, where the goal is to start a chat with the selected provider and model. Remove the refresh-specific UI from ProviderSelectionEmptyState and drop the now-unused refresh/cache props from the ChatMessagesPane pass-through. Refresh behavior remains available in the dedicated command result flow. --- src/components/chat/view/ChatInterface.tsx | 3 -- .../view/subcomponents/ChatMessagesPane.tsx | 12 +---- .../ProviderSelectionEmptyState.tsx | 50 +------------------ 3 files changed, 4 insertions(+), 61 deletions(-) diff --git a/src/components/chat/view/ChatInterface.tsx b/src/components/chat/view/ChatInterface.tsx index 63e0cbb5..2f677bbb 100644 --- a/src/components/chat/view/ChatInterface.tsx +++ b/src/components/chat/view/ChatInterface.tsx @@ -332,10 +332,7 @@ function ChatInterface({ opencodeModel={opencodeModel} setOpenCodeModel={setOpenCodeModel} providerModelCatalog={providerModelCatalog} - providerModelCacheCatalog={providerModelCacheCatalog} providerModelsLoading={providerModelsLoading} - providerModelsRefreshing={providerModelsRefreshing} - onHardRefreshProviderModels={hardRefreshProviderModels} tasksEnabled={tasksEnabled} isTaskMasterInstalled={isTaskMasterInstalled} onShowAllTasks={onShowAllTasks} diff --git a/src/components/chat/view/subcomponents/ChatMessagesPane.tsx b/src/components/chat/view/subcomponents/ChatMessagesPane.tsx index edd9528f..f4ba1161 100644 --- a/src/components/chat/view/subcomponents/ChatMessagesPane.tsx +++ b/src/components/chat/view/subcomponents/ChatMessagesPane.tsx @@ -1,15 +1,16 @@ import { useTranslation } from 'react-i18next'; import { useCallback, useRef } from 'react'; import type { Dispatch, RefObject, SetStateAction } from 'react'; + import type { ChatMessage } from '../../types/types'; import type { Project, ProjectSession, LLMProvider, - ProviderModelsCacheInfo, ProviderModelsDefinition, } from '../../../../types/app'; import { getIntrinsicMessageKey } from '../../utils/messageKeys'; + import MessageComponent from './MessageComponent'; import ProviderSelectionEmptyState from './ProviderSelectionEmptyState'; @@ -35,10 +36,7 @@ interface ChatMessagesPaneProps { opencodeModel: string; setOpenCodeModel: (model: string) => void; providerModelCatalog: Partial>; - providerModelCacheCatalog: Partial>; providerModelsLoading: boolean; - providerModelsRefreshing: boolean; - onHardRefreshProviderModels: () => void; tasksEnabled: boolean; isTaskMasterInstalled: boolean | null; onShowAllTasks?: (() => void) | null; @@ -87,10 +85,7 @@ export default function ChatMessagesPane({ opencodeModel, setOpenCodeModel, providerModelCatalog, - providerModelCacheCatalog, providerModelsLoading, - providerModelsRefreshing, - onHardRefreshProviderModels, tasksEnabled, isTaskMasterInstalled, onShowAllTasks, @@ -177,10 +172,7 @@ export default function ChatMessagesPane({ opencodeModel={opencodeModel} setOpenCodeModel={setOpenCodeModel} providerModelCatalog={providerModelCatalog} - providerModelCacheCatalog={providerModelCacheCatalog} providerModelsLoading={providerModelsLoading} - providerModelsRefreshing={providerModelsRefreshing} - onHardRefreshProviderModels={onHardRefreshProviderModels} tasksEnabled={tasksEnabled} isTaskMasterInstalled={isTaskMasterInstalled} onShowAllTasks={onShowAllTasks} diff --git a/src/components/chat/view/subcomponents/ProviderSelectionEmptyState.tsx b/src/components/chat/view/subcomponents/ProviderSelectionEmptyState.tsx index 891f90c9..ef9a103e 100644 --- a/src/components/chat/view/subcomponents/ProviderSelectionEmptyState.tsx +++ b/src/components/chat/view/subcomponents/ProviderSelectionEmptyState.tsx @@ -1,18 +1,16 @@ import React, { useCallback, useEffect, useMemo, useState } from "react"; -import { Check, ChevronDown, RefreshCw } from "lucide-react"; +import { Check, ChevronDown } from "lucide-react"; import { Trans, useTranslation } from "react-i18next"; import { useServerPlatform } from "../../../../hooks/useServerPlatform"; import type { ProjectSession, LLMProvider, - ProviderModelsCacheInfo, ProviderModelsDefinition, } from "../../../../types/app"; import SessionProviderLogo from "../../../llm-logo-provider/SessionProviderLogo"; import { NextTaskBanner } from "../../../task-master"; import { - Button, Dialog, DialogTrigger, DialogContent, @@ -54,10 +52,7 @@ type ProviderSelectionEmptyStateProps = { opencodeModel: string; setOpenCodeModel: (model: string) => void; providerModelCatalog: Partial>; - providerModelCacheCatalog: Partial>; providerModelsLoading: boolean; - providerModelsRefreshing: boolean; - onHardRefreshProviderModels: () => void; tasksEnabled: boolean; isTaskMasterInstalled: boolean | null; onShowAllTasks?: (() => void) | null; @@ -101,19 +96,6 @@ function getProviderDisplayName(p: LLMProvider) { return "Gemini"; } -function formatUpdatedAt(value?: string) { - if (!value) { - return "Not cached yet"; - } - - const parsed = new Date(value); - if (Number.isNaN(parsed.getTime())) { - return "Not cached yet"; - } - - return parsed.toLocaleString(); -} - export default function ProviderSelectionEmptyState({ selectedSession, currentSessionId, @@ -131,10 +113,7 @@ export default function ProviderSelectionEmptyState({ opencodeModel, setOpenCodeModel, providerModelCatalog, - providerModelCacheCatalog, providerModelsLoading, - providerModelsRefreshing, - onHardRefreshProviderModels, tasksEnabled, isTaskMasterInstalled, onShowAllTasks, @@ -181,8 +160,6 @@ export default function ProviderSelectionEmptyState({ return found?.label || currentModel; }, [provider, currentModel, providerModelCatalog]); - const currentProviderCache = providerModelCacheCatalog[provider]; - const setModelForProvider = useCallback( (providerId: LLMProvider, modelValue: string) => { if (providerId === "claude") { @@ -265,30 +242,7 @@ export default function ProviderSelectionEmptyState({ Model Selector
-
-
-
-

Choose a model

-

- Catalogs are cached for 3 days. Refresh after CLI/auth changes or if a model is missing. -

-
- -
-

- Refresh checks every provider and replaces the cached catalogs. Last updated for {getProviderDisplayName(provider)}: {formatUpdatedAt(currentProviderCache?.updatedAt)} -

-
+

Choose a model