Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/web/src/components/chat/ComposerSurface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,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
Expand All @@ -59,6 +60,7 @@ function Host({ className, ...props }: ComponentProps<"div">) {
);
}

/** Covers the input surface when an attached banner replaces the outer glass backdrop. */
function Main({ className, ...props }: ComponentProps<"div">) {
return (
<div
Expand All @@ -79,13 +81,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 (
<div
data-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 ps-1 pe-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",
Comment thread
ScottN-PV marked this conversation as resolved.
"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)",
Expand Down
2 changes: 2 additions & 0 deletions apps/web/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
by 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 of
shadow fading away from the seam. Inline, so the offsets resolve on the
element. below: the context strip under the composer (1rem seam, faint
Expand Down
Loading