Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

feat(ui): use TruncatedTooltip for truncated labels across the app (MUL-8313) (#9618)

Multica Eve3647fd224576
diff --git a/apps/desktop/src/renderer/src/components/daemon-settings-tab.tsx b/apps/desktop/src/renderer/src/components/daemon-settings-tab.tsx
index 381e630c94..e983b16b2d 100644
--- a/apps/desktop/src/renderer/src/components/daemon-settings-tab.tsx
+++ b/apps/desktop/src/renderer/src/components/daemon-settings-tab.tsx
@@ -3,6 +3,7 @@ import { AlertCircle, Info, LogIn } from "lucide-react";
import { Button } from "@multica/ui/components/ui/button";
import { Switch } from "@multica/ui/components/ui/switch";
import { cn } from "@multica/ui/lib/utils";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
import { toast } from "sonner";
import {
SettingsCard,
@@ -33,15 +34,16 @@ function DiagnosticsRow({
return (
<div className="grid grid-cols-[140px_minmax(0,1fr)] items-baseline gap-3 py-1.5">
<span className="text-caption text-muted-foreground">{label}</span>
- <span
- className={cn(
- "min-w-0 truncate text-body",
- mono && "font-mono text-caption",
- )}
- title={typeof value === "string" ? value : undefined}
- >
- {value}
- </span>
+ <TruncatedTooltip content={typeof value === "string" ? value : undefined}>
+ <span
+ className={cn(
+ "min-w-0 truncate text-body",
+ mono && "font-mono text-caption",
+ )}
+ >
+ {value}
+ </span>
+ </TruncatedTooltip>
</div>
);
}
diff --git a/apps/desktop/src/renderer/src/components/window-toolbar.tsx b/apps/desktop/src/renderer/src/components/window-toolbar.tsx
index 6fdd828d03..f3ac5596e5 100644
--- a/apps/desktop/src/renderer/src/components/window-toolbar.tsx
+++ b/apps/desktop/src/renderer/src/components/window-toolbar.tsx
@@ -23,6 +23,7 @@ import {
TooltipContent,
TooltipTrigger,
} from "@multica/ui/components/ui/tooltip";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
import {
ResourceLeadingVisual,
useTabPresentation,
@@ -167,9 +168,11 @@ function HistoryMenuItem({
onClick={onSelect}
>
<ResourceLeadingVisual visual={visual} />
- <span className="min-w-0 flex-1 truncate" title={title}>
- {title}
- </span>
+ <TruncatedTooltip content={title}>
+ <span className="min-w-0 flex-1 truncate">
+ {title}
+ </span>
+ </TruncatedTooltip>
</DropdownMenuItem>
);
}
diff --git a/packages/ui/components/common/__tests__/truncated-tooltip.test.tsx b/packages/ui/components/common/__tests__/truncated-tooltip.test.tsx
index bf34e02985..81bf42f301 100644
--- a/packages/ui/components/common/__tests__/truncated-tooltip.test.tsx
+++ b/packages/ui/components/common/__tests__/truncated-tooltip.test.tsx
@@ -1,6 +1,6 @@
import type { ReactNode } from "react";
-import { act, cleanup, fireEvent, render, screen } from "@testing-library/react";
-import { afterEach, describe, expect, it } from "vitest";
+import { act, cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";
+import { afterEach, describe, expect, it, vi } from "vitest";
import { isContentTruncated, TruncatedTooltip } from "../truncated-tooltip";
import { TooltipProvider } from "../../ui/tooltip";
@@ -13,13 +13,17 @@ function renderWithTooltips(ui: ReactNode) {
return render(<TooltipProvider delay={0}>{ui}</TooltipProvider>);
}
+// Hover and let the open delay elapse.
async function hover(element: HTMLElement) {
- await act(async () => {
+ vi.useFakeTimers();
+ try {
fireEvent.pointerEnter(element, { pointerType: "mouse" });
- fireEvent.mouseEnter(element);
- fireEvent.pointerMove(element, { pointerType: "mouse" });
- fireEvent.mouseMove(element);
- });
+ await act(async () => {
+ vi.advanceTimersByTime(250);
+ });
+ } finally {
+ vi.useRealTimers();
+ }
}
// jsdom has no layout, so give an element the box sizes a browser would.
@@ -67,6 +71,60 @@ describe("TruncatedTooltip", () => {
expect(tooltipPopup()).toBeNull();
});
+ it("opens on keyboard focus when truncated and closes on blur", async () => {
+ renderWithTooltips(<Row label="A very long project name" />);
+ setBox(screen.getByTestId("label"), { scrollWidth: 240, clientWidth: 120 });
+ const button = screen.getByRole("button");
+
+ await act(async () => {
+ button.focus();
+ });
+ expect(tooltipPopup()).toHaveTextContent("A very long project name");
+
+ await act(async () => {
+ button.blur();
+ });
+ await waitFor(() => expect(tooltipPopup()).toBeNull());
+ });
+
+ it("stays closed on keyboard focus when the label fits", async () => {
+ renderWithTooltips(<Row label="Short" />);
+ setBox(screen.getByTestId("label"), { scrollWidth: 40, clientWidth: 120 });
+
+ await act(async () => {
+ screen.getByRole("button").focus();
+ });
+ expect(tooltipPopup()).toBeNull();
+ });
+
+ it("does not open from the focus a pointer press causes", async () => {
+ renderWithTooltips(<Row label="A very long project name" />);
+ setBox(screen.getByTestId("label"), { scrollWidth: 240, clientWidth: 120 });
+ const button = screen.getByRole("button");
+
+ await act(async () => {
+ fireEvent.pointerDown(button, { pointerType: "mouse" });
+ button.focus();
+ });
+ expect(tooltipPopup()).toBeNull();
+ });
+
+ it("lets a long unbroken value wrap inside the bubble", async () => {
+ const hash = "a1b2c3d4".repeat(8);
+ renderWithTooltips(<Row label={hash} />);
+ setBox(screen.getByTestId("label"), { scrollWidth: 480, clientWidth: 120 });
+
+ await hover(screen.getByRole("button"));
+ expect(tooltipPopup()).toHaveTextContent(hash);
+ expect(tooltipPopup()).toHaveClass("[overflow-wrap:anywhere]");
+ });
+
+ it("does not mount tooltip machinery before the first hover", () => {
+ renderWithTooltips(<Row label="A very long project name" />);
+ expect(screen.getByRole("button")).not.toHaveAttribute("data-popup-open");
+ expect(document.querySelector("[data-slot='tooltip-content']")).toBeNull();
+ });
+
it("renders the child alone without content", () => {
renderWithTooltips(
<TruncatedTooltip content="">
diff --git a/packages/ui/components/common/deferred-tooltip.tsx b/packages/ui/components/common/deferred-tooltip.tsx
index c0692ba48a..a2123c7228 100644
--- a/packages/ui/components/common/deferred-tooltip.tsx
+++ b/packages/ui/components/common/deferred-tooltip.tsx
@@ -35,17 +35,29 @@ export function DeferredTooltip({
trigger,
content,
side,
+ shouldOpen,
+ openOnFocus = false,
+ contentClassName,
}: {
/** The visible trigger element (e.g. an icon button). Cloned with hover
* handlers and an anchor ref; its own props are preserved. */
trigger: ReactElement<Record<string, unknown>>;
content: ReactNode;
side?: "top" | "bottom" | "left" | "right";
+ /** Checked against the trigger element when the open delay elapses; the
+ * tooltip stays closed when it returns false. */
+ shouldOpen?: (el: HTMLElement) => boolean;
+ /** Also open on keyboard focus (and close on blur), gated by the same
+ * checks as hover. Focus that follows a pointer press stays closed. */
+ openOnFocus?: boolean;
+ contentClassName?: string;
}) {
const anchorRef = useRef<HTMLElement | null>(null);
const [warm, setWarm] = useState(false);
const [open, setOpen] = useState(false);
const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
+ // Set by a pointer press so the focus it causes is not treated as keyboard focus.
+ const pointerFocusRef = useRef(false);
const clearTimer = () => {
if (timerRef.current !== null) {
@@ -55,6 +67,19 @@ export function DeferredTooltip({
};
useEffect(() => clearTimer, []);
+ const canOpen = () => {
+ // A trigger whose own menu/popover is open keeps the tooltip hidden;
+ // plain expand/collapse toggles (aria-expanded without a popup) keep it.
+ const el = anchorRef.current;
+ if (!el) return false;
+ const popupOpen =
+ el.hasAttribute("data-popup-open") ||
+ (el.getAttribute("aria-expanded") === "true" &&
+ (el.getAttribute("aria-haspopup") ?? "false") !== "false");
+ if (popupOpen) return false;
+ return !shouldOpen || shouldOpen(el);
+ };
+
const triggerRef = trigger.props.ref as Ref<HTMLElement> | undefined;
const element = cloneElement(trigger, {
ref: (el: HTMLElement | null) => {
@@ -67,15 +92,7 @@ export function DeferredTooltip({
setWarm(true);
clearTimer();
timerRef.current = setTimeout(() => {
- // A trigger whose own menu/popover is open keeps the tooltip hidden;
- // plain expand/collapse toggles (aria-expanded without a popup) keep it.
- const el = anchorRef.current;
- const popupOpen =
- el?.hasAttribute("data-popup-open") ||
- (el?.getAttribute("aria-expanded") === "true" &&
- (el.getAttribute("aria-haspopup") ?? "false") !== "false");
- if (popupOpen) return;
- setOpen(true);
+ if (canOpen()) setOpen(true);
}, TOOLTIP_OPEN_DELAY);
},
onPointerLeave: (e: React.PointerEvent) => {
@@ -85,9 +102,34 @@ export function DeferredTooltip({
},
onPointerDown: (e: React.PointerEvent) => {
(trigger.props.onPointerDown as ((e: React.PointerEvent) => void) | undefined)?.(e);
+ // The press focuses the trigger in this same task; reset afterwards so
+ // a press that moves no focus can't swallow later keyboard focus.
+ pointerFocusRef.current = true;
+ setTimeout(() => {
+ pointerFocusRef.current = false;
+ }, 0);
clearTimer();
setOpen(false);
},
+ ...(openOnFocus
+ ? {
+ onFocus: (e: React.FocusEvent) => {
+ (trigger.props.onFocus as ((e: React.FocusEvent) => void) | undefined)?.(e);
+ const fromPointer = pointerFocusRef.current;
+ pointerFocusRef.current = false;
+ if (fromPointer) return;
+ setWarm(true);
+ clearTimer();
+ if (canOpen()) setOpen(true);
+ },
+ onBlur: (e: React.FocusEvent) => {
+ (trigger.props.onBlur as ((e: React.FocusEvent) => void) | undefined)?.(e);
+ pointerFocusRef.current = false;
+ clearTimer();
+ setOpen(false);
+ },
+ }
+ : {}),
});
return (
@@ -95,7 +137,7 @@ export function DeferredTooltip({
{element}
{warm && (
<Tooltip open={open} onOpenChange={setOpen}>
- <TooltipContent side={side} anchor={anchorRef}>
+ <TooltipContent side={side} anchor={anchorRef} className={contentClassName}>
{content}
</TooltipContent>
</Tooltip>
diff --git a/packages/ui/components/common/truncated-tooltip.tsx b/packages/ui/components/common/truncated-tooltip.tsx
index 9188195b69..fdf1f72641 100644
--- a/packages/ui/components/common/truncated-tooltip.tsx
+++ b/packages/ui/components/common/truncated-tooltip.tsx
@@ -1,11 +1,7 @@
"use client";
-import { useRef, useState, type ComponentProps, type ReactElement, type ReactNode } from "react";
-import {
- Tooltip,
- TooltipContent,
- TooltipTrigger,
-} from "@multica/ui/components/ui/tooltip";
+import type { ReactElement, ReactNode } from "react";
+import { DeferredTooltip } from "./deferred-tooltip";
/**
* Whether `node` hides part of its content. Overflow only counts on an axis
@@ -38,13 +34,16 @@ export function isContentTruncated(el: HTMLElement | null): boolean {
/**
* Tooltip that reveals the full text only when the trigger's text is actually
- * cut off. Built on the shared `Tooltip` (same styling and open delay); right
- * before it would open, it measures the trigger and its descendants and stays
- * closed when nothing overflows. Measuring at open time keeps it correct
- * across resizes and content changes without observers.
+ * cut off. Built on `DeferredTooltip` (shared tooltip styling and open delay):
+ * nothing but the trigger mounts until the first hover, so it is cheap enough
+ * for dense lists, table cells, and column headers. When the open delay
+ * elapses, or the trigger takes keyboard focus, it measures the trigger and its descendants and stays closed when
+ * nothing overflows. Measuring at open time keeps it correct across resizes
+ * and content changes without observers.
*
* Use it for tooltips whose content repeats the trigger's own text. Tooltips
- * that add information (icon labels, disabled reasons) keep using `Tooltip`.
+ * that add information (icon labels, disabled reasons, a URL behind a short
+ * label) keep using `Tooltip`.
*/
function TruncatedTooltip({
content,
@@ -53,26 +52,23 @@ function TruncatedTooltip({
}: {
/** Full text shown when the trigger is truncated. Empty renders the child alone. */
content: ReactNode;
- side?: ComponentProps<typeof TooltipContent>["side"];
- /** The trigger element. Its own props and element type are preserved. */
- children: ReactElement;
+ side?: "top" | "bottom" | "left" | "right";
+ /** The trigger element. Cloned with hover handlers and a ref; its own props
+ * and element type are preserved, so it must forward both. */
+ children: ReactElement<Record<string, unknown>>;
}) {
- const triggerRef = useRef<HTMLButtonElement | null>(null);
- const [open, setOpen] = useState(false);
-
if (content == null || content === false || content === "") return children;
-
return (
- <Tooltip
- open={open}
- onOpenChange={(next) => {
- if (next && !isContentTruncated(triggerRef.current)) return;
- setOpen(next);
- }}
- >
- <TooltipTrigger ref={triggerRef} render={children} />
- <TooltipContent side={side}>{content}</TooltipContent>
- </Tooltip>
+ <DeferredTooltip
+ trigger={children}
+ content={content}
+ side={side}
+ shouldOpen={isContentTruncated}
+ openOnFocus
+ // The full text is often one long token (hash, URL, path); let it wrap
+ // inside the max-width bubble instead of spilling out of it.
+ contentClassName="[overflow-wrap:anywhere]"
+ />
);
}
diff --git a/packages/views/agents/components/agent-live-peek-card.tsx b/packages/views/agents/components/agent-live-peek-card.tsx
index be7ddbd067..91dd150902 100644
--- a/packages/views/agents/components/agent-live-peek-card.tsx
+++ b/packages/views/agents/components/agent-live-peek-card.tsx
@@ -3,6 +3,7 @@
import { useQuery } from "@tanstack/react-query";
import { ActorAvatar as ActorAvatarBase } from "@multica/ui/components/common/actor-avatar";
import { Skeleton } from "@multica/ui/components/ui/skeleton";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
import { useWorkspaceId } from "@multica/core/hooks";
import { useWorkspacePaths } from "@multica/core/paths";
import { agentListOptions } from "@multica/core/workspace/queries";
@@ -188,14 +189,15 @@ function CurrentIssueRow({
<span className="w-16 shrink-0 text-muted-foreground">{label}</span>
{issueId ? (
issue ? (
- <AppLink
- href={issueHref(issueId)}
- className="min-w-0 truncate text-brand hover:underline"
- title={`${issue.identifier} ${issue.title}`}
- >
- <span className="mr-1 font-mono text-micro">{issue.identifier}</span>
- <span>{issue.title}</span>
- </AppLink>
+ <TruncatedTooltip content={`${issue.identifier} ${issue.title}`}>
+ <AppLink
+ href={issueHref(issueId)}
+ className="min-w-0 truncate text-brand hover:underline"
+ >
+ <span className="mr-1 font-mono text-micro">{issue.identifier}</span>
+ <span>{issue.title}</span>
+ </AppLink>
+ </TruncatedTooltip>
) : (
<Skeleton className="h-3 w-24" />
)
diff --git a/packages/views/agents/components/agent-profile-card.tsx b/packages/views/agents/components/agent-profile-card.tsx
index 8732cb80b2..cb8d440e4b 100644
--- a/packages/views/agents/components/agent-profile-card.tsx
+++ b/packages/views/agents/components/agent-profile-card.tsx
@@ -15,6 +15,7 @@ import { runtimeListOptions } from "@multica/core/runtimes/queries";
import { useWorkspacePaths } from "@multica/core/paths";
import { ActorAvatar as ActorAvatarBase } from "@multica/ui/components/common/actor-avatar";
import { Skeleton } from "@multica/ui/components/ui/skeleton";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
import { AppLink } from "../../navigation";
import { HealthIcon } from "../../runtimes/components/shared";
import { availabilityConfig } from "../presence";
@@ -192,9 +193,11 @@ function RuntimeRow({
<div className="flex items-center gap-1.5">
<span className="w-12 shrink-0 text-muted-foreground">{t(($) => $.profile_card.runtime_label)}</span>
<HealthIcon health={health} className="h-3 w-3 shrink-0" />
- <span className="min-w-0 truncate" title={label}>
- {label}
- </span>
+ <TruncatedTooltip content={label}>
+ <span className="min-w-0 truncate">
+ {label}
+ </span>
+ </TruncatedTooltip>
</div>
);
}
@@ -225,9 +228,11 @@ function ModelRow({
{t(($) => $.profile_card.model_label)}
</span>
{hasModel ? (
- <span className="min-w-0 truncate font-mono text-micro" title={model}>
- {model}
- </span>
+ <TruncatedTooltip content={model}>
+ <span className="min-w-0 truncate font-mono text-micro">
+ {model}
+ </span>
+ </TruncatedTooltip>
) : (
<span className="min-w-0 truncate text-muted-foreground">
{t(($) => $.profile_card.model_unset)}
@@ -254,9 +259,11 @@ function MetaRow({
return (
<div className="flex items-center gap-1.5">
<span className="w-12 shrink-0 text-muted-foreground">{label}</span>
- <span className={`truncate ${mono ? "font-mono text-micro" : ""}`} title={value}>
- {value}
- </span>
+ <TruncatedTooltip content={value}>
+ <span className={`truncate ${mono ? "font-mono text-micro" : ""}`}>
+ {value}
+ </span>
+ </TruncatedTooltip>
</div>
);
}
@@ -276,13 +283,13 @@ function SkillsRow({ skills }: { skills: string[] }) {
<span className="w-12 shrink-0 pt-0.5 text-muted-foreground">{t(($) => $.profile_card.skills_label)}</span>
<div className="flex min-w-0 flex-wrap gap-1">
{visible.map((s) => (
- <span
- key={s}
- className="max-w-full truncate rounded-md bg-muted px-1.5 py-0.5 text-micro font-medium text-muted-foreground"
- title={s}
- >
- {s}
- </span>
+ <TruncatedTooltip key={s} content={s}>
+ <span
+ className="max-w-full truncate rounded-md bg-muted px-1.5 py-0.5 text-micro font-medium text-muted-foreground"
+ >
+ {s}
+ </span>
+ </TruncatedTooltip>
))}
{overflow > 0 && (
<span className="shrink-0 rounded-md bg-muted px-1.5 py-0.5 text-micro font-medium text-muted-foreground">
diff --git a/packages/views/agents/components/agents-page.test.tsx b/packages/views/agents/components/agents-page.test.tsx
index 6262dc3845..d4b7ecd772 100644
--- a/packages/views/agents/components/agents-page.test.tsx
+++ b/packages/views/agents/components/agents-page.test.tsx
@@ -371,6 +371,6 @@ describe("AgentsPage search + model column (GitHub #9500)", () => {
renderPage();
expect(screen.getByText("Model")).toBeInTheDocument();
- expect(screen.getAllByTitle("claude").length).toBeGreaterThan(0);
+ expect(screen.getAllByText("claude").length).toBeGreaterThan(0);
});
});
diff --git a/packages/views/agents/components/agents-page.tsx b/packages/views/agents/components/agents-page.tsx
index 72a8affb44..f12305f503 100644
--- a/packages/views/agents/components/agents-page.tsx
+++ b/packages/views/agents/components/agents-page.tsx
@@ -59,6 +59,7 @@ import {
TooltipContent,
TooltipTrigger,
} from "@multica/ui/components/ui/tooltip";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
import { useNavigation, useRowLink } from "../../navigation";
import { ActorAvatar } from "../../common/actor-avatar";
import { docsLocalePrefix } from "../../common/docs-locale";
@@ -1144,12 +1145,13 @@ export function AgentsPage(_props: AgentsPageProps = {}) {
)}
{isColVisible("model") ? (
<ListGridCell className="hidden @2xl:flex">
- <span
- className="min-w-0 truncate text-caption text-muted-foreground"
- title={row.agent.model || undefined}
- >
- {row.agent.model || "—"}
- </span>
+ <TruncatedTooltip content={row.agent.model || undefined}>
+ <span
+ className="min-w-0 truncate text-caption text-muted-foreground"
+ >
+ {row.agent.model || "—"}
+ </span>
+ </TruncatedTooltip>
</ListGridCell>
) : (
<ListGridCell className="hidden px-0 @2xl:flex" />
diff --git a/packages/views/autopilots/components/webhook-deliveries-section.tsx b/packages/views/autopilots/components/webhook-deliveries-section.tsx
index 70b66fe708..70259e1882 100644
--- a/packages/views/autopilots/components/webhook-deliveries-section.tsx
+++ b/packages/views/autopilots/components/webhook-deliveries-section.tsx
@@ -30,6 +30,7 @@ import {
} from "@multica/ui/components/ui/dialog";
import { cn } from "@multica/ui/lib/utils";
import { copyText } from "@multica/ui/lib/clipboard";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
import { toast } from "sonner";
import { useLocale, useT } from "../../i18n";
import type {
@@ -373,15 +374,16 @@ function MetaRow({
return (
<div className="flex flex-col">
<dt className="text-muted-foreground">{label}</dt>
- <dd
- className={cn(
- "truncate text-foreground",
- mono && "font-mono",
- )}
- title={value}
- >
- {value}
- </dd>
+ <TruncatedTooltip content={value}>
+ <dd
+ className={cn(
+ "truncate text-foreground",
+ mono && "font-mono",
+ )}
+ >
+ {value}
+ </dd>
+ </TruncatedTooltip>
</div>
);
}
diff --git a/packages/views/dashboard/components/dashboard-page.test.tsx b/packages/views/dashboard/components/dashboard-page.test.tsx
index 23f14c0cf3..beef438ae7 100644
--- a/packages/views/dashboard/components/dashboard-page.test.tsx
+++ b/packages/views/dashboard/components/dashboard-page.test.tsx
@@ -444,10 +444,6 @@ describe("DashboardPage — unreported usage", () => {
const coverageText =
"6 runs did not report usage · totals are still being processed";
expect(row).toHaveTextContent(coverageText);
- expect(within(row).getByText(coverageText)).toHaveAttribute(
- "title",
- coverageText,
- );
expect(within(row).getAllByText("—")).toHaveLength(2);
});
});
diff --git a/packages/views/dashboard/components/leaderboard.tsx b/packages/views/dashboard/components/leaderboard.tsx
index c376729cd2..b945ffe241 100644
--- a/packages/views/dashboard/components/leaderboard.tsx
+++ b/packages/views/dashboard/components/leaderboard.tsx
@@ -14,6 +14,7 @@ import {
} from "../utils";
import { Segmented } from "./dashboard-shared";
import "./leaderboard.css";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
// Which metric ranks the leaderboard. Drives row order, progress bar
// width, and which column header is emphasised — keeping the three in
@@ -253,12 +254,13 @@ export function Leaderboard({
: t(($) => $.leaderboard.other_agents)}
</span>
{coverageText ? (
- <span
- className="block truncate text-caption text-muted-foreground"
- title={coverageText}
- >
- {coverageText}
- </span>
+ <TruncatedTooltip content={coverageText}>
+ <span
+ className="block truncate text-caption text-muted-foreground"
+ >
+ {coverageText}
+ </span>
+ </TruncatedTooltip>
) : null}
</span>
</>
@@ -275,12 +277,13 @@ export function Leaderboard({
{agent?.name ?? row.agentId}
</span>
{coverageText ? (
- <span
- className="block truncate text-caption text-muted-foreground"
- title={coverageText}
- >
- {coverageText}
- </span>
+ <TruncatedTooltip content={coverageText}>
+ <span
+ className="block truncate text-caption text-muted-foreground"
+ >
+ {coverageText}
+ </span>
+ </TruncatedTooltip>
) : null}
</span>
</>
diff --git a/packages/views/editor/table-preview.tsx b/packages/views/editor/table-preview.tsx
index b7ed8d929b..0f7fb10a51 100644
--- a/packages/views/editor/table-preview.tsx
+++ b/packages/views/editor/table-preview.tsx
@@ -26,6 +26,7 @@ import {
import { ArrowDown, ArrowUp, ArrowUpDown } from "lucide-react";
import { DataTable } from "@multica/ui/components/ui/data-table";
import { cn } from "@multica/ui/lib/utils";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
import { useT } from "../i18n";
import {
parseDelimited,
@@ -173,15 +174,16 @@ export function TablePreview({ text, delimiter }: TablePreviewProps) {
cell: ({ getValue }) => {
const value = getValue<string | undefined>() ?? "";
return (
- <span
- className={cn(
- "block truncate",
- columnInfo[index]?.numeric && "text-right tabular-nums",
- )}
- title={value}
- >
- {value}
- </span>
+ <TruncatedTooltip content={value}>
+ <span
+ className={cn(
+ "block truncate",
+ columnInfo[index]?.numeric && "text-right tabular-nums",
+ )}
+ >
+ {value}
+ </span>
+ </TruncatedTooltip>
);
},
size: columnInfo[index]?.width ?? MIN_COLUMN_WIDTH,
@@ -253,9 +255,11 @@ export function SortHeader({
numeric && "flex-row-reverse",
)}
>
- <span className="truncate font-medium" title={title}>
- {title}
- </span>
+ <TruncatedTooltip content={title}>
+ <span className="truncate font-medium">
+ {title}
+ </span>
+ </TruncatedTooltip>
<Icon
aria-hidden
className={cn(
diff --git a/packages/views/issues/components/board-column.tsx b/packages/views/issues/components/board-column.tsx
index 4535cdc8ac..aa61e0cb5e 100644
--- a/packages/views/issues/components/board-column.tsx
+++ b/packages/views/issues/components/board-column.tsx
@@ -18,6 +18,7 @@ import {
DropdownMenuContent,
DropdownMenuItem,
} from "@multica/ui/components/ui/dropdown-menu";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
import { useWorkspaceId } from "@multica/core/hooks";
import { useIssueStatuses } from "@multica/core/issue-statuses/hooks";
import { useViewStoreApi } from "@multica/core/issues/stores/view-store-context";
@@ -418,9 +419,11 @@ function BoardGroupHeading({
className="size-2.5 shrink-0 rounded-full bg-muted-foreground/30"
style={group.propertyOptionColor ? { backgroundColor: group.propertyOptionColor } : undefined}
/>
- <span className="truncate text-body font-medium" title={group.title}>
- {group.title}
- </span>
+ <TruncatedTooltip content={group.title}>
+ <span className="truncate text-body font-medium">
+ {group.title}
+ </span>
+ </TruncatedTooltip>
<span className="shrink-0 rounded-full bg-background px-1.5 py-0.5 text-micro font-medium tabular-nums text-muted-foreground">
{count}
</span>
@@ -438,9 +441,11 @@ function BoardGroupHeading({
<FolderMinus className="size-3.5" />
</span>
)}
- <span className="truncate text-body font-medium" title={group.title}>
- {group.title}
- </span>
+ <TruncatedTooltip content={group.title}>
+ <span className="truncate text-body font-medium">
+ {group.title}
+ </span>
+ </TruncatedTooltip>
<span className="shrink-0 rounded-full bg-background px-1.5 py-0.5 text-micro font-medium tabular-nums text-muted-foreground">
{count}
</span>
@@ -465,9 +470,11 @@ function BoardGroupHeading({
return (
<div className="flex min-w-0 items-center gap-2">
{actorIcon}
- <span className="truncate text-body font-medium" title={group.title}>
- {group.title}
- </span>
+ <TruncatedTooltip content={group.title}>
+ <span className="truncate text-body font-medium">
+ {group.title}
+ </span>
+ </TruncatedTooltip>
<span className="shrink-0 rounded-full bg-background px-1.5 py-0.5 text-micro font-medium tabular-nums text-muted-foreground">
{count}
</span>
diff --git a/packages/views/issues/components/inline-comment-run.test.tsx b/packages/views/issues/components/inline-comment-run.test.tsx
index 66acafa5a1..749c0580ff 100644
--- a/packages/views/issues/components/inline-comment-run.test.tsx
+++ b/packages/views/issues/components/inline-comment-run.test.tsx
@@ -91,14 +91,12 @@ describe("InlineCommentRun", () => {
await screen.findByText("Checking the PR");
fireEvent.click(screen.getByRole("button", { name: /View activity/ }));
const preview = screen.getAllByText("Checking the PR").find((node) => node.closest("summary"))!;
- expect(preview).toHaveAttribute("title", "Checking the PR");
expect(screen.queryByTestId("step-body")).not.toBeInTheDocument();
act(() => client.setQueryData(chatKeys.taskMessages(id), [
message,
{ ...message, seq: 2, content: " changes.\nReviewing migration safety." },
]));
await waitFor(() => expect(preview).toHaveTextContent("Checking the PR changes."));
- expect(preview).toHaveAttribute("title", "Checking the PR changes.");
fireEvent.click(preview.closest("summary")!, { detail: 0 });
expect(await screen.findByTestId("step-body")).toHaveTextContent("Checking the PR changes. Reviewing migration safety.");
});
@@ -118,7 +116,6 @@ describe("InlineCommentRun", () => {
const preview = screen.getByText("read_file · .../db/queries.sql");
const summary = preview.closest("summary")!;
expect(summary).toHaveTextContent("4 steps");
- expect(preview).toHaveAttribute("title", "read_file · .../db/queries.sql");
fireEvent.click(summary, { detail: 0 });
expect(await screen.findByText(".../db/queries.sql")).toBeInTheDocument();
expect(screen.getByText(".../db/models.go")).toBeInTheDocument();
@@ -135,7 +132,7 @@ describe("InlineCommentRun", () => {
setup(task());
await screen.findByText("Checking logs");
fireEvent.click(screen.getByRole("button", { name: /View activity/ }));
- expect(screen.getByText("Checking [REDACTED GITHUB TOKEN]")).toHaveAttribute("title", "Checking [REDACTED GITHUB TOKEN]");
+ expect(screen.getByText("Checking [REDACTED GITHUB TOKEN]").closest("summary")).not.toBeNull();
expect(screen.getByText("Agent message").closest("summary")).not.toBeNull();
expect(document.body.innerHTML).not.toContain(secret);
});
@@ -156,7 +153,6 @@ describe("InlineCommentRun", () => {
expect(header.firstChild).toBe(textNode);
fireEvent.click(screen.getByRole("button", { name: /View activity/ }));
const preview = screen.getAllByText("Checking the runtime logs.").find((node) => node.closest("summary"))!;
- expect(preview).toHaveAttribute("title", "Checking the runtime logs.");
const details = preview.closest("details")!;
expect(details).not.toHaveAttribute("open");
expect(screen.queryByTestId("step-body")).not.toBeInTheDocument();
@@ -174,7 +170,7 @@ describe("InlineCommentRun", () => {
await screen.findByText(/REDACTED/);
fireEvent.click(screen.getByRole("button", { name: /View activity/ }));
const preview = screen.getAllByText(/REDACTED/).find((node) => node.closest("summary"))!;
- expect(preview.getAttribute("title")).toContain("REDACTED");
+ expect(preview.textContent).toContain("REDACTED");
expect(document.body.innerHTML).not.toContain("ghp_");
expect(preview.textContent!.length).toBeLessThanOrEqual(201);
});
diff --git a/packages/views/issues/components/inline-comment-run.tsx b/packages/views/issues/components/inline-comment-run.tsx
index e223adfd8e..d1abfa6ad3 100644
--- a/packages/views/issues/components/inline-comment-run.tsx
+++ b/packages/views/issues/components/inline-comment-run.tsx
@@ -18,6 +18,7 @@ import { Button } from "@multica/ui/components/ui/button";
import { IconButton } from "@multica/ui/components/common/icon-button";
import { Tooltip, TooltipTrigger, TooltipContent } from "@multica/ui/components/ui/tooltip";
import { cn } from "@multica/ui/lib/utils";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
import { AgentTranscriptDialog, StepBody } from "../../common/task-transcript/agent-transcript-dialog";
import { buildTimeline } from "../../common/task-transcript/build-timeline";
import { buildSteps, groupSteps, isCallStep, isGroupRow, type TraceRow } from "../../common/task-transcript/build-steps";
@@ -177,7 +178,9 @@ export function InlineCommentRun({ run, className, viewState, showIdentity = fal
<div ref={animationVisibility.ref} className="flex min-h-7 min-w-0 items-center gap-2" data-run-summary-row>
{showIdentity && <>
<ActorAvatar actorType="agent" actorId={task.agent_id} size="md" enableHoverCard showStatusDot />
- <span className="max-w-[30%] shrink-0 truncate text-body font-medium" title={name}>{name}</span>
+ <TruncatedTooltip content={name}>
+ <span className="max-w-[30%] shrink-0 truncate text-body font-medium">{name}</span>
+ </TruncatedTooltip>
{!active && task.completed_at && <Tooltip>
<TooltipTrigger render={<span className="shrink-0 cursor-default text-caption text-muted-foreground @max-[32rem]/run:hidden">
{timeAgo(task.completed_at)}
@@ -196,7 +199,9 @@ export function InlineCommentRun({ run, className, viewState, showIdentity = fal
<span>{statusText}</span>
<span className="break-all font-mono text-muted-foreground">{rawError}</span>
</TooltipContent>
- </Tooltip> : <span className="truncate" title={statusText}>{statusText}</span>}
+ </Tooltip> : <TruncatedTooltip content={statusText}>
+ <span className="truncate">{statusText}</span>
+ </TruncatedTooltip>}
</span>
<button type="button"
className={cn("flex min-w-0 items-center gap-1.5 rounded-xs py-1 text-left text-caption text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
@@ -225,10 +230,12 @@ export function InlineCommentRun({ run, className, viewState, showIdentity = fal
<div className={cn(showIdentity && "pl-8")}>
{replyTo}
{output && <div className="mt-2 text-body"><ReadonlyContent content={redactSecrets(output)} /></div>}
- {needsAction && rawError && <p title={rawError}
- className="mt-1.5 line-clamp-4 whitespace-pre-wrap break-words rounded-md border bg-muted/50 px-2.5 py-1.5 font-mono text-caption text-muted-foreground">
- {rawError}
- </p>}
+ {needsAction && rawError && <TruncatedTooltip content={rawError}>
+ <p
+ className="mt-1.5 line-clamp-4 whitespace-pre-wrap break-words rounded-md border bg-muted/50 px-2.5 py-1.5 font-mono text-caption text-muted-foreground">
+ {rawError}
+ </p>
+ </TruncatedTooltip>}
{expanded && <div id={regionId} className="mt-2 min-w-0 space-y-1">
{isPending && <p className="text-caption text-muted-foreground">{t(($) => $.inline_run.loading)}</p>}
{isError && <div role="alert" className="text-caption text-destructive">{t(($) => $.inline_run.load_failed)}
@@ -341,7 +348,9 @@ function InlineStep({ row, live, formatText }: { row: TraceRow; live: boolean; f
<summary onClick={disclosure.onTrigger} className="flex cursor-pointer list-none items-center gap-2 rounded-xs py-1.5 hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden">
{pending ? <Loader2 aria-hidden className="size-3.5 shrink-0 animate-spin text-info motion-reduce:animate-none" />
: <Icon aria-hidden className={cn("size-3.5 shrink-0", error ? "text-destructive" : "text-muted-foreground")} />}
- <span className={cn("min-w-0 flex-1 truncate", error && "text-destructive")} title={summary}>{summary}</span>
+ <TruncatedTooltip content={summary}>
+ <span className={cn("min-w-0 flex-1 truncate", error && "text-destructive")}>{summary}</span>
+ </TruncatedTooltip>
{(grouped || call) && <span className="shrink-0 text-micro text-muted-foreground">
{grouped ? t(($) => $.inline_run.steps, { count: row.steps.length }) : row.tool}
</span>}
diff --git a/packages/views/issues/components/issue-detail.tsx b/packages/views/issues/components/issue-detail.tsx
index 44eb9b1223..215ea69365 100644
--- a/packages/views/issues/components/issue-detail.tsx
+++ b/packages/views/issues/components/issue-detail.tsx
@@ -171,6 +171,7 @@ import {
useViewStateWriter,
} from "../../platform";
import { cn } from "@multica/ui/lib/utils";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
import { PAGE_GUTTER } from "../../layout/page-header";
import { ProgressRing } from "./progress-ring";
@@ -2829,7 +2830,9 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
) : (
<SlidersHorizontal className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
)}
- <span className="line-clamp-2 min-w-0 break-words [overflow-wrap:anywhere]" title={p.name}>{p.name}</span>
+ <TruncatedTooltip content={p.name}>
+ <span className="line-clamp-2 min-w-0 break-words [overflow-wrap:anywhere]">{p.name}</span>
+ </TruncatedTooltip>
</button>
))}
</>
@@ -2938,7 +2941,9 @@ export function IssueDetail({ issueId, onDelete, onDone, defaultSidebarOpen = tr
label={
<>
<PropertyIcon property={p} className="size-3.5 text-caption" />
- <span className="line-clamp-2 min-w-0 break-words [overflow-wrap:anywhere]" title={p.name}>{p.name}</span>
+ <TruncatedTooltip content={p.name}>
+ <span className="line-clamp-2 min-w-0 break-words [overflow-wrap:anywhere]">{p.name}</span>
+ </TruncatedTooltip>
</>
}
>
diff --git a/packages/views/issues/components/issue-runs-dialog.test.tsx b/packages/views/issues/components/issue-runs-dialog.test.tsx
index 4927fd53e7..0ee3d85036 100644
--- a/packages/views/issues/components/issue-runs-dialog.test.tsx
+++ b/packages/views/issues/components/issue-runs-dialog.test.tsx
@@ -406,7 +406,7 @@ describe("IssueRunsDialog", () => {
}),
]);
- expect(screen.getByTitle("Wakeup · When CI finishes")).toHaveTextContent("Wakeup · When CI finishes");
+ expect(screen.getByText("Wakeup · When CI finishes")).toBeInTheDocument();
expect(screen.queryByText(/“/)).not.toBeInTheDocument();
});
@@ -414,7 +414,19 @@ describe("IssueRunsDialog", () => {
const long = "把之前拆出去的三个子任务都合并回这个 PR,conditions / history / runaway protection 一起做完再提交";
open([makeTask({ trigger_comment_id: "comment-1", trigger_summary: long, usage: [usage()] })]);
- expect(screen.getByText(`“${long}”`)).toHaveAttribute("title", `“${long}”`);
+ // jsdom has no layout: give the line the clipped box a browser would.
+ const line = screen.getByText(`“${long}”`);
+ line.style.overflowX = "hidden";
+ Object.defineProperties(line, {
+ scrollWidth: { configurable: true, value: 600 },
+ clientWidth: { configurable: true, value: 200 },
+ });
+ vi.useFakeTimers();
+ fireEvent.pointerEnter(line, { pointerType: "mouse" });
+ act(() => {
+ vi.advanceTimersByTime(250);
+ });
+ expect(document.querySelector("[data-slot='tooltip-content']")).toHaveTextContent(`“${long}”`);
});
it("renders in the member's language", () => {
diff --git a/packages/views/issues/components/issue-runs-dialog.tsx b/packages/views/issues/components/issue-runs-dialog.tsx
index 7383a2f5cd..d536ce4d30 100644
--- a/packages/views/issues/components/issue-runs-dialog.tsx
+++ b/packages/views/issues/components/issue-runs-dialog.tsx
@@ -11,6 +11,7 @@ import {
DialogHeader,
DialogTitle,
} from "@multica/ui/components/ui/dialog";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
import { useActorName } from "@multica/core/workspace/hooks";
import { useCustomPricingStore } from "@multica/core/runtimes/custom-pricing-store";
import { ActorAvatar } from "../../common/actor-avatar";
@@ -852,15 +853,16 @@ function RunListRow({ run, issueId }: { run: TimelineRun; issueId: string }) {
tooltip and, whole and wrapped, at the top of the transcript. */}
<RunTriggerLabel task={task} fallback={label}>
{(text) => (
- <span
- title={text}
- className={cn(
- "min-w-0 flex-1 truncate text-label",
- run.usage || run.active ? "text-foreground" : "text-muted-foreground",
- )}
- >
- {text}
- </span>
+ <TruncatedTooltip content={text}>
+ <span
+ className={cn(
+ "min-w-0 flex-1 truncate text-label",
+ run.usage || run.active ? "text-foreground" : "text-muted-foreground",
+ )}
+ >
+ {text}
+ </span>
+ </TruncatedTooltip>
)}
</RunTriggerLabel>
<ArrowRight aria-hidden className={cn(COL.arrow, "size-3 text-faint-foreground")} />
@@ -1039,9 +1041,11 @@ function RunDetails({ id, run, reason }: { id: string; run: TimelineRun; reason:
{run.task.branch_name && (
<>
<dt className="text-muted-foreground">{t(($) => $.runs_timeline.detail_branch)}</dt>
- <dd className="min-w-0 truncate font-mono text-micro" title={run.task.branch_name}>
- {run.task.branch_name}
- </dd>
+ <TruncatedTooltip content={run.task.branch_name}>
+ <dd className="min-w-0 truncate font-mono text-micro">
+ {run.task.branch_name}
+ </dd>
+ </TruncatedTooltip>
</>
)}
</dl>
diff --git a/packages/views/issues/components/system-wakeup-row.tsx b/packages/views/issues/components/system-wakeup-row.tsx
index 9166f3877d..3596cf398b 100644
--- a/packages/views/issues/components/system-wakeup-row.tsx
+++ b/packages/views/issues/components/system-wakeup-row.tsx
@@ -15,6 +15,7 @@ import {
PopoverTitle,
PopoverTrigger,
} from "@multica/ui/components/ui/popover";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
import { useT } from "../../i18n";
import { useWakeupText } from "./wakeup-presentation";
@@ -184,9 +185,11 @@ function InstructionEditor({
) : (
<div className="text-caption text-muted-foreground">
<p>{t(($) => $.wakeups.system.instruction_default)}</p>
- <p className="mt-1 line-clamp-4 whitespace-pre-wrap break-words" title={rule.default_instruction}>
- {rule.default_instruction}
- </p>
+ <TruncatedTooltip content={rule.default_instruction}>
+ <p className="mt-1 line-clamp-4 whitespace-pre-wrap break-words">
+ {rule.default_instruction}
+ </p>
+ </TruncatedTooltip>
</div>
)}
</div>
diff --git a/packages/views/labels/label-chip.tsx b/packages/views/labels/label-chip.tsx
index 4b3dbcd8ad..336b684939 100644
--- a/packages/views/labels/label-chip.tsx
+++ b/packages/views/labels/label-chip.tsx
@@ -4,6 +4,7 @@ import type { Label } from "@multica/core/types";
import { X } from "lucide-react";
import { TooltipHint } from "@multica/ui/components/common/tooltip-hint";
import { useT } from "../i18n";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
/**
* Map a label's `#rrggbb` color to a readable text color.
@@ -65,11 +66,13 @@ export function LabelChip({ label, onRemove, className, fullName }: LabelChipPro
className={`inline-flex min-w-0 items-center gap-1 rounded-full px-2 py-0.5 text-caption font-medium ${className ?? ""}`}
style={{ backgroundColor: label.color, color: textColor }}
// aria-label exposes the full name to screen readers when the span
- // visually truncates. title stays for sighted hover-tooltip.
+ // visually truncates; sighted users get it from the hover tooltip,
+ // which only opens when the name is actually cut off.
aria-label={label.name}
- title={label.name}
>
- <span className={nameClass}>{label.name}</span>
+ <TruncatedTooltip content={fullName ? null : label.name}>
+ <span className={nameClass}>{label.name}</span>
+ </TruncatedTooltip>
{onRemove && (
<TooltipHint label={t(($) => $.remove_label, { name: label.name })}>
<button
diff --git a/packages/views/projects/components/project-picker.test.tsx b/packages/views/projects/components/project-picker.test.tsx
index bcffcf7e09..08da9a4f44 100644
--- a/packages/views/projects/components/project-picker.test.tsx
+++ b/packages/views/projects/components/project-picker.test.tsx
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from "vitest";
-import { render, screen } from "@testing-library/react";
+import { act, render, screen, within } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { I18nProvider } from "@multica/core/i18n/react";
import enProjects from "../../locales/en/projects.json";
@@ -110,6 +110,36 @@ describe("ProjectPicker", () => {
expect(screen.getByRole("button", { name: /mobile web/i })).toBeInTheDocument();
});
+ it("shows a truncated project name on keyboard focus, not a fitting one", async () => {
+ const user = userEvent.setup();
+ renderPicker();
+ await user.click(screen.getByRole("button", { name: /launch command center/i }));
+ await screen.findByPlaceholderText(SEARCH_PLACEHOLDER);
+ const rows = Array.from(document.querySelectorAll<HTMLButtonElement>("button[data-picker-item]"));
+ const longRow = rows.find((row) => row.textContent === "Launch Command Center")!;
+ const shortRow = rows.find((row) => row.textContent === "Mobile Web")!;
+
+ // jsdom has no layout: clip the long row's label the way `truncate` would.
+ const label = within(longRow).getByText("Launch Command Center");
+ label.style.overflowX = "hidden";
+ Object.defineProperties(label, {
+ scrollWidth: { configurable: true, value: 240 },
+ clientWidth: { configurable: true, value: 120 },
+ });
+
+ await act(async () => {
+ shortRow.focus();
+ });
+ expect(document.querySelector("[data-slot='tooltip-content']")).toBeNull();
+
+ await act(async () => {
+ longRow.focus();
+ });
+ expect(document.querySelector("[data-slot='tooltip-content']")).toHaveTextContent(
+ "Launch Command Center",
+ );
+ });
+
it("locks every mutation path when disabled", async () => {
// Regression (MUL-5150): a keyboard user could Tab to the inline clear
// button and detach the project while a chat send was in flight,
diff --git a/packages/views/runtimes/components/runtime-detail.tsx b/packages/views/runtimes/components/runtime-detail.tsx
index 63bf651864..2f2dd4e20f 100644
--- a/packages/views/runtimes/components/runtime-detail.tsx
+++ b/packages/views/runtimes/components/runtime-detail.tsx
@@ -30,11 +30,6 @@ import {
} from "@multica/core/agents";
import { useWorkspacePaths } from "@multica/core/paths";
import { Button } from "@multica/ui/components/ui/button";
-import {
- Tooltip,
- TooltipContent,
- TooltipTrigger,
-} from "@multica/ui/components/ui/tooltip";
import { ActorAvatar } from "../../common/actor-avatar";
import { BreadcrumbHeader } from "../../layout/breadcrumb-header";
import { AppLink, useNavigation } from "../../navigation";
@@ -47,6 +42,7 @@ import { RuntimeAccessEditor, RuntimeAccessReadout } from "./runtime-access-edit
import { DeleteRuntimeProfileDialog } from "./delete-runtime-profile-dialog";
import { runtimeRowLabel } from "./runtime-machines";
import { useT, useTimeAgo } from "../../i18n";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
function getCliVersion(metadata: Record<string, unknown>): string | null {
if (
@@ -312,16 +308,11 @@ function HeroCard({
</Fact>
<Fact label={t(($) => $.detail.fact_device)}>
{device?.hostname ? (
- <Tooltip>
- <TooltipTrigger
- render={
- <span className="block truncate font-mono text-caption">
- {device.hostname}
- </span>
- }
- />
- <TooltipContent>{device.hostname}</TooltipContent>
- </Tooltip>
+ <TruncatedTooltip content={device.hostname}>
+ <span className="block truncate font-mono text-caption">
+ {device.hostname}
+ </span>
+ </TruncatedTooltip>
) : (
<span className="text-body text-muted-foreground">—</span>
)}
diff --git a/packages/views/runtimes/components/runtime-list.tsx b/packages/views/runtimes/components/runtime-list.tsx
index 80ae1b1802..d45b103c92 100644
--- a/packages/views/runtimes/components/runtime-list.tsx
+++ b/packages/views/runtimes/components/runtime-list.tsx
@@ -76,6 +76,7 @@ import {
} from "./pending-runtime";
import { useT, useTimeAgo } from "../../i18n";
import { DeferredTooltip } from "@multica/ui/components/common/deferred-tooltip";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
// The machine detail's runtimes table on the shared ListGrid. Paradigm
// pieces are taken À LA CARTE here: subgrid template + var-width tracks +
@@ -453,16 +454,19 @@ export function CliCell({ runtime }: { runtime: AgentRuntime }) {
return (
<div className="flex min-w-0 flex-col text-caption">
{command && (
- <span
- className="truncate font-mono text-muted-foreground"
- title={command}
- >
- {command}
- </span>
+ <TruncatedTooltip content={command}>
+ <span
+ className="truncate font-mono text-muted-foreground"
+ >
+ {command}
+ </span>
+ </TruncatedTooltip>
)}
- <span className="truncate text-destructive" title={failure}>
- {failure}
- </span>
+ <TruncatedTooltip content={failure}>
+ <span className="truncate text-destructive">
+ {failure}
+ </span>
+ </TruncatedTooltip>
</div>
);
}
@@ -477,12 +481,13 @@ export function CliCell({ runtime }: { runtime: AgentRuntime }) {
}
return (
<div className="flex min-w-0 items-center text-caption">
- <span
- className="truncate font-mono text-muted-foreground"
- title={command}
- >
- {command}
- </span>
+ <TruncatedTooltip content={command}>
+ <span
+ className="truncate font-mono text-muted-foreground"
+ >
+ {command}
+ </span>
+ </TruncatedTooltip>
</div>
);
}
diff --git a/packages/views/settings/components/members-tab.tsx b/packages/views/settings/components/members-tab.tsx
index e631f76c51..e6d3308342 100644
--- a/packages/views/settings/components/members-tab.tsx
+++ b/packages/views/settings/components/members-tab.tsx
@@ -66,6 +66,7 @@ import {
DropdownMenuSubTrigger,
DropdownMenuSubContent,
} from "@multica/ui/components/ui/dropdown-menu";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
import { toast } from "sonner";
import { useQuery, useQueryClient } from "@tanstack/react-query";
import { useAuthStore } from "@multica/core/auth";
@@ -375,12 +376,13 @@ function ShareLinkRow({
<span>{t(($) => $.members.share_link_uses, { used: link.use_count, max: link.max_uses ?? "∞" })}</span>
{link.expires_at && <span>· {t(($) => $.members.share_link_expires, { date: new Date(link.expires_at).toLocaleDateString(locale) })}</span>}
</div>
- <div
- className="truncate font-mono text-caption text-muted-foreground"
- title={joinUrl}
- >
- {joinUrl}
- </div>
+ <TruncatedTooltip content={joinUrl}>
+ <div
+ className="truncate font-mono text-caption text-muted-foreground"
+ >
+ {joinUrl}
+ </div>
+ </TruncatedTooltip>
</div>
<span className="w-24 shrink-0 text-body">{rc.label}</span>
<IconButton
diff --git a/packages/views/settings/components/repositories-section.tsx b/packages/views/settings/components/repositories-section.tsx
index 336e13f81a..d1926b1d3d 100644
--- a/packages/views/settings/components/repositories-section.tsx
+++ b/packages/views/settings/components/repositories-section.tsx
@@ -48,6 +48,7 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
} from "@multica/ui/components/ui/dropdown-menu";
+import { TruncatedTooltip } from "@multica/ui/components/common/truncated-tooltip";
import { toast } from "sonner";
import {
useInfiniteQuery,
@@ -452,9 +453,11 @@ export function RepositoriesSection() {
)}
</span>
<div className="min-w-0 flex-1">
- <p className="truncate font-mono text-label" title={repository.url}>
- {repository.url}
- </p>
+ <TruncatedTooltip content={repository.url}>
+ <p className="truncate font-mono text-label">
+ {repository.url}
+ </p>
+ </TruncatedTooltip>
{repository.description ? (
<p className="mt-0.5 truncate text-caption text-muted-foreground">
{repository.description}