Skip to content
TypeScript

fix(web): wrap full status text in composer hover details (#16158)

Utkarsh Patil5b613de175dd
diff --git a/apps/web/src/components/chat/ComposerBannerStack.tsx b/apps/web/src/components/chat/ComposerBannerStack.tsx
index 77db010cf69..0cf3e8d05ab 100644
--- a/apps/web/src/components/chat/ComposerBannerStack.tsx
+++ b/apps/web/src/components/chat/ComposerBannerStack.tsx
@@ -306,7 +306,7 @@ function NoticeDescription({ children, compact }: { children: ReactNode; compact
aria-label="Notice details"
tooltipStyle
side="top"
- className="max-w-80 whitespace-normal wrap-anywhere"
+ className="max-w-[min(30rem,calc(100vw-2rem))] whitespace-normal wrap-anywhere [--inline-button-text-align:start] [--inline-button-white-space:normal] [&_[data-slot=inline-button]]:max-w-full"
>
<ComposerBanner.Scroll className="max-h-[min(var(--available-height),24rem,40dvh)]">
{children}
diff --git a/apps/web/src/components/ui/button.tsx b/apps/web/src/components/ui/button.tsx
index 1a101f10711..177e4f85701 100644
--- a/apps/web/src/components/ui/button.tsx
+++ b/apps/web/src/components/ui/button.tsx
@@ -101,7 +101,7 @@ function Button({ className, variant, size, render, ...props }: ButtonProps) {
export { Button, buttonVariants, type ButtonSize, type ButtonVariant };
const inlineButtonVariants = cva(
- "inline-flex shrink-0 cursor-pointer items-center gap-0.5 whitespace-nowrap font-medium underline-offset-2 hover:underline focus-visible:outline-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-64",
+ "inline-flex shrink-0 cursor-pointer items-center gap-0.5 font-medium underline-offset-2 [text-align:var(--inline-button-text-align,center)] [white-space:var(--inline-button-white-space,nowrap)] hover:underline focus-visible:outline-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-64",
{
defaultVariants: { tone: "default" },
variants: {
@@ -117,7 +117,7 @@ const inlineButtonVariants = cva(
},
);
-/** An inline text action that keeps the size of the surrounding text and underlines on hover. */
+/** An inline text action. Set --inline-button-white-space to normal in wrapping prose containers. */
export function InlineButton({
className,
tone,