Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): show provider account accent badge in sidebar rows and hover card #5980

Mergedvitalyiegorov(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/5980/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 54 additions and 28 deletions (loading 1).

x
0 of 4 viewed, 4 left
7 additions and 12 deletionsapps/web/src/components/chat/ModelPickerSidebar.tsxModified
View file
@@ -1,10 +1,14 @@
import { type ProviderInstanceId } from "@t3tools/contracts";
-import { memo, useLayoutEffect, useMemo, useRef, useState } from "react";
+import { memo, useLayoutEffect, useRef, useState } from "react";
import { SparklesIcon, StarIcon } from "lucide-react";
import { ProviderInstanceIcon } from "./ProviderInstanceIcon";
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
import { cn } from "~/lib/utils";
-import { isProviderInstancePickerReady, type ProviderInstanceEntry } from "../../providerInstances";
+import {
+ isProviderInstancePickerReady,
+ shouldShowInstanceBadge,
+ type ProviderInstanceEntry,
+} from "../../providerInstances";
​
/**
* Build the hover tooltip for an instance button. Mirrors the old
@@ -65,14 +69,6 @@
const [hoveredInstanceId, setHoveredInstanceId] = useState<ProviderInstanceId | null>(null);
const sidebarContentRef = useRef<HTMLDivElement>(null);
const [selectedIndicatorTop, setSelectedIndicatorTop] = useState<number | null>(null);
- const duplicateDriverCounts = useMemo(() => {
- const counts = new Map<string, number>();
- for (const entry of props.instanceEntries) {
- counts.set(entry.driverKind, (counts.get(entry.driverKind) ?? 0) + 1);
- }
- return counts;
- }, [props.instanceEntries]);
-​
useLayoutEffect(() => {