From bcc14bd07d7aeb2629bf2688e360e5f6f9dd3668 Mon Sep 17 00:00:00 2001 From: Jason Date: Sat, 4 Apr 2026 20:15:40 +0800 Subject: [PATCH] fix: remove hover push animation on provider cards Keep usage display fixed in place and show action buttons with a simple opacity fade instead of sliding in and pushing content. --- src/components/providers/ProviderCard.tsx | 29 ++++------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/src/components/providers/ProviderCard.tsx b/src/components/providers/ProviderCard.tsx index a48c24fbe..90750b743 100644 --- a/src/components/providers/ProviderCard.tsx +++ b/src/components/providers/ProviderCard.tsx @@ -1,4 +1,4 @@ -import { useMemo, useState, useEffect, useRef } from "react"; +import { useMemo, useState, useEffect } from "react"; import { GripVertical, ChevronDown, ChevronUp } from "lucide-react"; import { useTranslation } from "react-i18next"; import type { @@ -191,27 +191,12 @@ export function ProviderCard({ const [isExpanded, setIsExpanded] = useState(false); - const actionsRef = useRef(null); - const [actionsWidth, setActionsWidth] = useState(0); - useEffect(() => { if (hasMultiplePlans) { setIsExpanded(true); } }, [hasMultiplePlans]); - useEffect(() => { - if (actionsRef.current) { - const updateWidth = () => { - const width = actionsRef.current?.offsetWidth || 0; - setActionsWidth(width); - }; - updateWidth(); - window.addEventListener("resize", updateWidth); - return () => window.removeEventListener("resize", updateWidth); - } - }, [onTest, onOpenTerminal]); // 按钮数量可能变化时重新计算 - const handleOpenWebsite = () => { if (!isClickableUrl) { return; @@ -359,15 +344,10 @@ export function ProviderCard({
-
+
{isOfficial ? ( ) : hasMultiplePlans ? ( @@ -414,8 +394,7 @@ export function ProviderCard({