Skip to content
TypeScript

refactor(web): one wrap width for tooltips, plus a code variant (#13031)

Julius Marmingeaa2b25d29b4b
diff --git a/apps/web/src/components/BranchToolbarBranchSelector.tsx b/apps/web/src/components/BranchToolbarBranchSelector.tsx
index ed8f1cd1f02..3bab1315ee8 100644
--- a/apps/web/src/components/BranchToolbarBranchSelector.tsx
+++ b/apps/web/src/components/BranchToolbarBranchSelector.tsx
@@ -918,7 +918,7 @@ export function BranchToolbarBranchSelector({
</label>
}
/>
- <TooltipPopup side="top" className="max-w-72 whitespace-normal leading-tight">
+ <TooltipPopup side="top">
Creates the worktree from the latest matching branch on origin instead of your local
branch.
</TooltipPopup>
diff --git a/apps/web/src/components/ChatMarkdown.tsx b/apps/web/src/components/ChatMarkdown.tsx
index 90fca535680..fe7859968be 100644
--- a/apps/web/src/components/ChatMarkdown.tsx
+++ b/apps/web/src/components/ChatMarkdown.tsx
@@ -2209,10 +2209,7 @@ const MarkdownFileLink = memo(function MarkdownFileLink({
)
}
/>
- <TooltipPopup
- side="top"
- className="max-w-[min(40rem,calc(100vw-2rem))] font-mono text-[11px] leading-tight"
- >
+ <TooltipPopup side="top" variant="code">
{/* The full path: the chip already shows the shortened form, and a link
to the workspace root collapses to a bare label that repeats it. */}
<div className="overflow-x-auto whitespace-nowrap [scrollbar-color:color-mix(in_srgb,var(--contrast-border)_78%,transparent)_transparent] [scrollbar-width:thin] [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-[color-mix(in_srgb,var(--contrast-border)_78%,transparent)] [&::-webkit-scrollbar-track]:bg-transparent">
@@ -3062,12 +3059,7 @@ const CHAT_MARKDOWN_COMPONENTS = {
return (
<Tooltip>
<TooltipTrigger render={link} />
- <TooltipPopup
- side="top"
- className="max-w-[min(36rem,calc(100vw-2rem))] whitespace-normal leading-tight wrap-anywhere"
- >
- {href}
- </TooltipPopup>
+ <TooltipPopup side="top">{href}</TooltipPopup>
</Tooltip>
);
}
diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx
index 0d0810eefa4..b97411e7a44 100644
--- a/apps/web/src/components/ChatView.tsx
+++ b/apps/web/src/components/ChatView.tsx
@@ -6533,7 +6533,7 @@ export default function ChatView(props: ChatViewProps) {
</code>
}
/>
- <TooltipPopup side="top" className="max-w-80">
+ <TooltipPopup side="top">
This thread last ran on {localCheckoutBranchMismatch.threadBranch}. Sending will
continue on {localCheckoutBranchMismatch.currentBranch}.
</TooltipPopup>
diff --git a/apps/web/src/components/ComposerPromptEditorTiptap.tsx b/apps/web/src/components/ComposerPromptEditorTiptap.tsx
index 0e452fd4ac2..ec9b9e07e2f 100644
--- a/apps/web/src/components/ComposerPromptEditorTiptap.tsx
+++ b/apps/web/src/components/ComposerPromptEditorTiptap.tsx
@@ -237,12 +237,7 @@ function ComposerMentionNodeView({ node }: NodeViewProps) {
<NodeViewWrapper as="span" className={COMPOSER_INLINE_CHIP_DECORATOR_CLASS_NAME}>
<Tooltip>
<TooltipTrigger render={chip} />
- <TooltipPopup
- side="top"
- className="max-w-120 whitespace-normal leading-tight wrap-anywhere"
- >
- {path}
- </TooltipPopup>
+ <TooltipPopup side="top">{path}</TooltipPopup>
</Tooltip>
</NodeViewWrapper>
);
diff --git a/apps/web/src/components/ConfirmDialogHost.tsx b/apps/web/src/components/ConfirmDialogHost.tsx
index 3e19606bd4c..92477801eb7 100644
--- a/apps/web/src/components/ConfirmDialogHost.tsx
+++ b/apps/web/src/components/ConfirmDialogHost.tsx
@@ -77,7 +77,7 @@ export function ConfirmDialogHost() {
>
<AlertDialogPopup>
<AlertDialogHeader>
- <AlertDialogTitle className="wrap-anywhere">{copy.title}</AlertDialogTitle>
+ <AlertDialogTitle>{copy.title}</AlertDialogTitle>
{copy.description ? (
<AlertDialogDescription className="whitespace-pre-line">
{copy.description}
diff --git a/apps/web/src/components/ConnectionStatusDot.tsx b/apps/web/src/components/ConnectionStatusDot.tsx
index 6a23a053287..b371b6c1fe9 100644
--- a/apps/web/src/components/ConnectionStatusDot.tsx
+++ b/apps/web/src/components/ConnectionStatusDot.tsx
@@ -69,7 +69,7 @@ export function ConnectionStatusDot({
return (
<Tooltip>
<TooltipTrigger render={dot} />
- <TooltipPopup side="top" className="max-w-80 whitespace-pre-wrap leading-tight">
+ <TooltipPopup side="top" className="whitespace-pre-wrap">
{tooltipText}
</TooltipPopup>
</Tooltip>
diff --git a/apps/web/src/components/GitActionsControl.tsx b/apps/web/src/components/GitActionsControl.tsx
index 4eca7867132..c849532dafd 100644
--- a/apps/web/src/components/GitActionsControl.tsx
+++ b/apps/web/src/components/GitActionsControl.tsx
@@ -659,7 +659,7 @@ function PublishRepositoryDialog(props: PublishRepositoryDialogProps) {
</Button>
}
/>
- <TooltipPopup side="top" align="end" className="max-w-72">
+ <TooltipPopup side="top" align="end">
{readiness.hint ??
"Open Settings -> Source Control to configure this provider."}
</TooltipPopup>
diff --git a/apps/web/src/components/LegacySidebar.tsx b/apps/web/src/components/LegacySidebar.tsx
index b4b686a0c11..b98f3a30ed2 100644
--- a/apps/web/src/components/LegacySidebar.tsx
+++ b/apps/web/src/components/LegacySidebar.tsx
@@ -785,9 +785,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
</span>
}
/>
- <TooltipPopup side="top" className="max-w-80 whitespace-normal leading-tight">
- {thread.title}
- </TooltipPopup>
+ <TooltipPopup side="top">{thread.title}</TooltipPopup>
</Tooltip>
)}
</div>
diff --git a/apps/web/src/components/ServerUpdateAction.tsx b/apps/web/src/components/ServerUpdateAction.tsx
index 288078729d5..a4b288a6eab 100644
--- a/apps/web/src/components/ServerUpdateAction.tsx
+++ b/apps/web/src/components/ServerUpdateAction.tsx
@@ -163,9 +163,7 @@ export function ServerUpdateProgress({
<span className="size-1.5 shrink-0 rounded-full bg-destructive" aria-hidden="true" />
<Tooltip>
<TooltipTrigger render={<span className="min-w-0 truncate">{state.message}</span>} />
- <TooltipPopup side="top" className="max-w-80">
- {state.message}
- </TooltipPopup>
+ <TooltipPopup side="top">{state.message}</TooltipPopup>
</Tooltip>
</div>
);
diff --git a/apps/web/src/components/Sidebar.tsx b/apps/web/src/components/Sidebar.tsx
index 022024eadcc..799ab3f9e54 100644
--- a/apps/web/src/components/Sidebar.tsx
+++ b/apps/web/src/components/Sidebar.tsx
@@ -350,7 +350,7 @@ function SidebarThreadTooltip({
align="start"
sideOffset={4}
variant="glass"
- className="max-w-80 text-left whitespace-normal [&_[data-slot=tooltip-viewport]]:p-0"
+ className="[&_[data-slot=tooltip-viewport]]:p-0"
>
<div className="flex min-w-0 max-w-80 flex-col gap-2 p-[var(--floating-content-inset)]">
<div className="min-w-0 truncate text-xs leading-tight font-medium text-foreground">
diff --git a/apps/web/src/components/StartTruncatedPath.tsx b/apps/web/src/components/StartTruncatedPath.tsx
index b467d141a8c..60cb6cdc740 100644
--- a/apps/web/src/components/StartTruncatedPath.tsx
+++ b/apps/web/src/components/StartTruncatedPath.tsx
@@ -17,7 +17,7 @@ export function StartTruncatedPath({ path, className }: { path: string; classNam
>
<bdi>{path}</bdi>
</TooltipTrigger>
- <TooltipPopup side="top" className="max-w-sm break-all font-mono">
+ <TooltipPopup side="top" variant="code">
{path}
</TooltipPopup>
</Tooltip>
diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsx
index f1de1f81434..101dbcb4af2 100644
--- a/apps/web/src/components/chat/ChatComposer.tsx
+++ b/apps/web/src/components/chat/ChatComposer.tsx
@@ -6569,10 +6569,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
</span>
}
/>
- <TooltipPopup
- side="top"
- className="max-w-64 whitespace-normal leading-tight"
- >
+ <TooltipPopup side="top">
Draft attachment could not be saved locally and may be lost on
navigation.
</TooltipPopup>
@@ -6604,12 +6601,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
>
<RefreshIcon />
</TooltipTrigger>
- <TooltipPopup
- side="top"
- className="max-w-64 whitespace-normal leading-tight"
- >
- {upload.reason}
- </TooltipPopup>
+ <TooltipPopup side="top">{upload.reason}</TooltipPopup>
</Tooltip>
)}
<Button
@@ -6704,12 +6696,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
>
<RefreshIcon />
</TooltipTrigger>
- <TooltipPopup
- side="top"
- className="max-w-64 whitespace-normal leading-tight"
- >
- {upload.reason}
- </TooltipPopup>
+ <TooltipPopup side="top">{upload.reason}</TooltipPopup>
</Tooltip>
)}
<Button
@@ -6787,12 +6774,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
>
<RefreshIcon />
</TooltipTrigger>
- <TooltipPopup
- side="top"
- className="max-w-64 whitespace-normal leading-tight"
- >
- {upload.reason}
- </TooltipPopup>
+ <TooltipPopup side="top">{upload.reason}</TooltipPopup>
</Tooltip>
) : null}
<Button
diff --git a/apps/web/src/components/chat/ComposerPendingApprovalActions.tsx b/apps/web/src/components/chat/ComposerPendingApprovalActions.tsx
index 743d846dc5e..cebdf7d1cd5 100644
--- a/apps/web/src/components/chat/ComposerPendingApprovalActions.tsx
+++ b/apps/web/src/components/chat/ComposerPendingApprovalActions.tsx
@@ -59,9 +59,7 @@ export const ComposerPendingApprovalActions = memo(function ComposerPendingAppro
return option.warning ? (
<Tooltip key={option.decision}>
<TooltipTrigger render={button} />
- <TooltipPopup side="top" className="max-w-72 text-xs leading-snug">
- {option.warning}
- </TooltipPopup>
+ <TooltipPopup side="top">{option.warning}</TooltipPopup>
</Tooltip>
) : (
button
@@ -98,9 +96,7 @@ export const ComposerPendingApprovalActions = memo(function ComposerPendingAppro
return option.warning ? (
<Tooltip key={option.decision}>
<TooltipTrigger render={item} />
- <TooltipPopup side="top" className="max-w-64 text-xs leading-snug">
- {option.warning}
- </TooltipPopup>
+ <TooltipPopup side="top">{option.warning}</TooltipPopup>
</Tooltip>
) : (
item
diff --git a/apps/web/src/components/chat/ComposerServerUpdateStatus.tsx b/apps/web/src/components/chat/ComposerServerUpdateStatus.tsx
index 7431932ce9a..f871a5aab19 100644
--- a/apps/web/src/components/chat/ComposerServerUpdateStatus.tsx
+++ b/apps/web/src/components/chat/ComposerServerUpdateStatus.tsx
@@ -56,7 +56,7 @@ export function ComposerServerUpdateStatus({
</button>
}
/>
- <TooltipPopup side="top" className="max-w-80">
+ <TooltipPopup side="top">
{title}: {detail}
</TooltipPopup>
</Tooltip>
diff --git a/apps/web/src/components/chat/DraftHeroHeadline.tsx b/apps/web/src/components/chat/DraftHeroHeadline.tsx
index d542cd6a8a9..89f5c103d0a 100644
--- a/apps/web/src/components/chat/DraftHeroHeadline.tsx
+++ b/apps/web/src/components/chat/DraftHeroHeadline.tsx
@@ -146,9 +146,7 @@ export function DraftHeroHeadline({
{activeProjectDisplayName ?? "Choose a project"}
</TooltipTrigger>
{activeProjectDisplayName ? (
- <TooltipPopup side="top" className="max-w-80">
- {activeProjectDisplayName}
- </TooltipPopup>
+ <TooltipPopup side="top">{activeProjectDisplayName}</TooltipPopup>
) : null}
</Tooltip>
<MenuPopup align="center" className="max-h-80 min-w-40! w-max max-w-64 overflow-y-auto">
@@ -202,9 +200,7 @@ export function DraftHeroHeadline({
<TooltipTrigger render={<span className="block min-w-0 truncate" />}>
{group.displayName}
</TooltipTrigger>
- <TooltipPopup side="top" className="max-w-80">
- {group.displayName}
- </TooltipPopup>
+ <TooltipPopup side="top">{group.displayName}</TooltipPopup>
</Tooltip>
{showProjectEnvironments ? (
<ProjectEnvironmentBadge
diff --git a/apps/web/src/components/chat/ModelListRow.tsx b/apps/web/src/components/chat/ModelListRow.tsx
index 5917b4e2ca2..1d05374035b 100644
--- a/apps/web/src/components/chat/ModelListRow.tsx
+++ b/apps/web/src/components/chat/ModelListRow.tsx
@@ -145,7 +145,7 @@ export const ModelListRow = memo(function ModelListRow(props: {
return (
<Tooltip>
<TooltipTrigger render={row} />
- <TooltipPopup side="left" align="center" className="max-w-64 text-balance leading-snug">
+ <TooltipPopup side="left" align="center">
{props.disabledReason}
</TooltipPopup>
</Tooltip>
diff --git a/apps/web/src/components/chat/ModelPickerSidebar.tsx b/apps/web/src/components/chat/ModelPickerSidebar.tsx
index 19a542d2aa2..93d2b272677 100644
--- a/apps/web/src/components/chat/ModelPickerSidebar.tsx
+++ b/apps/web/src/components/chat/ModelPickerSidebar.tsx
@@ -39,7 +39,6 @@ const NEW_BADGE_CLASS = `${BADGE_BASE_CLASS} text-update-foreground `;
/** Opens toward the rail so the list stays readable (not over the model names). */
const PICKER_TOOLTIP_SIDE = "left" as const;
const PICKER_TOOLTIP_SIDE_OFFSET = 8;
-const PICKER_TOOLTIP_CLASS = "max-w-64 text-balance font-normal leading-snug";
export const ModelPickerSidebar = memo(function ModelPickerSidebar(props: {
selectedInstanceId: ProviderInstanceId | "favorites";
@@ -139,7 +138,6 @@ export const ModelPickerSidebar = memo(function ModelPickerSidebar(props: {
side={PICKER_TOOLTIP_SIDE}
sideOffset={PICKER_TOOLTIP_SIDE_OFFSET}
align="center"
- className={PICKER_TOOLTIP_CLASS}
>
Favorites
</TooltipPopup>
@@ -242,7 +240,6 @@ export const ModelPickerSidebar = memo(function ModelPickerSidebar(props: {
side={PICKER_TOOLTIP_SIDE}
sideOffset={PICKER_TOOLTIP_SIDE_OFFSET}
align="center"
- className={PICKER_TOOLTIP_CLASS}
>
{tooltip}
</TooltipPopup>
diff --git a/apps/web/src/components/chat/ProviderStatusBanner.tsx b/apps/web/src/components/chat/ProviderStatusBanner.tsx
index 210bff4d7ad..9e84fc01c92 100644
--- a/apps/web/src/components/chat/ProviderStatusBanner.tsx
+++ b/apps/web/src/components/chat/ProviderStatusBanner.tsx
@@ -100,7 +100,7 @@ export const ProviderStatusBanner = memo(function ProviderStatusBanner({
<TooltipTrigger
render={<div className="line-clamp-3 text-muted-foreground">{message}</div>}
/>
- <TooltipPopup side="top" className="max-w-96 whitespace-pre-wrap">
+ <TooltipPopup side="top" className="whitespace-pre-wrap">
{message}
</TooltipPopup>
</Tooltip>
diff --git a/apps/web/src/components/chat/ThreadErrorBanner.tsx b/apps/web/src/components/chat/ThreadErrorBanner.tsx
index 29a6a6db184..df01506ba9e 100644
--- a/apps/web/src/components/chat/ThreadErrorBanner.tsx
+++ b/apps/web/src/components/chat/ThreadErrorBanner.tsx
@@ -53,7 +53,7 @@ export const ThreadErrorBanner = memo(function ThreadErrorBanner({
<AlertDescription>
<Tooltip>
<TooltipTrigger render={<div className="line-clamp-3" />}>{error}</TooltipTrigger>
- <TooltipPopup side="top" className="max-w-96 whitespace-pre-wrap">
+ <TooltipPopup side="top" className="whitespace-pre-wrap">
{error}
</TooltipPopup>
</Tooltip>
diff --git a/apps/web/src/components/cloud/CloudEnvironmentConnectList.tsx b/apps/web/src/components/cloud/CloudEnvironmentConnectList.tsx
index de054d0a5d2..5022031e98e 100644
--- a/apps/web/src/components/cloud/CloudEnvironmentConnectList.tsx
+++ b/apps/web/src/components/cloud/CloudEnvironmentConnectList.tsx
@@ -393,9 +393,7 @@ export function CloudEnvironmentConnectRows({
? "Unavailable"
: "Checking…"))}
</TooltipTrigger>
- <TooltipPopup className="max-w-80 break-words">
- {unsupportedDetail ?? statusText}
- </TooltipPopup>
+ <TooltipPopup>{unsupportedDetail ?? statusText}</TooltipPopup>
</Tooltip>
</label>
);
@@ -454,9 +452,7 @@ export function CloudEnvironmentConnectRows({
Add
</Button>
</TooltipTrigger>
- <TooltipPopup className="max-w-80 break-words">
- {unsupportedDetail ?? "Client not supported"}
- </TooltipPopup>
+ <TooltipPopup>{unsupportedDetail ?? "Client not supported"}</TooltipPopup>
</Tooltip>
) : savedConnection ? (
<Button size="sm" variant="outline" disabled>
diff --git a/apps/web/src/components/composerContextPresentation.tsx b/apps/web/src/components/composerContextPresentation.tsx
index 9e5c775161c..9c86b47581f 100644
--- a/apps/web/src/components/composerContextPresentation.tsx
+++ b/apps/web/src/components/composerContextPresentation.tsx
@@ -199,7 +199,7 @@ function ImageContextChip(props: {
/>
}
/>
- <TooltipPopup side="top" className="max-w-80 whitespace-pre-wrap leading-tight">
+ <TooltipPopup side="top" className="whitespace-pre-wrap">
{attachmentTooltip(props.record, props.upload)}
</TooltipPopup>
</Tooltip>
diff --git a/apps/web/src/components/contextChipParts.tsx b/apps/web/src/components/contextChipParts.tsx
index f0a47b22e3c..691fd2ec33c 100644
--- a/apps/web/src/components/contextChipParts.tsx
+++ b/apps/web/src/components/contextChipParts.tsx
@@ -301,7 +301,7 @@ export function FileChip(props: {
)
}
/>
- <TooltipPopup side="top" className="max-w-80 whitespace-pre-wrap leading-tight">
+ <TooltipPopup side="top" className="whitespace-pre-wrap">
{props.tooltip}
</TooltipPopup>
</Tooltip>
diff --git a/apps/web/src/components/files/FileBreadcrumbs.tsx b/apps/web/src/components/files/FileBreadcrumbs.tsx
index aa7bc97be0f..01bec38f343 100644
--- a/apps/web/src/components/files/FileBreadcrumbs.tsx
+++ b/apps/web/src/components/files/FileBreadcrumbs.tsx
@@ -61,9 +61,7 @@ function BreadcrumbLabel(props: {
>
{props.label}
</TooltipTrigger>
- <TooltipPopup side="top" className="max-w-80">
- {props.pathLabel}
- </TooltipPopup>
+ <TooltipPopup side="top">{props.pathLabel}</TooltipPopup>
</Tooltip>
);
}
@@ -241,9 +239,7 @@ function DirectoryBreadcrumb(props: FileBreadcrumbsProps & { readonly crumb: Fil
>
<span className="block truncate">{props.crumb.label}</span>
</TooltipTrigger>
- <TooltipPopup side="top" className="max-w-80">
- {props.crumb.path || props.projectName}
- </TooltipPopup>
+ <TooltipPopup side="top">{props.crumb.path || props.projectName}</TooltipPopup>
</Tooltip>
{open ? (
<BreadcrumbMenuContent
diff --git a/apps/web/src/components/media/MediaActions.tsx b/apps/web/src/components/media/MediaActions.tsx
index d6c5cca7015..d4e96c5445b 100644
--- a/apps/web/src/components/media/MediaActions.tsx
+++ b/apps/web/src/components/media/MediaActions.tsx
@@ -186,9 +186,7 @@ export function MediaActions({
void showMenu({ x: bounds.left, y: bounds.bottom });
}}
/>
- <TooltipPopup className="max-w-[min(40rem,calc(100vw-2rem))] break-all font-mono text-[11px] leading-tight">
- {tooltip}
- </TooltipPopup>
+ <TooltipPopup variant="code">{tooltip}</TooltipPopup>
</Tooltip>
);
}
diff --git a/apps/web/src/components/onboarding/WelcomeWizard.tsx b/apps/web/src/components/onboarding/WelcomeWizard.tsx
index 99e0e8513e8..1d4b9662a26 100644
--- a/apps/web/src/components/onboarding/WelcomeWizard.tsx
+++ b/apps/web/src/components/onboarding/WelcomeWizard.tsx
@@ -1453,7 +1453,7 @@ function ImportCandidateRow({
</span>
) : null}
</TooltipTrigger>
- <TooltipPopup className="max-w-96 break-all font-mono">{candidate.path}</TooltipPopup>
+ <TooltipPopup variant="code">{candidate.path}</TooltipPopup>
</Tooltip>
<ImportRowMeta
sources={nested ? null : candidate.sources}
diff --git a/apps/web/src/components/pullRequest/PullRequestCopyableCode.tsx b/apps/web/src/components/pullRequest/PullRequestCopyableCode.tsx
index 4c9d14b5373..bcfb3b18011 100644
--- a/apps/web/src/components/pullRequest/PullRequestCopyableCode.tsx
+++ b/apps/web/src/components/pullRequest/PullRequestCopyableCode.tsx
@@ -58,7 +58,7 @@ export function PullRequestCopyableCode({
Copied
</span>
</TooltipTrigger>
- <TooltipPopup className="max-w-96 wrap-anywhere font-mono" side={tooltipSide}>
+ <TooltipPopup variant="code" side={tooltipSide}>
{`${isCopied ? "Copied" : copyLabel}: ${value}`}
</TooltipPopup>
</Tooltip>
diff --git a/apps/web/src/components/pullRequest/PullRequestListFilters.tsx b/apps/web/src/components/pullRequest/PullRequestListFilters.tsx
index 702584237e7..f769dd70fa4 100644
--- a/apps/web/src/components/pullRequest/PullRequestListFilters.tsx
+++ b/apps/web/src/components/pullRequest/PullRequestListFilters.tsx
@@ -202,9 +202,7 @@ function PullRequestFilterRadioGroup<Value extends string>({
return (
<Tooltip key={option.value}>
<TooltipTrigger render={item} />
- <TooltipPopup side="top" className="max-w-80">
- {option.unavailable}
- </TooltipPopup>
+ <TooltipPopup side="top">{option.unavailable}</TooltipPopup>
</Tooltip>
);
})}
diff --git a/apps/web/src/components/settings/ConnectionsSettings.tsx b/apps/web/src/components/settings/ConnectionsSettings.tsx
index 1d0b3e0b71f..0e2213039cc 100644
--- a/apps/web/src/components/settings/ConnectionsSettings.tsx
+++ b/apps/web/src/components/settings/ConnectionsSettings.tsx
@@ -925,9 +925,7 @@ const PairingLinkListRow = memo(function PairingLinkListRow({
</code>
}
/>
- <TooltipPopup side="top" className="max-w-80 break-all">
- {qrPairingUrl}
- </TooltipPopup>
+ <TooltipPopup side="top">{qrPairingUrl}</TooltipPopup>
</Tooltip>
<Button
size="xs"
@@ -1334,9 +1332,7 @@ const AdvertisedEndpointListRow = memo(function AdvertisedEndpointListRow({
</p>
}
/>
- <TooltipPopup side="top" className="max-w-80">
- {endpoint.httpBaseUrl}
- </TooltipPopup>
+ <TooltipPopup side="top">{endpoint.httpBaseUrl}</TooltipPopup>
</Tooltip>
) : null}
{!isAvailable ? (
@@ -1573,7 +1569,7 @@ function SavedBackendListRow({
>
{subtitleText}
</TooltipTrigger>
- <TooltipPopup side="top" className="max-w-80 whitespace-pre-wrap leading-tight">
+ <TooltipPopup side="top" className="whitespace-pre-wrap">
{unsupported
? (environment.connection.error ?? connectionStatusText(environment.connection))
: enabled
@@ -3635,9 +3631,7 @@ export function ConnectionsSettings() {
}
/>
{pendingTailscaleServeBaseUrl ? (
- <TooltipPopup side="top" className="max-w-80">
- {pendingTailscaleServeBaseUrl}
- </TooltipPopup>
+ <TooltipPopup side="top">{pendingTailscaleServeBaseUrl}</TooltipPopup>
) : null}
</Tooltip>
</div>
diff --git a/apps/web/src/components/settings/DiagnosticsSettings.tsx b/apps/web/src/components/settings/DiagnosticsSettings.tsx
index 0fe1ae2f624..15fa80237da 100644
--- a/apps/web/src/components/settings/DiagnosticsSettings.tsx
+++ b/apps/web/src/components/settings/DiagnosticsSettings.tsx
@@ -109,12 +109,7 @@ function StatBlock({
</button>
}
/>
- <TooltipPopup
- side="top"
- className="max-w-[min(300px,calc(100vw-2rem))] whitespace-normal text-left text-[11px] leading-relaxed text-wrap"
- >
- {tooltip}
- </TooltipPopup>
+ <TooltipPopup side="top">{tooltip}</TooltipPopup>
</Tooltip>
) : null}
</div>
@@ -225,10 +220,7 @@ function TraceIdCell({ traceId }: { traceId: string }) {
</span>
}
/>
- <TooltipPopup
- side="top"
- className="max-w-[min(520px,calc(100vw-2rem))] break-all font-mono text-[11px]"
- >
+ <TooltipPopup side="top" variant="code">
{traceId}
</TooltipPopup>
</Tooltip>
@@ -300,10 +292,7 @@ function ProcessNameCell({
<TooltipTrigger
render={<span className="min-w-0 truncate font-medium text-foreground">{name}</span>}
/>
- <TooltipPopup
- side="top"
- className="max-w-[min(440px,calc(100vw-2rem))] whitespace-normal break-words text-left font-mono text-[11px] leading-relaxed text-wrap"
- >
+ <TooltipPopup side="top" variant="code">
{process.command}
</TooltipPopup>
</Tooltip>
@@ -411,10 +400,7 @@ function ProcessDiagnosticsTable({
<TooltipTrigger
render={<span className="block truncate">{process.command}</span>}
/>
- <TooltipPopup
- side="top"
- className="max-w-[min(440px,calc(100vw-2rem))] whitespace-normal break-words text-left font-mono text-[11px] leading-relaxed text-wrap"
- >
+ <TooltipPopup side="top" variant="code">
{process.command}
</TooltipPopup>
</Tooltip>
@@ -484,10 +470,7 @@ function ResourceHistoryProcessNameCell({
<TooltipTrigger
render={<span className="min-w-0 truncate font-medium text-foreground">{name}</span>}
/>
- <TooltipPopup
- side="top"
- className="max-w-[min(440px,calc(100vw-2rem))] whitespace-normal break-words text-left font-mono text-[11px] leading-relaxed text-wrap"
- >
+ <TooltipPopup side="top" variant="code">
{process.command}
</TooltipPopup>
</Tooltip>
@@ -654,10 +637,7 @@ function ProcessResourceHistoryTable({
<TooltipTrigger
render={<span className="block truncate">{process.command}</span>}
/>
- <TooltipPopup
- side="top"
- className="max-w-[min(440px,calc(100vw-2rem))] whitespace-normal break-words text-left font-mono text-[11px] leading-relaxed text-wrap"
- >
+ <TooltipPopup side="top" variant="code">
{process.command}
</TooltipPopup>
</Tooltip>
diff --git a/apps/web/src/components/settings/KeybindingsSettings.tsx b/apps/web/src/components/settings/KeybindingsSettings.tsx
index 7c5bbfa65fb..57f9fff4d4a 100644
--- a/apps/web/src/components/settings/KeybindingsSettings.tsx
+++ b/apps/web/src/components/settings/KeybindingsSettings.tsx
@@ -261,9 +261,7 @@ function WarningTooltipIcon({
>
<TriangleAlertIcon className="size-3.5" />
</TooltipTrigger>
- <TooltipPopup side="top" className="max-w-72 whitespace-normal leading-relaxed">
- {children}
- </TooltipPopup>
+ <TooltipPopup side="top">{children}</TooltipPopup>
</Tooltip>
);
}
diff --git a/apps/web/src/components/settings/ResourceTelemetryDiagnostics.tsx b/apps/web/src/components/settings/ResourceTelemetryDiagnostics.tsx
index 51cabd6010b..36326958550 100644
--- a/apps/web/src/components/settings/ResourceTelemetryDiagnostics.tsx
+++ b/apps/web/src/components/settings/ResourceTelemetryDiagnostics.tsx
@@ -503,10 +503,7 @@ function ProcessTreeName({
<TooltipTrigger
render={<span className="min-w-0 truncate font-medium text-foreground">{name}</span>}
/>
- <TooltipPopup
- side="top"
- className="max-w-[min(520px,calc(100vw-2rem))] whitespace-normal break-words text-left font-mono text-[11px]"
- >
+ <TooltipPopup side="top" variant="code">
{process.command || process.name}
</TooltipPopup>
</Tooltip>
@@ -721,10 +718,7 @@ function HistoryProcessTable({
</span>
}
/>
- <TooltipPopup
- side="top"
- className="max-w-[min(520px,calc(100vw-2rem))] whitespace-normal break-words text-left font-mono text-[11px]"
- >
+ <TooltipPopup side="top" variant="code">
{process.command || process.name}
</TooltipPopup>
</Tooltip>
diff --git a/apps/web/src/components/settings/settingsLayout.tsx b/apps/web/src/components/settings/settingsLayout.tsx
index 6691b93a724..c204fb9d6b6 100644
--- a/apps/web/src/components/settings/settingsLayout.tsx
+++ b/apps/web/src/components/settings/settingsLayout.tsx
@@ -156,9 +156,7 @@ export function PolicyTooltip({ children }: { readonly children: string }) {
</Button>
}
/>
- <TooltipPopup side="top" className="max-w-72">
- {children}
- </TooltipPopup>
+ <TooltipPopup side="top">{children}</TooltipPopup>
</Tooltip>
);
}
@@ -372,9 +370,7 @@ export function SettingsRow({
{control}
</div>
</TooltipTrigger>
- <TooltipPopup side="top" className="max-w-72">
- {message}
- </TooltipPopup>
+ <TooltipPopup side="top">{message}</TooltipPopup>
</Tooltip>
);
// A mixed selection keeps the real control with "Mixed" as its placeholder
diff --git a/apps/web/src/components/ui/alert-dialog.tsx b/apps/web/src/components/ui/alert-dialog.tsx
index 6e6c1ce2b21..7cd6d40c59e 100644
--- a/apps/web/src/components/ui/alert-dialog.tsx
+++ b/apps/web/src/components/ui/alert-dialog.tsx
@@ -101,7 +101,7 @@ function AlertDialogFooter({
function AlertDialogTitle({ className, ...props }: AlertDialogPrimitive.Title.Props) {
return (
<AlertDialogPrimitive.Title
- className={cn("font-heading font-semibold text-xl leading-none", className)}
+ className={cn("wrap-anywhere font-heading font-semibold text-xl leading-none", className)}
data-slot="alert-dialog-title"
{...props}
/>
diff --git a/apps/web/src/components/ui/dialog.tsx b/apps/web/src/components/ui/dialog.tsx
index 22ce5637204..db1b6e35b80 100644
--- a/apps/web/src/components/ui/dialog.tsx
+++ b/apps/web/src/components/ui/dialog.tsx
@@ -145,7 +145,7 @@ function DialogFooter({
function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
return (
<DialogPrimitive.Title
- className={cn("font-heading font-semibold text-xl leading-none", className)}
+ className={cn("wrap-anywhere font-heading font-semibold text-xl leading-none", className)}
data-slot="dialog-title"
{...props}
/>
diff --git a/apps/web/src/components/ui/tooltip.tsx b/apps/web/src/components/ui/tooltip.tsx
index c0aaea40cea..7ba9e4c238c 100644
--- a/apps/web/src/components/ui/tooltip.tsx
+++ b/apps/web/src/components/ui/tooltip.tsx
@@ -23,7 +23,8 @@ function TooltipPopup({
align?: TooltipPrimitive.Positioner.Props["align"];
side?: TooltipPrimitive.Positioner.Props["side"];
sideOffset?: TooltipPrimitive.Positioner.Props["sideOffset"];
- variant?: "default" | "glass";
+ /** `code` renders monospace content that breaks anywhere, for paths and commands. */
+ variant?: "default" | "glass" | "code";
anchor?: TooltipPrimitive.Positioner.Props["anchor"];
}) {
return (
@@ -42,6 +43,10 @@ function TooltipPopup({
variant === "glass"
? "dropdown-glass shadow-xl shadow-black/25 before:hidden"
: "border bg-popover not-dark:bg-clip-padding shadow-md/5",
+ // One wrap width for prose; code dumps get more room and break anywhere.
+ variant === "code"
+ ? "max-w-120 wrap-anywhere text-left font-mono text-[11px] leading-relaxed"
+ : "max-w-80 wrap-anywhere whitespace-normal leading-snug",
className,
)}
data-slot="tooltip-popup"
diff --git a/apps/web/src/components/usage/UsageLimits.tsx b/apps/web/src/components/usage/UsageLimits.tsx
index 6d30d49a7e4..05c91739e25 100644
--- a/apps/web/src/components/usage/UsageLimits.tsx
+++ b/apps/web/src/components/usage/UsageLimits.tsx
@@ -127,7 +127,7 @@ function WindowBar({
/>
) : null}
</TooltipTrigger>
- <TooltipPopup side="top" className="max-w-72 text-xs">
+ <TooltipPopup side="top">
<div className="flex flex-col gap-0.5">
<span className="text-foreground">
{remaining}% left{timeLeft !== null ? ` · ${timeLeft}% of the window left` : ""}
diff --git a/apps/web/src/routes/_chat.pull-requests.tsx b/apps/web/src/routes/_chat.pull-requests.tsx
index ce2bd238746..1e540d64634 100644
--- a/apps/web/src/routes/_chat.pull-requests.tsx
+++ b/apps/web/src/routes/_chat.pull-requests.tsx
@@ -2280,9 +2280,7 @@ function CompactFilterMenu<Value extends string>({
) : (
<Tooltip key={option.value}>
<TooltipTrigger render={item} />
- <TooltipPopup side="right" className="max-w-64 break-words">
- {option.unavailable}
- </TooltipPopup>
+ <TooltipPopup side="right">{option.unavailable}</TooltipPopup>
</Tooltip>
);
})}
diff --git a/scripts/lint-restyle-ceiling.ts b/scripts/lint-restyle-ceiling.ts
index db8a73b2032..a0743a16763 100644
--- a/scripts/lint-restyle-ceiling.ts
+++ b/scripts/lint-restyle-ceiling.ts
@@ -8,7 +8,7 @@ import * as NodeURL from "node:url";
// components/ui exports are migrated to variants (see vite.config.ts). This gate keeps the
// count from growing: CI fails when findings exceed the ceiling. Lower the ceiling when you
// migrate a file, and delete this script when the rule becomes an error.
-export const RESTYLE_CEILING = 981;
+export const RESTYLE_CEILING = 921;
const RULE = "shadcn(no-restyle)";