TypeScript
fix(web): close the gap between the composer and its bottom toolbar (#12952)
Scott Nortemanb90b8052c4c7
diff --git a/apps/web/src/components/chat/ComposerSurface.tsx b/apps/web/src/components/chat/ComposerSurface.tsxindex 4140e0ba676..e5ae2770b6c 100644--- a/apps/web/src/components/chat/ComposerSurface.tsx+++ b/apps/web/src/components/chat/ComposerSurface.tsx@@ -40,6 +40,7 @@ const outlineClasses =const contextSeamClasses ="group-data-with-context/composer-surface:after:[clip-path:polygon(0_0,100%_0,100%_100%,calc(100%-22px)_100%,calc(100%-22px)_calc(100%-2px),22px_calc(100%-2px),22px_100%,0_100%)]";+/** Frames the input while leaving the shared edge open for the context strip's outline. */function Host({ className, ...props }: ComponentProps<"div">) {return (<div@@ -56,6 +57,7 @@ function Host({ className, ...props }: ComponentProps<"div">) {);}+/** Covers the input surface when an attached banner or the model strip transition replaces the outer glass backdrop. */function Main({ className, ...props }: ComponentProps<"div">) {return (<div@@ -77,13 +79,14 @@ function Main({ className, ...props }: ComponentProps<"div">) {);}+/** Extends the composer outline below the input, masking its overlap up to one pixel above the shared edge so no seam shows. */function ContextStrip({ className, ...props }: ComponentProps<"div">) {return (<divdata-slot="composer-context-strip"className={cn("group/composer-context relative isolate mx-auto -mt-4 flex w-[calc(100%-2*var(--chat-composer-drawer-inset))] items-center gap-2 overflow-x-clip overflow-y-visible px-2 pt-5 pb-1",- "before:absolute before:inset-0 before:-z-1 before:rounded-b-2xl before:border before:border-(--chat-composer-outline) before:mask-b-from-transparent before:mask-b-from-4 before:mask-b-to-black before:mask-b-to-4 before:shadow-composer",+ "before:absolute before:inset-0 before:-z-1 before:rounded-b-2xl before:border before:border-(--chat-composer-outline) before:mask-b-from-transparent before:mask-b-from-(length:--spacing-composer-seam) before:mask-b-to-black before:mask-b-to-(length:--spacing-composer-seam) before:shadow-composer","dark:before:border-white/7 dark:before:bg-composer-seam-below dark:before:shadow-composer-dark","group-has-data-[composer-banner-surface=attached]/composer-surface:before:bg-(--chat-composer-glass-surface)/(--glass-opacity) group-has-data-[composer-banner-surface=attached]/composer-surface:before:backdrop-blur-(--glass-blur) group-has-data-[composer-banner-surface=attached]/composer-surface:before:backdrop-saturate-(--glass-saturation)","not-supports-[clip-path:shape(from_0_0,line_to_1px_1px)]:before:bg-(--chat-composer-glass-surface)/(--glass-opacity) not-supports-[clip-path:shape(from_0_0,line_to_1px_1px)]:before:backdrop-blur-(--glass-blur) not-supports-[clip-path:shape(from_0_0,line_to_1px_1px)]:before:backdrop-saturate-(--glass-saturation)",diff --git a/apps/web/src/index.css b/apps/web/src/index.cssindex 183bb1c8658..5b4945bf3d3 100644--- a/apps/web/src/index.css+++ b/apps/web/src/index.css@@ -192,6 +192,8 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobilby the composer, its context strip and attached banners. */--shadow-composer: 0 12px 28px -18px rgb(0 0 0 / 40%);--shadow-composer-dark: 0 14px 32px -18px rgb(0 0 0 / 75%);+ /* Overlap the lower toolbar backdrop by one pixel to cover the composer seam. */+ --spacing-composer-seam: calc(var(--spacing) * 4 - 1px);/* Dark-mode shade where an attached surface meets the composer: 10px ofshadow fading away from the seam. Inline, so the offsets resolve on theelement. below: the context strip under the composer (1rem seam, faint