diff --git a/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/parts/QuotaCardExpanded.tsx b/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/parts/QuotaCardExpanded.tsx
index bb725fdd31a..c9403a9aac6 100644
--- a/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/parts/QuotaCardExpanded.tsx
+++ b/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/parts/QuotaCardExpanded.tsx
@@ -496,10 +496,10 @@ export default function QuotaCardExpanded({
)}
-
+
{refreshedLabel && (
{loading ? : }
diff --git a/src/shared/components/Button.tsx b/src/shared/components/Button.tsx
index 22d19506cda..e7fc205d23d 100644
--- a/src/shared/components/Button.tsx
+++ b/src/shared/components/Button.tsx
@@ -1,6 +1,6 @@
"use client";
-import { forwardRef } from "react";
+import { forwardRef, useState } from "react";
import {
Button as KitButton,
type ButtonSize as KitSize,
@@ -8,6 +8,7 @@ import {
} from "@omniroute/ui-kit/button";
import { cn } from "@/shared/utils/cn";
import Icon from "./Icon";
+import Tooltip from "./Tooltip";
/** Legacy variant vocabulary — kept because 150+ call sites and Modal.tsx type against it. */
export type ButtonVariant =
@@ -69,7 +70,52 @@ export function resolveKitButton(variant: ButtonVariant, size: ButtonSize) {
};
}
-const Button = forwardRef(function Button(
+/**
+ * A titled Button whose call site passes `disabled` or `loading` can go inactive, and the kit
+ * gives an inactive button `pointer-events: none`: its native `title` (often the only visible
+ * name of an icon button) would never show then. Such a button is wrapped once in the Tooltip
+ * adapter — always, so toggling `disabled` never remounts the button or drops its focus — and
+ * the tooltip opens only while the button is inactive. While enabled, the native title keeps
+ * working as before (one tooltip at a time, same accessible name/description). A reason for
+ * being disabled is not a title: use GuardedAction `reason` for that.
+ */
+function InactiveTitleTooltip({
+ title,
+ inactive,
+ fullWidth,
+ children,
+}: {
+ title: string;
+ inactive: boolean;
+ fullWidth: boolean;
+ children: React.ReactNode;
+}) {
+ const [open, setOpen] = useState(false);
+ // Both wrappers are boxes that hand a parent's stretch down to the button: the outer
+ // `.ci-tooltip` span is the parent's flex item (it takes ActionBar's `[&>*]:grow` on phones)
+ // and `[&>*]:grow` passes that growth to the trigger, then to the button. `fullWidth` keeps
+ // the whole chain full width.
+ const chain = cn("max-w-full [&>*]:grow", fullWidth && "flex w-full");
+ return (
+
+ {/* The trigger: it takes the hover while the button ignores pointer events and is the
+ keyboard stop while the button cannot be focused. `multiline`: a long title (a hint
+ rather than a short name) wraps instead of running off the viewport. */}
+
+ {children}
+
+
+ );
+}
+
+/** The legacy props → kit Button mapping (unchanged); Button below only decides the wrapper. */
+const LegacyKitButton = forwardRef(function LegacyKitButton(
{
children,
variant = "primary",
@@ -105,4 +151,30 @@ const Button = forwardRef(function Button(
);
});
+/**
+ * The title to keep visible while the button is inactive, or null when there is none or the
+ * button can never go inactive. Checked on the raw props: a call site that writes `disabled`
+ * or `loading` (even `disabled={false}`) has a button that can be disabled.
+ */
+function inactiveTitleOf(props: ButtonProps): string | null {
+ const canGoInactive = "disabled" in props || "loading" in props;
+ const { title } = props;
+ return canGoInactive && typeof title === "string" && title.trim() !== "" ? title : null;
+}
+
+const Button = forwardRef(function Button(props, ref) {
+ const button = ;
+ const title = inactiveTitleOf(props);
+ if (title === null) return button;
+ return (
+
+ {button}
+
+ );
+});
+
export default Button;
diff --git a/src/shared/components/Tooltip.tsx b/src/shared/components/Tooltip.tsx
index 079500d5670..83c24da5af1 100644
--- a/src/shared/components/Tooltip.tsx
+++ b/src/shared/components/Tooltip.tsx
@@ -32,6 +32,9 @@ interface TooltipProps {
* single-line `whitespace-nowrap` layout. Use when the label is long.
*/
multiline?: boolean;
+ /** Controlled open state (Radix). Omit both to let hover/focus drive the tooltip. */
+ open?: boolean;
+ onOpenChange?: (open: boolean) => void;
}
function isInactiveControl(props: unknown): boolean {
@@ -49,6 +52,8 @@ export default function Tooltip({
tooltipClassName,
delayMs = 300,
multiline = false,
+ open,
+ onOpenChange,
}: TooltipProps) {
if (content == null || content === "") return <>{children}>;
// A non-element child (text, numbers) gets a focusable span so keyboard users reach it.
@@ -71,7 +76,12 @@ export default function Tooltip({
);
return (
-
+ {trigger} (src/shared/components/GuardedAction.tsx), which keeps the button
-// focusable and shows the reason.
+// `pointer-events: none`, so a native `title` on it never shows. Two kinds of titles, two fixes:
+//
+// - A title that explains WHY the button is disabled is a reason. Those buttons use
+// (src/shared/components/GuardedAction.tsx), which keeps the button
+// focusable, swallows the click and shows the reason.
+// - A title that is the button's NAME (Refresh, Move up, Test all…) stays a title. The Button
+// adapter (src/shared/components/Button.tsx) now shows it through the Tooltip adapter while
+// the button is disabled or loading, and keeps the native title while it is enabled
+// (tests/unit/ui/adapters/button-disabled-title-tooltip.test.tsx).
//
// The guard: a