Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

feat(lint): ban native title tooltips and migrate to styled Tooltip (#7209)

Utkarsh Patilfee10def1afb
diff --git a/apps/web/src/browser/BrowserDeviceToolbar.tsx b/apps/web/src/browser/BrowserDeviceToolbar.tsx
index cd33bd216..65d2b538a 100644
--- a/apps/web/src/browser/BrowserDeviceToolbar.tsx
+++ b/apps/web/src/browser/BrowserDeviceToolbar.tsx
@@ -12,6 +12,7 @@ import { useState } from "react";
import { Button } from "~/components/ui/button";
import { Input } from "~/components/ui/input";
+import { Tooltip, TooltipPopup, TooltipTrigger } from "~/components/ui/tooltip";
import {
Select,
SelectGroup,
@@ -296,26 +297,34 @@ export function BrowserDeviceToolbar({
/>
</form>
- <Button
- variant="ghost"
- size="icon-xs"
- type="button"
- aria-label={
- aspectRatio === null ? "Lock viewport aspect ratio" : "Unlock viewport aspect ratio"
- }
- aria-pressed={aspectRatio !== null}
- title={aspectRatio === null ? "Lock aspect ratio" : "Unlock aspect ratio"}
- className={cn(aspectRatio !== null && "bg-accent text-foreground")}
- disabled={pending || !customValid}
- onPointerDown={(event) => event.preventDefault()}
- onClick={toggleAspectRatio}
- >
- {aspectRatio === null ? (
- <Unlink2 className={cn(aspectRatio !== null && "text-foreground")} />
- ) : (
- <Link2 className={cn(aspectRatio !== null && "text-foreground")} />
- )}
- </Button>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="icon-xs"
+ type="button"
+ aria-label={
+ aspectRatio === null ? "Lock viewport aspect ratio" : "Unlock viewport aspect ratio"
+ }
+ aria-pressed={aspectRatio !== null}
+ className={cn(aspectRatio !== null && "bg-accent text-foreground")}
+ disabled={pending || !customValid}
+ onPointerDown={(event) => event.preventDefault()}
+ onClick={toggleAspectRatio}
+ />
+ }
+ >
+ {aspectRatio === null ? (
+ <Unlink2 className={cn(aspectRatio !== null && "text-foreground")} />
+ ) : (
+ <Link2 className={cn(aspectRatio !== null && "text-foreground")} />
+ )}
+ </TooltipTrigger>
+ <TooltipPopup side="top">
+ {aspectRatio === null ? "Lock aspect ratio" : "Unlock aspect ratio"}
+ </TooltipPopup>
+ </Tooltip>
<Button
variant="ghost"
size="icon-xs"
diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx
index feac2d597..0a5b7bb8c 100644
--- a/apps/web/src/components/ChatView.tsx
+++ b/apps/web/src/components/ChatView.tsx
@@ -6348,7 +6348,6 @@ function ChatViewContent(props: ChatViewProps) {
>
<Button
aria-label="Scroll to end"
- title="Scroll to end"
onClick={() => scrollToEnd(true)}
className="pointer-events-auto gap-1.5 rounded-full px-3 text-muted-foreground hover:text-foreground"
size="xs"
diff --git a/apps/web/src/components/ConnectionStatusDot.tsx b/apps/web/src/components/ConnectionStatusDot.tsx
index 2efddcfa7..6a23a0532 100644
--- a/apps/web/src/components/ConnectionStatusDot.tsx
+++ b/apps/web/src/components/ConnectionStatusDot.tsx
@@ -59,7 +59,6 @@ export function ConnectionStatusDot({
const dot = (
<button
type="button"
- title={tooltipText}
aria-label={tooltipText}
className="relative flex size-3 shrink-0 cursor-help items-center justify-center rounded-full outline-hidden"
>
diff --git a/apps/web/src/components/DiffPanel.tsx b/apps/web/src/components/DiffPanel.tsx
index 66f0a4e11..53de0fdb8 100644
--- a/apps/web/src/components/DiffPanel.tsx
+++ b/apps/web/src/components/DiffPanel.tsx
@@ -583,11 +583,19 @@ export default function DiffPanel({
{selectedTurnId === null && selectedGitScope === "branch" && selectedGitSource?.baseRef && (
<div
className="flex min-w-0 max-w-full items-center gap-2 overflow-hidden text-xs text-muted-foreground"
- title={`${selectedGitSource.headRef ?? "HEAD"} → ${selectedGitSource.baseRef}`}
aria-label={`Comparing ${selectedGitSource.headRef ?? "HEAD"} against ${selectedGitSource.baseRef}`}
>
- <span className="min-w-0 max-w-48 truncate">{selectedGitSource.headRef ?? "HEAD"}</span>
- <ArrowRightIcon className="size-3.5 shrink-0 opacity-70" />
+ <Tooltip>
+ <TooltipTrigger render={<span className="flex min-w-0 items-center gap-2" />}>
+ <span className="min-w-0 max-w-48 truncate">
+ {selectedGitSource.headRef ?? "HEAD"}
+ </span>
+ <ArrowRightIcon className="size-3.5 shrink-0 opacity-70" />
+ </TooltipTrigger>
+ <TooltipPopup side="top">
+ {`${selectedGitSource.headRef ?? "HEAD"} → ${selectedGitSource.baseRef}`}
+ </TooltipPopup>
+ </Tooltip>
<Combobox
items={baseRefItems}
filteredItems={filteredBaseRefItems}
@@ -677,12 +685,20 @@ export default function DiffPanel({
/>
</div>
) : choice.remote ? (
- <span
- className="flex justify-end text-muted-foreground"
- title="Remote only"
- >
- <CheckIcon aria-hidden="true" className="size-3" />
- </span>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <span className="flex justify-end text-muted-foreground">
+ <CheckIcon
+ role="img"
+ aria-label="Remote only"
+ className="size-3"
+ />
+ </span>
+ }
+ />
+ <TooltipPopup side="top">Remote only</TooltipPopup>
+ </Tooltip>
) : null}
</div>
</ComboboxItem>
diff --git a/apps/web/src/components/ServerUpdateAction.tsx b/apps/web/src/components/ServerUpdateAction.tsx
index 40d55e3a5..87f903c9c 100644
--- a/apps/web/src/components/ServerUpdateAction.tsx
+++ b/apps/web/src/components/ServerUpdateAction.tsx
@@ -11,6 +11,7 @@ import { useAtomCommand } from "~/state/use-atom-command";
import { manualServerUpdateCommand } from "~/versionSkew";
import { Button } from "./ui/button";
import { toastManager } from "./ui/toast";
+import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";
// The wire "installing" stage is a sub-second launcher handoff, so the UI
// folds it into the download phase; everything after the handoff is the
@@ -45,9 +46,12 @@ export function ServerUpdateProgress({
return (
<div className="mt-1 flex min-w-0 items-center gap-2 text-xs text-destructive" role="alert">
<span className="size-1.5 shrink-0 rounded-full bg-destructive" aria-hidden="true" />
- <span className="min-w-0 truncate" title={state.message}>
- {state.message}
- </span>
+ <Tooltip>
+ <TooltipTrigger render={<span className="min-w-0 truncate">{state.message}</span>} />
+ <TooltipPopup side="top" className="max-w-80">
+ {state.message}
+ </TooltipPopup>
+ </Tooltip>
</div>
);
}
diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx
index 5ae583b66..d7285d749 100644
--- a/apps/web/src/components/Sidebar.tsx
+++ b/apps/web/src/components/Sidebar.tsx
@@ -537,15 +537,21 @@ const SidebarDraftRow = memo(function SidebarDraftRow(props: {
{props.projectTitle}
</span>
<span className="ml-auto flex h-5 min-w-5 shrink-0 items-center justify-end">
- <button
- type="button"
- aria-label="Discard draft"
- title="Discard draft"
- onClick={handleDiscard}
- className="pointer-events-none inline-flex cursor-pointer items-center rounded-md bg-transparent px-1 text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:pointer-events-auto focus-visible:opacity-100 group-hover/sidebar-row:pointer-events-auto group-hover/sidebar-row:opacity-100"
- >
- <XIcon className="size-3" />
- </button>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <button
+ type="button"
+ aria-label="Discard draft"
+ onClick={handleDiscard}
+ className="pointer-events-none inline-flex cursor-pointer items-center rounded-md bg-transparent px-1 text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:pointer-events-auto focus-visible:opacity-100 group-hover/sidebar-row:pointer-events-auto group-hover/sidebar-row:opacity-100"
+ >
+ <XIcon className="size-3" />
+ </button>
+ }
+ />
+ <TooltipPopup side="top">Discard draft</TooltipPopup>
+ </Tooltip>
</span>
</div>
<div className="mt-0.5 truncate text-sm font-medium text-foreground/90">{preview}</div>
@@ -1247,16 +1253,22 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
) : isWoke ? (
// A wake can land straight in the settled tail (e.g. PR
// merged while snoozed); the signal must survive the trip.
- <button
- type="button"
- aria-label="Dismiss Woke notification"
- title="Dismiss Woke notification"
- onClick={handleAcknowledgeWokeClick}
- className="inline-flex cursor-pointer items-center gap-1 rounded-sm text-xs font-medium text-amber-700 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring dark:text-amber-300"
- >
- <AlarmClockIcon aria-hidden className="size-3" />
- <span role="status">Woke</span>
- </button>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <button
+ type="button"
+ aria-label="Dismiss Woke notification"
+ onClick={handleAcknowledgeWokeClick}
+ className="inline-flex cursor-pointer items-center gap-1 rounded-sm text-xs font-medium text-amber-700 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring dark:text-amber-300"
+ >
+ <AlarmClockIcon aria-hidden className="size-3" />
+ <span role="status">Woke</span>
+ </button>
+ }
+ />
+ <TooltipPopup side="top">Dismiss Woke notification</TooltipPopup>
+ </Tooltip>
) : (
<span className="text-xs">
{variantAction === "unsettle"
@@ -1414,19 +1426,25 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: {
>
{topStatus ? (
isWokeStatus ? (
- <button
- type="button"
- aria-label="Dismiss Woke notification"
- title="Dismiss Woke notification"
- onClick={handleAcknowledgeWokeClick}
- className={cn(
- "inline-flex cursor-pointer items-center gap-1 rounded-sm font-medium outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring",
- topStatus.className,
- )}
- >
- <AlarmClockIcon aria-hidden className="size-4 shrink-0" />
- <span role="status">{topStatus.label}</span>
- </button>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <button
+ type="button"
+ aria-label="Dismiss Woke notification"
+ onClick={handleAcknowledgeWokeClick}
+ className={cn(
+ "inline-flex cursor-pointer items-center gap-1 rounded-sm font-medium outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring",
+ topStatus.className,
+ )}
+ >
+ <AlarmClockIcon aria-hidden className="size-4 shrink-0" />
+ <span role="status">{topStatus.label}</span>
+ </button>
+ }
+ />
+ <TooltipPopup side="top">Dismiss Woke notification</TooltipPopup>
+ </Tooltip>
) : (
<span
className={cn(
diff --git a/apps/web/src/components/chat/ChangedFilesTree.tsx b/apps/web/src/components/chat/ChangedFilesTree.tsx
index 7ff9d1d24..1212030ba 100644
--- a/apps/web/src/components/chat/ChangedFilesTree.tsx
+++ b/apps/web/src/components/chat/ChangedFilesTree.tsx
@@ -174,21 +174,26 @@ export const ChangedFilesCard = memo(function ChangedFilesCard(props: {
</p>
<div className="mt-2 flex flex-wrap items-center gap-1.5">
{previewFiles.map((file) => (
- <button
- key={file.path}
- type="button"
- title={file.path}
- className="inline-flex max-w-48 items-center gap-1 rounded-md border border-border/70 bg-background/45 px-1.5 py-1 font-mono text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
- onClick={() => onOpenTurnDiff(turnId, file.path)}
- >
- <PierreEntryIcon
- pathValue={file.path}
- kind="file"
- theme={resolvedTheme}
- className="size-3 shrink-0 text-muted-foreground/70"
- />
- <span className="truncate">{changedFileName(file.path)}</span>
- </button>
+ <Tooltip key={file.path}>
+ <TooltipTrigger
+ render={
+ <button
+ type="button"
+ className="inline-flex max-w-48 items-center gap-1 rounded-md border border-border/70 bg-background/45 px-1.5 py-1 font-mono text-[10px] text-muted-foreground transition-colors hover:bg-accent/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ onClick={() => onOpenTurnDiff(turnId, file.path)}
+ />
+ }
+ >
+ <PierreEntryIcon
+ pathValue={file.path}
+ kind="file"
+ theme={resolvedTheme}
+ className="size-3 shrink-0 text-muted-foreground/70"
+ />
+ <span className="truncate">{changedFileName(file.path)}</span>
+ </TooltipTrigger>
+ <TooltipPopup side="top">{file.path}</TooltipPopup>
+ </Tooltip>
))}
<button
type="button"
diff --git a/apps/web/src/components/chat/ComposerPreviewAnnotationCards.test.tsx b/apps/web/src/components/chat/ComposerPreviewAnnotationCards.test.tsx
index 46af29907..4ee61b556 100644
--- a/apps/web/src/components/chat/ComposerPreviewAnnotationCards.test.tsx
+++ b/apps/web/src/components/chat/ComposerPreviewAnnotationCards.test.tsx
@@ -37,8 +37,9 @@ describe("ComposerPreviewAnnotationCards", () => {
);
expect(markup).toContain("Make this headline feel intentional.");
- expect(markup).toContain('title="1 region"');
- expect(markup).toContain('title="1 style change"');
+ expect(markup.match(/data-slot="tooltip-trigger"/g)).toHaveLength(2);
+ expect(markup).not.toContain('title="1 region"');
+ expect(markup).not.toContain('title="1 style change"');
expect(markup).not.toContain("Welcome");
expect(markup).not.toContain("localhost:3000");
expect(markup).not.toContain("Preview annotation");
diff --git a/apps/web/src/components/chat/ComposerPreviewAnnotationCards.tsx b/apps/web/src/components/chat/ComposerPreviewAnnotationCards.tsx
index 19f6a5ca3..0287dde73 100644
--- a/apps/web/src/components/chat/ComposerPreviewAnnotationCards.tsx
+++ b/apps/web/src/components/chat/ComposerPreviewAnnotationCards.tsx
@@ -6,6 +6,7 @@ import type { ComposerImageAttachment } from "~/composerDraftStore";
import { formatElementContextLabel, normalizeElementContextSelection } from "~/lib/elementContext";
import { cn } from "~/lib/utils";
import { Button } from "../ui/button";
+import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
interface ComposerPreviewAnnotationCardsProps {
annotations: ReadonlyArray<PreviewAnnotationPayload>;
@@ -16,14 +17,19 @@ interface ComposerPreviewAnnotationCardsProps {
}
function TargetStat(props: { icon: ReactNode; count: number; label: string }) {
+ const tooltipText = `${props.count} ${props.label}${props.count === 1 ? "" : "s"}`;
return (
- <span
- className="inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground"
- title={`${props.count} ${props.label}${props.count === 1 ? "" : "s"}`}
- >
- {props.icon}
- {props.count}
- </span>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <span className="inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground">
+ {props.icon}
+ {props.count}
+ </span>
+ }
+ />
+ <TooltipPopup side="top">{tooltipText}</TooltipPopup>
+ </Tooltip>
);
}
diff --git a/apps/web/src/components/chat/DraftHeroHeadline.tsx b/apps/web/src/components/chat/DraftHeroHeadline.tsx
index 9377dfa22..57f9d7792 100644
--- a/apps/web/src/components/chat/DraftHeroHeadline.tsx
+++ b/apps/web/src/components/chat/DraftHeroHeadline.tsx
@@ -23,6 +23,7 @@ import {
MenuSeparator,
MenuTrigger,
} from "../ui/menu";
+import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
interface DraftHeroHeadlineProps {
readonly activeProjectRef: ScopedProjectRef | null;
@@ -99,13 +100,23 @@ export function DraftHeroHeadline({
const projectSelector = shouldShowProjectMenu ? (
<Menu>
- <MenuTrigger
- aria-label={hasResolvedProject ? "Change project" : "Choose a project"}
- className="pointer-events-auto inline-block max-w-64 truncate border-foreground/60 border-b border-dotted align-baseline text-foreground transition-colors hover:border-foreground/80 focus-visible:rounded-sm focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring"
- title={activeProjectDisplayName ?? undefined}
- >
- {activeProjectDisplayName ?? "Choose a project"}
- </MenuTrigger>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <MenuTrigger
+ aria-label={hasResolvedProject ? "Change project" : "Choose a project"}
+ className="pointer-events-auto inline-block max-w-64 truncate border-foreground/60 border-b border-dotted align-baseline text-foreground transition-colors hover:border-foreground/80 focus-visible:rounded-sm focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring"
+ />
+ }
+ >
+ {activeProjectDisplayName ?? "Choose a project"}
+ </TooltipTrigger>
+ {activeProjectDisplayName ? (
+ <TooltipPopup side="top" className="max-w-80">
+ {activeProjectDisplayName}
+ </TooltipPopup>
+ ) : null}
+ </Tooltip>
<MenuPopup align="center" className="max-h-80 min-w-40! w-max max-w-64 overflow-y-auto">
<MenuRadioGroup
value={activeProjectKey}
@@ -126,9 +137,14 @@ export function DraftHeroHeadline({
{projectPickerEntries.map(({ group }) => {
return (
<MenuRadioItem key={group.projectKey} value={group.projectKey} closeOnClick>
- <span className="block min-w-0 truncate" title={group.displayName}>
- {group.displayName}
- </span>
+ <Tooltip>
+ <TooltipTrigger render={<span className="block min-w-0 truncate" />}>
+ {group.displayName}
+ </TooltipTrigger>
+ <TooltipPopup side="top" className="max-w-80">
+ {group.displayName}
+ </TooltipPopup>
+ </Tooltip>
</MenuRadioItem>
);
})}
diff --git a/apps/web/src/components/files/FilePreviewPanel.tsx b/apps/web/src/components/files/FilePreviewPanel.tsx
index 19bf2d5ad..1bdebc5a4 100644
--- a/apps/web/src/components/files/FilePreviewPanel.tsx
+++ b/apps/web/src/components/files/FilePreviewPanel.tsx
@@ -880,17 +880,25 @@ export default function FilePreviewPanel({
{index > 0 ? (
<ChevronRight className="mx-1 size-3.5 shrink-0 text-muted-foreground/60" />
) : null}
- <span
- className={cn(
- "max-w-40 truncate",
- crumb.kind === "file"
- ? "font-medium text-foreground"
- : "text-muted-foreground",
- )}
- title={crumb.path || projectName}
- >
- {crumb.label}
- </span>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <span
+ className={cn(
+ "max-w-40 truncate",
+ crumb.kind === "file"
+ ? "font-medium text-foreground"
+ : "text-muted-foreground",
+ )}
+ />
+ }
+ >
+ {crumb.label}
+ </TooltipTrigger>
+ <TooltipPopup side="top" className="max-w-80">
+ {crumb.path || projectName}
+ </TooltipPopup>
+ </Tooltip>
</div>
))}
</div>
diff --git a/apps/web/src/components/preview/ThreadPreviewMiniPlayer.tsx b/apps/web/src/components/preview/ThreadPreviewMiniPlayer.tsx
index 2bdba1afe..623928d10 100644
--- a/apps/web/src/components/preview/ThreadPreviewMiniPlayer.tsx
+++ b/apps/web/src/components/preview/ThreadPreviewMiniPlayer.tsx
@@ -8,6 +8,7 @@ import { BrowserSurfaceSlot } from "~/browser/BrowserSurfaceSlot";
import { previewRuntimeTabId } from "~/browser/previewRuntimeTabId";
import { Button } from "~/components/ui/button";
import { toastManager } from "~/components/ui/toast";
+import { Tooltip, TooltipPopup, TooltipTrigger } from "~/components/ui/tooltip";
import { useThreadPreviewState } from "~/previewStateStore";
import { selectThreadPreviewMiniPlayer, usePreviewMiniPlayerStore } from "~/previewMiniPlayerStore";
import { useRightPanelStore } from "~/rightPanelStore";
@@ -254,45 +255,63 @@ export function ThreadPreviewMiniPlayer({ threadRef, tabId, bottomInset }: Props
onPointerUp={endDrag}
onPointerCancel={endDrag}
>
- <Button
- variant="ghost"
- size="icon-xs"
- aria-label="Open preview in right panel"
- title="Open in right panel"
- onPointerDown={(event) => event.stopPropagation()}
- onClick={openInPanel}
- >
- <PanelRightIcon />
- </Button>
- <Button
- variant={desktopOverlay?.pictureInPicture ? "secondary" : "ghost"}
- size="icon-xs"
- aria-label={
- desktopOverlay?.pictureInPicture
- ? "Close popped-out preview"
- : "Pop preview into separate window"
- }
- title={
- desktopOverlay?.pictureInPicture
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="icon-xs"
+ aria-label="Open preview in right panel"
+ onPointerDown={(event) => event.stopPropagation()}
+ onClick={openInPanel}
+ />
+ }
+ >
+ <PanelRightIcon />
+ </TooltipTrigger>
+ <TooltipPopup side="top">Open in right panel</TooltipPopup>
+ </Tooltip>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ variant={desktopOverlay?.pictureInPicture ? "secondary" : "ghost"}
+ size="icon-xs"
+ aria-label={
+ desktopOverlay?.pictureInPicture
+ ? "Close popped-out preview"
+ : "Pop preview into separate window"
+ }
+ disabled={!desktopOverlay?.hasWebContents}
+ onPointerDown={(event) => event.stopPropagation()}
+ onClick={toggleNativePictureInPicture}
+ />
+ }
+ >
+ <PictureInPicture2 />
+ </TooltipTrigger>
+ <TooltipPopup side="top">
+ {desktopOverlay?.pictureInPicture
? "Close separate window"
- : "Pop into separate window"
- }
- disabled={!desktopOverlay?.hasWebContents}
- onPointerDown={(event) => event.stopPropagation()}
- onClick={toggleNativePictureInPicture}
- >
- <PictureInPicture2 />
- </Button>
- <Button
- variant="ghost"
- size="icon-xs"
- aria-label="Close floating preview"
- title="Close floating preview"
- onPointerDown={(event) => event.stopPropagation()}
- onClick={close}
- >
- <XIcon />
- </Button>
+ : "Pop into separate window"}
+ </TooltipPopup>
+ </Tooltip>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="icon-xs"
+ aria-label="Close floating preview"
+ onPointerDown={(event) => event.stopPropagation()}
+ onClick={close}
+ />
+ }
+ >
+ <XIcon />
+ </TooltipTrigger>
+ <TooltipPopup side="top">Close floating preview</TooltipPopup>
+ </Tooltip>
</div>
</div>
@@ -319,7 +338,6 @@ export function ThreadPreviewMiniPlayer({ threadRef, tabId, bottomInset }: Props
<button
type="button"
aria-label="Resize floating preview"
- title="Resize floating preview"
className="pointer-events-auto absolute bottom-0 right-0 z-[33] size-5 cursor-nwse-resize rounded-br-xl after:absolute after:bottom-1 after:right-1 after:size-2 after:border-b after:border-r after:border-foreground/45"
onPointerDown={handleResizePointerDown}
onPointerMove={handleResizePointerMove}
diff --git a/apps/web/src/components/pullRequest/PullRequestChecksPopover.tsx b/apps/web/src/components/pullRequest/PullRequestChecksPopover.tsx
index 3b8ffd2b2..8070af60c 100644
--- a/apps/web/src/components/pullRequest/PullRequestChecksPopover.tsx
+++ b/apps/web/src/components/pullRequest/PullRequestChecksPopover.tsx
@@ -11,6 +11,7 @@ import { pullRequestEnvironment } from "~/state/pullRequests";
import { useEnvironmentQuery } from "~/state/query";
import { Popover, PopoverPopup, PopoverTrigger } from "../ui/popover";
+import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
import {
PullRequestCheckStatusIcon,
pullRequestCheckStatusLabel,
@@ -57,9 +58,12 @@ function ChecksBody({ checks }: { checks: ReadonlyArray<PullRequestCheck> }) {
{checks.map((check, index) => (
<li key={`${index}:${check.name}`} className="flex items-center gap-2 text-xs">
<PullRequestCheckStatusIcon status={check.status} />
- <span className="min-w-0 flex-1 truncate" title={check.description ?? check.name}>
- {check.name}
- </span>
+ <Tooltip>
+ <TooltipTrigger
+ render={<span className="min-w-0 flex-1 truncate">{check.name}</span>}
+ />
+ <TooltipPopup side="top">{check.description ?? check.name}</TooltipPopup>
+ </Tooltip>
<span className="shrink-0 text-muted-foreground">
{pullRequestCheckStatusLabel(check.status)}
</span>
diff --git a/apps/web/src/components/pullRequest/PullRequestCodeTab.tsx b/apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
index 4ffb1cbd6..7f4b8fa1f 100644
--- a/apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
+++ b/apps/web/src/components/pullRequest/PullRequestCodeTab.tsx
@@ -1006,9 +1006,12 @@ export function PullRequestCodeTab({
>
{/* Headlines run long, and the abbreviated oid after one is what a reader
matches against the commit list on the host. */}
- <span className="min-w-0 truncate" title={entry.messageHeadline}>
- {entry.messageHeadline}
- </span>
+ <Tooltip>
+ <TooltipTrigger
+ render={<span className="min-w-0 truncate">{entry.messageHeadline}</span>}
+ />
+ <TooltipPopup side="top">{entry.messageHeadline}</TooltipPopup>
+ </Tooltip>
<span className="ml-auto shrink-0 font-mono text-xs text-muted-foreground">
{entry.oid.slice(0, 7)}
</span>
@@ -1264,9 +1267,14 @@ export function PullRequestCodeTab({
<div className="max-h-64 space-y-3 overflow-auto px-4 pb-3">
{[...orphanFiles].map(([path, threads]) => (
<div key={path}>
- <p className="truncate px-3 text-xs text-muted-foreground" title={path}>
- {path}
- </p>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <p className="truncate px-3 text-xs text-muted-foreground">{path}</p>
+ }
+ />
+ <TooltipPopup side="top">{path}</TooltipPopup>
+ </Tooltip>
<div className="mt-1 space-y-2">
{threads.map((thread) => (
<div key={thread.id}>
diff --git a/apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx b/apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx
index 7eb03a863..a40150ae6 100644
--- a/apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx
+++ b/apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx
@@ -85,6 +85,7 @@ import {
} from "../ui/menu";
import { Popover, PopoverPopup, PopoverTrigger } from "../ui/popover";
import { toastManager } from "../ui/toast";
+import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
import { PullRequestDetailGhost, PullRequestTimelineGhost } from "./PullRequestGhosts";
import { PullRequestActivityUnavailableState } from "./PullRequestActivityUnavailableState";
import { DiffPanelLoadingState } from "../DiffPanelShell";
@@ -1086,22 +1087,31 @@ export function PullRequestDetailPanel({
>
{detail && statePresentation ? (
<>
- <span className="min-w-0 truncate" title={detail.repository}>
- {detail.repository}
- </span>
- <button
- type="button"
- onClick={() => void readLocalApi()?.shell.openExternal(detail.url)}
- onContextMenu={(event) => openNumberContextMenu(event, detail)}
- className={cn(
- "shrink-0 font-medium underline-offset-2 hover:underline",
- statePresentation.toneClassName,
- )}
- title={openOnHostLabel(detail.provider)}
- aria-label={`Open pull request #${detail.number} on host`}
- >
- #{detail.number}
- </button>
+ <Tooltip>
+ <TooltipTrigger
+ render={<span className="min-w-0 truncate">{detail.repository}</span>}
+ />
+ <TooltipPopup side="top">{detail.repository}</TooltipPopup>
+ </Tooltip>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <button
+ type="button"
+ onClick={() => void readLocalApi()?.shell.openExternal(detail.url)}
+ onContextMenu={(event) => openNumberContextMenu(event, detail)}
+ className={cn(
+ "shrink-0 font-medium underline-offset-2 hover:underline",
+ statePresentation.toneClassName,
+ )}
+ aria-label={`Open pull request #${detail.number} on host`}
+ >
+ #{detail.number}
+ </button>
+ }
+ />
+ <TooltipPopup side="top">{openOnHostLabel(detail.provider)}</TooltipPopup>
+ </Tooltip>
</>
) : null}
</div>
@@ -1117,23 +1127,36 @@ export function PullRequestDetailPanel({
>
{detail && statePresentation ? (
<>
- <button
- type="button"
- tabIndex={condensed ? 0 : -1}
- onClick={() => void readLocalApi()?.shell.openExternal(detail.url)}
- onContextMenu={(event) => openNumberContextMenu(event, detail)}
- className={cn(
- "shrink-0 font-medium underline-offset-2 hover:underline",
- statePresentation.toneClassName,
- )}
- title={openOnHostLabel(detail.provider)}
- aria-label={`Open pull request #${detail.number} on host`}
- >
- #{detail.number}
- </button>
- <span className="min-w-0 truncate font-medium text-foreground" title={detail.title}>
- {detail.title}
- </span>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <button
+ type="button"
+ tabIndex={condensed ? 0 : -1}
+ onClick={() => void readLocalApi()?.shell.openExternal(detail.url)}
+ onContextMenu={(event) => openNumberContextMenu(event, detail)}
+ className={cn(
+ "shrink-0 font-medium underline-offset-2 hover:underline",
+ statePresentation.toneClassName,
+ )}
+ aria-label={`Open pull request #${detail.number} on host`}
+ >
+ #{detail.number}
+ </button>
+ }
+ />
+ <TooltipPopup side="top">{openOnHostLabel(detail.provider)}</TooltipPopup>
+ </Tooltip>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <span className="min-w-0 truncate font-medium text-foreground">
+ {detail.title}
+ </span>
+ }
+ />
+ <TooltipPopup side="top">{detail.title}</TooltipPopup>
+ </Tooltip>
{conflicting ? (
<Badge
variant="error"
@@ -1385,14 +1408,22 @@ export function PullRequestDetailPanel({
{/* Said where the Merge button is, because it is the answer to why nobody has
pressed it: the merge is already asked for, and the host is holding it. */}
{autoMergeArmed ? (
- <Badge
- variant="info"
- className="h-5 shrink-0 gap-1 rounded px-1.5 text-[10px]"
- title="The host will merge this on its own once its requirements are met"
- >
- <GitMergeIcon aria-hidden className="size-3" />
- Auto-merge
- </Badge>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Badge
+ variant="info"
+ className="h-5 shrink-0 gap-1 rounded px-1.5 text-[10px]"
+ >
+ <GitMergeIcon aria-hidden className="size-3" />
+ Auto-merge
+ </Badge>
+ }
+ />
+ <TooltipPopup side="top">
+ The host will merge this on its own once its requirements are met
+ </TooltipPopup>
+ </Tooltip>
) : null}
{primaryAction === "ready" ? (
<Button size="xs" disabled={actionPending} onClick={() => void perform("ready")}>
@@ -1465,11 +1496,13 @@ export function PullRequestDetailPanel({
</button>
))}
</nav>
- <span
- className="ml-auto inline-flex min-w-0 shrink items-center gap-1 font-mono text-[11px] text-muted-foreground"
- title={`${detail.baseBranch} ← ${detail.headBranch}`}
- >
- <span className="truncate">{detail.baseBranch}</span>
+ <span className="ml-auto inline-flex min-w-0 shrink items-center gap-1 font-mono text-[11px] text-muted-foreground">
+ <Tooltip>
+ <TooltipTrigger render={<span className="truncate" />}>
+ {detail.baseBranch}
+ </TooltipTrigger>
+ <TooltipPopup side="top">{`${detail.baseBranch} ← ${detail.headBranch}`}</TooltipPopup>
+ </Tooltip>
{freshness ? (
<PullRequestBaseFreshnessWarning
baseBranch={detail.baseBranch}
@@ -1480,7 +1513,12 @@ export function PullRequestDetailPanel({
/>
) : null}
<ArrowLeftIcon aria-label="receives changes from" className="size-3 shrink-0" />
- <span className="truncate">{detail.headBranch}</span>
+ <Tooltip>
+ <TooltipTrigger render={<span className="truncate" />}>
+ {detail.headBranch}
+ </TooltipTrigger>
+ <TooltipPopup side="top">{`${detail.baseBranch} ← ${detail.headBranch}`}</TooltipPopup>
+ </Tooltip>
</span>
<span className="ml-2 inline-flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground">
<span className="inline-flex items-center gap-1 tabular-nums">
@@ -1594,12 +1632,16 @@ export function PullRequestDetailPanel({
</PullRequestMetaLine>
<div className="mt-4 flex min-w-0 items-center gap-2 text-xs text-muted-foreground">
- <code
- className="min-w-0 max-w-48 shrink truncate rounded-md bg-muted px-2 py-1 font-mono text-xs text-foreground"
- title={detail.baseBranch}
- >
- {detail.baseBranch}
- </code>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <code className="min-w-0 max-w-48 shrink truncate rounded-md bg-muted px-2 py-1 font-mono text-xs text-foreground">
+ {detail.baseBranch}
+ </code>
+ }
+ />
+ <TooltipPopup side="top">{detail.baseBranch}</TooltipPopup>
+ </Tooltip>
{freshness ? (
<PullRequestBaseFreshnessWarning
baseBranch={detail.baseBranch}
@@ -1609,32 +1651,41 @@ export function PullRequestDetailPanel({
/>
) : null}
<ArrowLeftIcon aria-label="receives changes from" className="size-4 shrink-0" />
- <button
- type="button"
- className="grid min-w-0 max-w-64 shrink cursor-pointer rounded-md bg-muted px-2 py-1 font-mono text-xs text-foreground outline-none transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"
- aria-label={isBranchCopied ? "Branch name copied" : "Copy pull request branch"}
- title={isBranchCopied ? "Copied" : "Copy pull request branch"}
- onClick={() => copyBranchToClipboard(detail.headBranch)}
- >
- <code
- className={cn(
- "col-start-1 row-start-1 min-w-0 truncate transition-opacity duration-150 motion-reduce:transition-none",
- isBranchCopied ? "opacity-0" : "opacity-100",
- )}
- title={detail.headBranch}
- >
- {detail.headBranch}
- </code>
- <span
- aria-hidden="true"
- className={cn(
- "col-start-1 row-start-1 truncate text-center transition-opacity duration-150 motion-reduce:transition-none",
- isBranchCopied ? "opacity-100" : "opacity-0",
- )}
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <button
+ type="button"
+ className="grid min-w-0 max-w-64 shrink cursor-pointer rounded-md bg-muted px-2 py-1 font-mono text-xs text-foreground outline-none transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background"
+ aria-label={
+ isBranchCopied ? "Branch name copied" : "Copy pull request branch"
+ }
+ onClick={() => copyBranchToClipboard(detail.headBranch)}
+ />
+ }
>
- Copied
- </span>
- </button>
+ <code
+ className={cn(
+ "col-start-1 row-start-1 min-w-0 truncate transition-opacity duration-150 motion-reduce:transition-none",
+ isBranchCopied ? "opacity-0" : "opacity-100",
+ )}
+ >
+ {detail.headBranch}
+ </code>
+ <span
+ aria-hidden="true"
+ className={cn(
+ "col-start-1 row-start-1 truncate text-center transition-opacity duration-150 motion-reduce:transition-none",
+ isBranchCopied ? "opacity-100" : "opacity-0",
+ )}
+ >
+ Copied
+ </span>
+ </TooltipTrigger>
+ <TooltipPopup side="top">
+ {`${isBranchCopied ? "Copied" : "Copy pull request branch"}: ${detail.headBranch}`}
+ </TooltipPopup>
+ </Tooltip>
<span className="ml-auto inline-flex shrink-0 items-center justify-end gap-2">
<span className="inline-flex items-center gap-1.5 tabular-nums">
<FileDiffIcon className="size-3.5" />
diff --git a/apps/web/src/components/pullRequest/PullRequestListFilters.tsx b/apps/web/src/components/pullRequest/PullRequestListFilters.tsx
index 3066eafc3..d0654324d 100644
--- a/apps/web/src/components/pullRequest/PullRequestListFilters.tsx
+++ b/apps/web/src/components/pullRequest/PullRequestListFilters.tsx
@@ -35,6 +35,7 @@ import {
MenuSeparator,
MenuTrigger,
} from "../ui/menu";
+import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
export interface PullRequestFilterOption<Value extends string> {
readonly value: Value;
@@ -156,21 +157,32 @@ function PullRequestFilterRadioGroup<Value extends string>({
}}
>
<MenuGroupLabel>{label}</MenuGroupLabel>
- {options.map((option) => (
- <MenuRadioItem
- key={option.value}
- value={option.value}
- // A host the server has already said it cannot read is not a choice here: offering
- // it would answer the press by replacing a working list with that failure.
- disabled={option.unavailable !== undefined}
- title={option.unavailable}
- >
- <span className="flex min-w-0 items-center gap-2">
- <option.Icon aria-hidden className="size-3.5" />
- {option.label}
- </span>
- </MenuRadioItem>
- ))}
+ {options.map((option) => {
+ // A host the server has already said it cannot read is not a choice here: offering
+ // it would answer the press by replacing a working list with that failure.
+ const item = (
+ <MenuRadioItem
+ key={option.value}
+ value={option.value}
+ className={option.unavailable ? "data-disabled:pointer-events-auto" : undefined}
+ disabled={option.unavailable !== undefined}
+ >
+ <span className="flex min-w-0 items-center gap-2">
+ <option.Icon aria-hidden className="size-3.5" />
+ {option.label}
+ </span>
+ </MenuRadioItem>
+ );
+ if (!option.unavailable) return item;
+ return (
+ <Tooltip key={option.value}>
+ <TooltipTrigger render={item} />
+ <TooltipPopup side="top" className="max-w-80">
+ {option.unavailable}
+ </TooltipPopup>
+ </Tooltip>
+ );
+ })}
</MenuRadioGroup>
);
}
@@ -375,12 +387,12 @@ export function PullRequestFiltersMenu({
)
.map((project) => {
const reason = unavailable.get(pullRequestProjectKey(project));
- return (
+ const item = (
<MenuRadioItem
key={pullRequestProjectKey(project)}
value={pullRequestProjectKey(project)}
+ className={reason !== undefined ? "data-disabled:pointer-events-auto" : undefined}
disabled={reason !== undefined}
- title={reason}
>
<span className="flex min-w-0 flex-1 items-center gap-2">
<ProjectFavicon
@@ -398,6 +410,15 @@ export function PullRequestFiltersMenu({
</span>
</MenuRadioItem>
);
+ if (reason === undefined) return item;
+ return (
+ <Tooltip key={pullRequestProjectKey(project)}>
+ <TooltipTrigger render={item} />
+ <TooltipPopup side="top" className="max-w-80">
+ {reason}
+ </TooltipPopup>
+ </Tooltip>
+ );
})}
</MenuRadioGroup>
</MenuPopup>
diff --git a/apps/web/src/components/pullRequest/PullRequestSummaryTab.tsx b/apps/web/src/components/pullRequest/PullRequestSummaryTab.tsx
index a57f2a4d1..17e95d596 100644
--- a/apps/web/src/components/pullRequest/PullRequestSummaryTab.tsx
+++ b/apps/web/src/components/pullRequest/PullRequestSummaryTab.tsx
@@ -172,9 +172,14 @@ function CollapsedComment({
{open ? (
<div className="px-3 pb-3">
{comment.path ? (
- <p className="truncate text-xs text-muted-foreground" title={comment.path}>
- {comment.path}
- </p>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <p className="truncate text-xs text-muted-foreground">{comment.path}</p>
+ }
+ />
+ <TooltipPopup side="top">{comment.path}</TooltipPopup>
+ </Tooltip>
) : null}
<CommentBody className="mt-2" comment={comment} editing={editing} />
{reactionBar}
@@ -475,6 +480,7 @@ export function PullRequestSummaryTab({
>
<PullRequestActorLabel
actor={actor}
+ tooltip={false}
className="gap-0 [&>img]:ring-2 [&>img]:ring-background [&>span:first-child]:ring-2 [&>span:first-child]:ring-background [&>span:last-child]:sr-only"
/>
</TooltipTrigger>
@@ -754,12 +760,16 @@ export function PullRequestSummaryTab({
) : null}
</div>
{comment.path ? (
- <p
- className="mt-1 truncate text-xs text-muted-foreground"
- title={comment.path}
- >
- {comment.path}
- </p>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <p className="mt-1 truncate text-xs text-muted-foreground">
+ {comment.path}
+ </p>
+ }
+ />
+ <TooltipPopup side="top">{comment.path}</TooltipPopup>
+ </Tooltip>
) : null}
<CommentBody className="mt-2" comment={comment} editing={commentEditing} />
<PullRequestReactionBar
diff --git a/apps/web/src/components/pullRequest/pullRequestPresentation.tsx b/apps/web/src/components/pullRequest/pullRequestPresentation.tsx
index 370400292..7b3d88e8b 100644
--- a/apps/web/src/components/pullRequest/pullRequestPresentation.tsx
+++ b/apps/web/src/components/pullRequest/pullRequestPresentation.tsx
@@ -226,16 +226,31 @@ export function PullRequestActorAvatar({
export function PullRequestActorLabel({
actor,
className,
+ tooltip = true,
}: {
actor: PullRequestActor | null;
className?: string;
+ tooltip?: boolean;
}) {
const login = actor?.login ?? "ghost";
- return (
- <span className={cn("flex min-w-0 items-center gap-1.5", className)} title={login}>
+ const label = (
+ <>
<PullRequestActorAvatar actor={actor} />
<span className="truncate">{login}</span>
- </span>
+ </>
+ );
+ if (!tooltip) {
+ return <span className={cn("flex min-w-0 items-center gap-1.5", className)}>{label}</span>;
+ }
+ return (
+ <Tooltip>
+ <TooltipTrigger
+ render={<span className={cn("flex min-w-0 items-center gap-1.5", className)} />}
+ >
+ {label}
+ </TooltipTrigger>
+ <TooltipPopup side="top">{login}</TooltipPopup>
+ </Tooltip>
);
}
diff --git a/apps/web/src/components/search/ProjectContentSearchDialog.tsx b/apps/web/src/components/search/ProjectContentSearchDialog.tsx
index d877d6537..6be17ed33 100644
--- a/apps/web/src/components/search/ProjectContentSearchDialog.tsx
+++ b/apps/web/src/components/search/ProjectContentSearchDialog.tsx
@@ -12,6 +12,7 @@ import { PierreEntryIcon } from "../chat/PierreEntryIcon";
import { CommandPaletteContent } from "../CommandPaletteContent";
import { ScrollArea } from "../ui/scroll-area";
import { Toggle } from "../ui/toggle";
+import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
import { HighlightedSearchLine } from "./HighlightedSearchLine";
interface ProjectContentSearchDialogProps {
@@ -59,17 +60,23 @@ function SearchOptionButton(props: {
readonly children: ReactNode;
}) {
return (
- <Toggle
- aria-label={props.label}
- pressed={props.active}
- title={props.label}
- className="size-8 rounded-[5px] font-mono text-muted-foreground data-pressed:text-foreground sm:size-7"
- size="compact"
- variant="ghost"
- onClick={props.onClick}
- >
- {props.children}
- </Toggle>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Toggle
+ aria-label={props.label}
+ pressed={props.active}
+ className="size-8 rounded-[5px] font-mono text-muted-foreground data-pressed:text-foreground sm:size-7"
+ size="compact"
+ variant="ghost"
+ onClick={props.onClick}
+ />
+ }
+ >
+ {props.children}
+ </TooltipTrigger>
+ <TooltipPopup side="top">{props.label}</TooltipPopup>
+ </Tooltip>
);
}
diff --git a/apps/web/src/components/settings/ConnectionsSettings.tsx b/apps/web/src/components/settings/ConnectionsSettings.tsx
index 822dab797..18d1b0f1c 100644
--- a/apps/web/src/components/settings/ConnectionsSettings.tsx
+++ b/apps/web/src/components/settings/ConnectionsSettings.tsx
@@ -692,8 +692,13 @@ const PairingLinkListRow = memo(function PairingLinkListRow({
/>
<h3 className="text-sm font-medium text-foreground">{primaryLabel}</h3>
</div>
- <p className="text-xs text-muted-foreground" title={expiresAbsolute}>
- {formatExpiresInLabel(pairingLink.expiresAt, nowMs)}
+ <p className="text-xs text-muted-foreground">
+ <Tooltip>
+ <TooltipTrigger render={<span />}>
+ {formatExpiresInLabel(pairingLink.expiresAt, nowMs)}
+ </TooltipTrigger>
+ <TooltipPopup side="top">{expiresAbsolute}</TooltipPopup>
+ </Tooltip>
<span aria-hidden> · </span>
<AccessScopeSummary scopes={pairingLink.scopes} label="Pairing link scopes" />
</p>
@@ -840,12 +845,18 @@ const PairingLinkListRow = memo(function PairingLinkListRow({
</div>
) : null}
<div className="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/30 px-2.5 py-1.5">
- <code
- title={qrPairingUrl}
- className="min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground"
- >
- {qrPairingUrl}
- </code>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <code className="min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground">
+ {qrPairingUrl}
+ </code>
+ }
+ />
+ <TooltipPopup side="top" className="max-w-80 break-all">
+ {qrPairingUrl}
+ </TooltipPopup>
+ </Tooltip>
<Button
size="xs"
variant="ghost"
@@ -1234,12 +1245,18 @@ const AdvertisedEndpointListRow = memo(function AdvertisedEndpointListRow({
{endpoint.label}
</h3>
{shouldShowEndpointUrl ? (
- <p
- className="min-w-0 truncate text-xs leading-5 text-muted-foreground"
- title={endpoint.httpBaseUrl}
- >
- {endpoint.httpBaseUrl}
- </p>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <p className="min-w-0 truncate text-xs leading-5 text-muted-foreground">
+ {endpoint.httpBaseUrl}
+ </p>
+ }
+ />
+ <TooltipPopup side="top" className="max-w-80">
+ {endpoint.httpBaseUrl}
+ </TooltipPopup>
+ </Tooltip>
) : null}
{!isAvailable ? (
<span className="shrink-0 rounded-md border border-border/70 px-1 py-0.5 text-[10px] text-muted-foreground">
@@ -3313,12 +3330,20 @@ export function ConnectionsSettings() {
) : null}
<div className="rounded-md border border-border/70 bg-muted/20 px-3 py-2">
<p className="text-xs font-medium text-muted-foreground">HTTPS endpoint</p>
- <p
- className="mt-1 truncate text-sm text-foreground"
- title={pendingTailscaleServeBaseUrl ?? undefined}
- >
- {pendingTailscaleServeBaseUrl ?? "Pending MagicDNS endpoint"}
- </p>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <p className="mt-1 truncate text-sm text-foreground">
+ {pendingTailscaleServeBaseUrl ?? "Pending MagicDNS endpoint"}
+ </p>
+ }
+ />
+ {pendingTailscaleServeBaseUrl ? (
+ <TooltipPopup side="top" className="max-w-80">
+ {pendingTailscaleServeBaseUrl}
+ </TooltipPopup>
+ ) : null}
+ </Tooltip>
</div>
</DialogPanel>
<DialogFooter>
diff --git a/apps/web/src/components/settings/ProjectSettingsPanel.tsx b/apps/web/src/components/settings/ProjectSettingsPanel.tsx
index b939e4d53..416df60c1 100644
--- a/apps/web/src/components/settings/ProjectSettingsPanel.tsx
+++ b/apps/web/src/components/settings/ProjectSettingsPanel.tsx
@@ -97,6 +97,7 @@ import {
import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "../ui/select";
import { SidebarInset } from "../ui/sidebar";
import { stackedThreadToast, toastManager } from "../ui/toast";
+import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
import {
WorkspaceBreadcrumb,
WorkspaceBreadcrumbItem,
@@ -937,22 +938,28 @@ function ProjectDetail({ group }: { group: SidebarProjectSnapshot }) {
>
<div className="px-3 py-2 sm:px-4">
<div className="flex min-w-0 items-center rounded-lg bg-muted/30 p-1 text-base text-muted-foreground sm:text-sm">
- <button
- aria-label="Copy checkout path"
- className="group flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-2 py-1 text-left outline-none hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
- title="Copy path"
- type="button"
- onClick={() =>
- copyPathToClipboard(selectedCheckout.workspaceRoot, {
- path: selectedCheckout.workspaceRoot,
- })
- }
- >
- <code className="min-w-0 flex-1 truncate font-mono">
- {selectedCheckout.workspaceRoot}
- </code>
- <CopyIcon className="size-4 shrink-0 opacity-60 group-hover:opacity-100" />
- </button>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <button
+ aria-label="Copy checkout path"
+ className="group flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-2 py-1 text-left outline-none hover:bg-accent/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
+ type="button"
+ onClick={() =>
+ copyPathToClipboard(selectedCheckout.workspaceRoot, {
+ path: selectedCheckout.workspaceRoot,
+ })
+ }
+ >
+ <code className="min-w-0 flex-1 truncate font-mono">
+ {selectedCheckout.workspaceRoot}
+ </code>
+ <CopyIcon className="size-4 shrink-0 opacity-60 group-hover:opacity-100" />
+ </button>
+ }
+ />
+ <TooltipPopup side="top">Copy path</TooltipPopup>
+ </Tooltip>
<div className="shrink-0 border-l border-border/60 px-2 tabular-nums">
{selectedCheckoutThreadCount === 1
? "1 thread"
diff --git a/apps/web/src/components/settings/ThemeColorPicker.tsx b/apps/web/src/components/settings/ThemeColorPicker.tsx
index e83501936..bed7759c9 100644
--- a/apps/web/src/components/settings/ThemeColorPicker.tsx
+++ b/apps/web/src/components/settings/ThemeColorPicker.tsx
@@ -4,6 +4,7 @@ import { isThemeColor, themeColorToHex, type ThemeColorRole } from "../../themeP
import { cn } from "../../lib/utils";
import { Input } from "../ui/input";
import { Popover, PopoverPopup, PopoverTrigger } from "../ui/popover";
+import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
export function getThemeRoleLabel(role: ThemeColorRole): string {
const labels: Partial<Record<ThemeColorRole, string>> = {
canvas: "Background",
@@ -434,23 +435,29 @@ function ThemeColorPicker({
}) {
return (
<Popover>
- <PopoverTrigger
- render={
- <button
- aria-label={`Choose ${label} color`}
- className="relative flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border border-foreground/30 transition-transform hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
- onFocus={onInteract}
- onPointerDown={onInteract}
- title={`Choose ${label} color`}
- type="button"
- >
- <span
- className="absolute inset-0 rounded-full shadow-sm"
- style={{ backgroundColor: value }}
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <PopoverTrigger
+ render={
+ <button
+ aria-label={`Choose ${label} color`}
+ className="relative flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-full border border-foreground/30 transition-transform hover:scale-105 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
+ onFocus={onInteract}
+ onPointerDown={onInteract}
+ type="button"
+ >
+ <span
+ className="absolute inset-0 rounded-full shadow-sm"
+ style={{ backgroundColor: value }}
+ />
+ </button>
+ }
/>
- </button>
- }
- />
+ }
+ />
+ <TooltipPopup side="top">{`Choose ${label} color`}</TooltipPopup>
+ </Tooltip>
<PopoverPopup
align="end"
className="overflow-hidden rounded-2xl border border-border/70 p-0 shadow-2xl [--viewport-inline-padding:0px] [&_[data-slot=popover-viewport]]:p-0"
@@ -496,16 +503,22 @@ export const ThemeColorField = memo(function ThemeColorField({
)}
data-theme-color-role={role}
>
- <button
- aria-label={`${selected ? "Hide" : "Show"} ${label} usage`}
- aria-pressed={selected}
- className="flex min-w-0 flex-1 cursor-pointer items-center rounded-md text-left text-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
- onClick={() => onToggleSelected?.(role)}
- title={`${selected ? "Hide" : "Show"} where ${label} is used`}
- type="button"
- >
- <span className="min-w-0 flex-1 truncate">{label}</span>
- </button>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <button
+ aria-label={`${selected ? "Hide" : "Show"} ${label} usage`}
+ aria-pressed={selected}
+ className="flex min-w-0 flex-1 cursor-pointer items-center rounded-md text-left text-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
+ onClick={() => onToggleSelected?.(role)}
+ type="button"
+ >
+ <span className="min-w-0 flex-1 truncate">{label}</span>
+ </button>
+ }
+ />
+ <TooltipPopup side="top">{`${selected ? "Hide" : "Show"} where ${label} is used`}</TooltipPopup>
+ </Tooltip>
<div className="ml-auto flex shrink-0 items-center gap-2">
<ThemeColorPicker
label={label}
diff --git a/apps/web/src/routes/_chat.pull-requests.tsx b/apps/web/src/routes/_chat.pull-requests.tsx
index 66d9f0caa..af1b970f3 100644
--- a/apps/web/src/routes/_chat.pull-requests.tsx
+++ b/apps/web/src/routes/_chat.pull-requests.tsx
@@ -78,6 +78,7 @@ import { PanelLayoutControls } from "../components/chat/PanelLayoutControls";
import { Button } from "../components/ui/button";
import { Menu, MenuPopup, MenuRadioGroup, MenuRadioItem, MenuTrigger } from "../components/ui/menu";
import { SidebarInset } from "../components/ui/sidebar";
+import { Tooltip, TooltipPopup, TooltipTrigger } from "../components/ui/tooltip";
import { useLiveRefresh } from "../hooks/useLiveRefresh";
import {
selectActiveRightPanelSurface,
@@ -1639,22 +1640,33 @@ function CompactFilterMenu<Value extends string>({
</MenuTrigger>
<MenuPopup align="start" side="bottom" className="min-w-40">
<MenuRadioGroup value={value} onValueChange={(next) => onChange(next as Value)}>
- {options.map((option) => (
- <MenuRadioItem
- key={option.value}
- value={option.value}
- // A host the server has already said it cannot read is not a choice here either.
- // The pills disable it; a menu that offers it would answer the press by replacing
- // a working list with the same failure the pill row exists to explain.
- disabled={option.unavailable !== undefined}
- title={option.unavailable}
- >
- <span className="flex min-w-0 items-center gap-2">
- <option.Icon aria-hidden className="size-3.5" />
- {option.label}
- </span>
- </MenuRadioItem>
- ))}
+ {options.map((option) => {
+ // A host the server has already said it cannot read is not a choice here either.
+ // The pills disable it; a menu that offers it would answer the press by replacing
+ // a working list with the same failure the pill row exists to explain.
+ const item = (
+ <MenuRadioItem
+ key={option.value}
+ value={option.value}
+ className={option.unavailable ? "data-disabled:pointer-events-auto" : undefined}
+ disabled={option.unavailable !== undefined}
+ >
+ <span className="flex min-w-0 items-center gap-2">
+ <option.Icon aria-hidden className="size-3.5" />
+ {option.label}
+ </span>
+ </MenuRadioItem>
+ );
+ if (!option.unavailable) return item;
+ return (
+ <Tooltip key={option.value}>
+ <TooltipTrigger render={item} />
+ <TooltipPopup side="top" className="max-w-80">
+ {option.unavailable}
+ </TooltipPopup>
+ </Tooltip>
+ );
+ })}
</MenuRadioGroup>
</MenuPopup>
</Menu>
diff --git a/oxlint-plugin-t3code/index.ts b/oxlint-plugin-t3code/index.ts
index 400785be0..6556bfe10 100644
--- a/oxlint-plugin-t3code/index.ts
+++ b/oxlint-plugin-t3code/index.ts
@@ -4,6 +4,7 @@ import namespaceNodeImports from "./rules/namespace-node-imports.ts";
import noGlobalProcessRuntime from "./rules/no-global-process-runtime.ts";
import noInlineSchemaCompile from "./rules/no-inline-schema-compile.ts";
import noManualEffectRuntimeInTests from "./rules/no-manual-effect-runtime-in-tests.ts";
+import noNativeTitleTooltip from "./rules/no-native-title-tooltip.ts";
export default definePlugin({
meta: {
@@ -14,5 +15,6 @@ export default definePlugin({
"no-global-process-runtime": noGlobalProcessRuntime,
"no-inline-schema-compile": noInlineSchemaCompile,
"no-manual-effect-runtime-in-tests": noManualEffectRuntimeInTests,
+ "no-native-title-tooltip": noNativeTitleTooltip,
},
});
diff --git a/oxlint-plugin-t3code/rules/no-native-title-tooltip.test.ts b/oxlint-plugin-t3code/rules/no-native-title-tooltip.test.ts
new file mode 100644
index 000000000..dd12304f5
--- /dev/null
+++ b/oxlint-plugin-t3code/rules/no-native-title-tooltip.test.ts
@@ -0,0 +1,61 @@
+import { assert, describe } from "@effect/vitest";
+
+import { createOxlintRuleHarness } from "../test/utils.ts";
+
+const rule = createOxlintRuleHarness("t3code/no-native-title-tooltip", {
+ filename: "fixture.tsx",
+});
+
+describe("t3code/no-native-title-tooltip", () => {
+ rule.valid(
+ "allows intrinsic elements without a title attribute",
+ `const el = <span className="truncate">Truncated text</span>;`,
+ );
+
+ rule.valid(
+ "allows title props on custom components",
+ `const el = <SettingsRow id="word-wrap" title="Word wrap" description="Wrap long lines." />;`,
+ );
+
+ rule.valid(
+ "allows title on member expression components",
+ `const el = <Foo.Bar title="Not a native tooltip" />;`,
+ );
+
+ rule.valid(
+ "allows title as an accessible name on embedded content",
+ `const el = <iframe title="Embedded widget" src="https://example.com" />;`,
+ );
+
+ rule.valid("allows the svg title child element", `const el = <svg><title>QR code</title></svg>;`);
+
+ rule.valid("allows document.title assignments", `document.title = "Thread · T3 Code";`);
+
+ rule.invalid(
+ "reports title on a truncating span",
+ `const el = <span className="min-w-0 truncate" title="Full repository name">Repo</span>;`,
+ (output) => {
+ assert.match(output, /native title attribute/);
+ },
+ );
+
+ rule.invalid(
+ "reports title on a button",
+ `const el = <button type="button" aria-label="Scroll to end" title="Scroll to end" />;`,
+ (output) => {
+ assert.match(output, /Tooltip \+ TooltipTrigger \+ TooltipPopup/);
+ },
+ );
+
+ rule.invalid(
+ "reports title on a paragraph",
+ `const el = <p className="truncate text-xs" title={path}>src/main.ts</p>;`,
+ );
+
+ rule.invalid(
+ "reports title on a code element",
+ `const el = <code className="truncate" title={pairingUrl}>abc</code>;`,
+ );
+
+ rule.invalid("reports title on an anchor", `const el = <a href="#" title="Learn more">More</a>;`);
+});
diff --git a/oxlint-plugin-t3code/rules/no-native-title-tooltip.ts b/oxlint-plugin-t3code/rules/no-native-title-tooltip.ts
new file mode 100644
index 000000000..9d83a4f45
--- /dev/null
+++ b/oxlint-plugin-t3code/rules/no-native-title-tooltip.ts
@@ -0,0 +1,39 @@
+import { defineRule } from "@oxlint/plugins";
+
+const INTRINSIC_ELEMENT_PATTERN = /^[a-z]/u;
+
+// On these elements the title attribute names the embedded content for
+// accessibility (and does not reliably produce a hover tooltip), so the styled
+// Tooltip component is not a drop-in replacement.
+const TITLE_IS_AN_ACCESSIBLE_NAME = new Set(["embed", "frame", "iframe", "math", "object"]);
+
+export default defineRule({
+ meta: {
+ type: "problem",
+ docs: {
+ description:
+ "Disallow the native title attribute as a tooltip on intrinsic elements; use the styled Tooltip component.",
+ },
+ },
+ create(context) {
+ return {
+ JSXOpeningElement(node) {
+ if (node.name.type !== "JSXIdentifier") return;
+ if (!INTRINSIC_ELEMENT_PATTERN.test(node.name.name)) return;
+ if (TITLE_IS_AN_ACCESSIBLE_NAME.has(node.name.name)) return;
+
+ for (const attribute of node.attributes) {
+ if (attribute.type !== "JSXAttribute") continue;
+ if (attribute.name.type !== "JSXIdentifier") continue;
+ if (attribute.name.name !== "title") continue;
+
+ context.report({
+ node: attribute,
+ message:
+ "Do not use the native title attribute as a tooltip. Use Tooltip + TooltipTrigger + TooltipPopup from components/ui/tooltip.",
+ });
+ }
+ },
+ };
+ },
+});
diff --git a/vite.config.ts b/vite.config.ts
index 585428028..2175be8c8 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -121,6 +121,7 @@ export default defineConfig({
"t3code/no-global-process-runtime": "error",
"t3code/no-inline-schema-compile": "warn",
"t3code/no-manual-effect-runtime-in-tests": "error",
+ "t3code/no-native-title-tooltip": "error",
"t3code/namespace-node-imports": "error",
},
options: {