From 9eb23a0ba7cd68c26b56f3d73c3259d51e7d16d4 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 14 Sep 2026 16:52:00 -0700 Subject: [PATCH 1/2] refactor(web): centralize provider instance icons --- .../ProviderUpdatePrimaryNotification.tsx | 25 +++++++--------- apps/web/src/components/chat/ModelListRow.tsx | 22 +++++--------- .../components/chat/ProviderInstanceIcon.tsx | 25 ++++++++++++++-- .../src/components/chat/V2LifecycleRow.tsx | 28 ++++++++++-------- .../src/components/chat/providerIconUtils.ts | 22 -------------- .../components/onboarding/WelcomeWizard.tsx | 29 ++++++++++++++----- .../settings/AcpRegistrySearchStep.tsx | 11 +++++-- .../settings/AddProviderInstanceDialog.tsx | 11 +++++-- .../settings/ProviderInstanceCard.tsx | 18 ++---------- .../components/settings/providerDriverMeta.ts | 20 ------------- apps/web/src/components/usage/UsagePage.tsx | 11 +++++-- .../components/usage/UsageProviderChart.tsx | 9 ++++-- .../src/components/usage/usageProviders.ts | 10 +++---- apps/web/src/providerInstances.test.ts | 14 +++++++++ apps/web/src/providerInstances.ts | 3 ++ 15 files changed, 137 insertions(+), 121 deletions(-) diff --git a/apps/web/src/components/ProviderUpdatePrimaryNotification.tsx b/apps/web/src/components/ProviderUpdatePrimaryNotification.tsx index a0ed3d80467f..3fca1d748ca7 100644 --- a/apps/web/src/components/ProviderUpdatePrimaryNotification.tsx +++ b/apps/web/src/components/ProviderUpdatePrimaryNotification.tsx @@ -2,12 +2,12 @@ import { useNavigate } from "@tanstack/react-router"; import { useAtomValue } from "@effect/atom-react"; import { DownloadIcon } from "lucide-react"; import { useCallback, useEffect, useMemo, useRef } from "react"; -import { type ProviderDriverKind, type ProviderInstanceId } from "@t3tools/contracts"; +import { type ServerProvider, type ProviderInstanceId } from "@t3tools/contracts"; import { primaryServerProvidersAtom, serverEnvironment } from "../state/server"; import { usePrimaryEnvironment } from "../state/environments"; import { useDismissedProviderUpdateNotificationKeys } from "../providerUpdateDismissal"; -import { PROVIDER_ICON_BY_PROVIDER } from "./chat/providerIconUtils"; +import { ProviderInstanceIcon } from "./chat/ProviderInstanceIcon"; import { canOneClickUpdateProviderCandidate, collectProviderUpdateCandidates, @@ -35,20 +35,15 @@ type ActiveProviderUpdateToast = readonly providerCount: number; }; -function ProviderUpdateToastIcon({ provider }: { provider: ProviderDriverKind }) { - const ProviderIcon = PROVIDER_ICON_BY_PROVIDER[provider]; - - if (!ProviderIcon) { - return ( - - - ); - } - +function ProviderUpdateToastIcon({ provider }: { provider: ServerProvider }) { return ( -