Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): read SidebarV2 provider icons from all environments, not just primary #5300

Closedashraftown(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/5300/headopened View on GitHub

Showing 3 changed files with 10 additions and 11 deletions.

x
0 of 3 viewed, 3 left
10 additions and 11 deletionsapps/web/src/components/SidebarV2.tsxModified
View file
@@ -141,7 +141,6 @@
import { ProviderInstanceIcon } from "./chat/ProviderInstanceIcon";
import { getTriggerDisplayModelLabel } from "./chat/providerIconUtils";
import { deriveProviderInstanceEntries, type ProviderInstanceEntry } from "../providerInstances";
-import { primaryServerProvidersAtom } from "../state/server";
import { useThreadRunningTerminalIds } from "../state/terminalSessions";
import { stackedThreadToast, toastManager } from "./ui/toast";
import { Button } from "./ui/button";
@@ -1310,16 +1309,16 @@
() => sortLogicalProjectsForSidebar(unsortedProjectGroups, threads, sidebarProjectSortOrder),
[sidebarProjectSortOrder, threads, unsortedProjectGroups],
- const serverProviders = useAtomValue(primaryServerProvidersAtom);
- const providerEntryByInstanceId = useMemo(
- () =>
- new Map(
- deriveProviderInstanceEntries(serverProviders).map(
- (entry) => [entry.instanceId as string, entry] as const,
- ),
- ),
- [serverProviders],
- );
+ const allEnvironmentServerConfigs = useAtomValue(environmentServerConfigsAtom);
+ const providerEntryByInstanceId = useMemo(() => {
+ const map = new Map<string, ProviderInstanceEntry>();
+ for (const [, config] of allEnvironmentServerConfigs) {
+ for (const entry of deriveProviderInstanceEntries(config.providers)) {
+ map.set(entry.instanceId as string, entry);
+ }