Skip to content

Commit 7723649

Browse files
refactor(web): one wrap width for tooltips, plus a code variant
Multi-line tooltips set their own max-width and line-height through className in eight combinations, and path or command tooltips each re-declared the same monospace treatment. TooltipPopup now wraps prose at max-w-80 with one line-height, and variant="code" renders monospace at max-w-120 breaking anywhere. The 60 call sites drop their classes. Dialog and alert-dialog titles also gain wrap-anywhere in the base, since any of them can interpolate a path. Visible effect: tooltips that wrapped at 16, 18, 24 or 30rem now wrap at 20rem; wrapped tooltips share one line-height. Lowers the no-restyle ceiling from 1207 to 1147. Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent 6d94dc3 commit 7723649

38 files changed

Lines changed: 60 additions & 153 deletions

‎apps/web/src/components/BranchToolbarBranchSelector.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ export function BranchToolbarBranchSelector({
918918
</label>
919919
}
920920
/>
921-
<TooltipPopup side="top" className="max-w-72 whitespace-normal leading-tight">
921+
<TooltipPopup side="top">
922922
Creates the worktree from the latest matching branch on origin instead of your local
923923
branch.
924924
</TooltipPopup>

‎apps/web/src/components/ChatMarkdown.tsx‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2209,10 +2209,7 @@ const MarkdownFileLink = memo(function MarkdownFileLink({
22092209
)
22102210
}
22112211
/>
2212-
<TooltipPopup
2213-
side="top"
2214-
className="max-w-[min(40rem,calc(100vw-2rem))] font-mono text-[11px] leading-tight"
2215-
>
2212+
<TooltipPopup side="top" variant="code">
22162213
{/* The full path: the chip already shows the shortened form, and a link
22172214
to the workspace root collapses to a bare label that repeats it. */}
22182215
<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 = {
30623059
return (
30633060
<Tooltip>
30643061
<TooltipTrigger render={link} />
3065-
<TooltipPopup
3066-
side="top"
3067-
className="max-w-[min(36rem,calc(100vw-2rem))] whitespace-normal leading-tight wrap-anywhere"
3068-
>
3069-
{href}
3070-
</TooltipPopup>
3062+
<TooltipPopup side="top">{href}</TooltipPopup>
30713063
</Tooltip>
30723064
);
30733065
}

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6533,7 +6533,7 @@ export default function ChatView(props: ChatViewProps) {
65336533
</code>
65346534
}
65356535
/>
6536-
<TooltipPopup side="top" className="max-w-80">
6536+
<TooltipPopup side="top">
65376537
This thread last ran on {localCheckoutBranchMismatch.threadBranch}. Sending will
65386538
continue on {localCheckoutBranchMismatch.currentBranch}.
65396539
</TooltipPopup>

‎apps/web/src/components/ComposerPromptEditorTiptap.tsx‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,7 @@ function ComposerMentionNodeView({ node }: NodeViewProps) {
237237
<NodeViewWrapper as="span" className={COMPOSER_INLINE_CHIP_DECORATOR_CLASS_NAME}>
238238
<Tooltip>
239239
<TooltipTrigger render={chip} />
240-
<TooltipPopup
241-
side="top"
242-
className="max-w-120 whitespace-normal leading-tight wrap-anywhere"
243-
>
244-
{path}
245-
</TooltipPopup>
240+
<TooltipPopup side="top">{path}</TooltipPopup>
246241
</Tooltip>
247242
</NodeViewWrapper>
248243
);

‎apps/web/src/components/ConfirmDialogHost.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function ConfirmDialogHost() {
7777
>
7878
<AlertDialogPopup>
7979
<AlertDialogHeader>
80-
<AlertDialogTitle className="wrap-anywhere">{copy.title}</AlertDialogTitle>
80+
<AlertDialogTitle>{copy.title}</AlertDialogTitle>
8181
{copy.description ? (
8282
<AlertDialogDescription className="whitespace-pre-line">
8383
{copy.description}

‎apps/web/src/components/ConnectionStatusDot.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function ConnectionStatusDot({
6969
return (
7070
<Tooltip>
7171
<TooltipTrigger render={dot} />
72-
<TooltipPopup side="top" className="max-w-80 whitespace-pre-wrap leading-tight">
72+
<TooltipPopup side="top" className="whitespace-pre-wrap">
7373
{tooltipText}
7474
</TooltipPopup>
7575
</Tooltip>

‎apps/web/src/components/GitActionsControl.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ function PublishRepositoryDialog(props: PublishRepositoryDialogProps) {
659659
</Button>
660660
}
661661
/>
662-
<TooltipPopup side="top" align="end" className="max-w-72">
662+
<TooltipPopup side="top" align="end">
663663
{readiness.hint ??
664664
"Open Settings -> Source Control to configure this provider."}
665665
</TooltipPopup>

‎apps/web/src/components/LegacySidebar.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,9 +785,7 @@ const SidebarThreadRow = memo(function SidebarThreadRow(props: SidebarThreadRowP
785785
</span>
786786
}
787787
/>
788-
<TooltipPopup side="top" className="max-w-80 whitespace-normal leading-tight">
789-
{thread.title}
790-
</TooltipPopup>
788+
<TooltipPopup side="top">{thread.title}</TooltipPopup>
791789
</Tooltip>
792790
)}
793791
</div>

‎apps/web/src/components/ServerUpdateAction.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ export function ServerUpdateProgress({
163163
<span className="size-1.5 shrink-0 rounded-full bg-destructive" aria-hidden="true" />
164164
<Tooltip>
165165
<TooltipTrigger render={<span className="min-w-0 truncate">{state.message}</span>} />
166-
<TooltipPopup side="top" className="max-w-80">
167-
{state.message}
168-
</TooltipPopup>
166+
<TooltipPopup side="top">{state.message}</TooltipPopup>
169167
</Tooltip>
170168
</div>
171169
);

‎apps/web/src/components/Sidebar.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ function SidebarThreadTooltip({
350350
align="start"
351351
sideOffset={4}
352352
variant="glass"
353-
className="max-w-80 text-left whitespace-normal [&_[data-slot=tooltip-viewport]]:p-0"
353+
className="[&_[data-slot=tooltip-viewport]]:p-0"
354354
>
355355
<div className="flex min-w-0 max-w-80 flex-col gap-2 p-[var(--floating-content-inset)]">
356356
<div className="min-w-0 truncate text-xs leading-tight font-medium text-foreground">

0 commit comments

Comments
 (0)