refactor(web): use shared glass surfaces
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
e703b2a03d
commit
701ccd2213
6 files changed
+19
-67
No files matched your search
@@ -6106,7 +6106,9 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="chat-composer-horizontal-inset chat-composer-lower-chrome relative z-10 pb-[calc(env(safe-area-inset-bottom)+0.75rem)] sm:pb-[calc(env(safe-area-inset-bottom)+1rem)]" />
|
||||
{!isDraftHeroState ? (
|
||||
<div className="chat-composer-horizontal-inset relative z-10 pb-[calc(env(safe-area-inset-bottom)+0.75rem)] sm:pb-[calc(env(safe-area-inset-bottom)+1rem)]" />
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{activeThreadRef && activePreviewMiniPlayer ? (
|
||||
|
||||
@@ -2700,9 +2700,9 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
|
||||
ref={composerSurfaceRef}
|
||||
data-chat-composer-mobile-collapsed={isComposerCollapsedMobile ? "true" : "false"}
|
||||
className={cn(
|
||||
"floating-glass-surface rounded-[20px] border transition-colors duration-200 has-focus-visible:border-ring/45",
|
||||
isDragOverComposer ? "border-primary/70 bg-accent/45" : "border-border",
|
||||
environmentUnavailable ? "opacity-75" : null,
|
||||
"rounded-[20px] transition-[background-color] duration-200",
|
||||
isDragOverComposer ? "bg-accent/45 ring-1 ring-primary/70" : null,
|
||||
environmentUnavailable || projectSelectionRequired ? "opacity-75" : null,
|
||||
composerProviderState.composerSurfaceClassName,
|
||||
)}
|
||||
onFocusCapture={(event) => {
|
||||
|
||||
@@ -103,7 +103,7 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) {
|
||||
const card = (
|
||||
<div
|
||||
className={cn(
|
||||
"floating-glass-surface overflow-x-hidden rounded-[20px] border border-border",
|
||||
"dropdown-glass overflow-x-hidden rounded-[20px]",
|
||||
props.mode === "inline"
|
||||
? "max-h-full overflow-y-auto overscroll-contain [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
|
||||
: "max-h-[calc(100dvh-6.5rem)] overflow-y-auto overscroll-contain [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
export const CHAT_GLASS_POPUP_SURFACE_CLASS =
|
||||
"floating-glass-surface !bg-[color-mix(in_srgb,var(--card)_20%,transparent)] dark:!bg-[color-mix(in_srgb,var(--card)_45%,transparent)]";
|
||||
|
||||
export const CHAT_GLASS_ROW_POPUP_CLASS = `${CHAT_GLASS_POPUP_SURFACE_CLASS} w-(--anchor-width)`;
|
||||
|
||||
export const CHAT_GLASS_MENU_POPUP_CLASS = `${CHAT_GLASS_POPUP_SURFACE_CLASS} min-w-60 max-w-(--available-width)`;
|
||||
@@ -1,5 +1,3 @@
|
||||
import { CHAT_GLASS_MENU_POPUP_CLASS, CHAT_GLASS_ROW_POPUP_CLASS } from "./glassPopupStyles";
|
||||
|
||||
/**
|
||||
* Visual primitives shared by controls when they are rendered in the thread details panel.
|
||||
*
|
||||
@@ -48,6 +46,6 @@ export const THREAD_DETAILS_PANEL_SPLIT_SECONDARY_CLASS = `h-9 w-8 rounded-s-non
|
||||
|
||||
export const THREAD_DETAILS_PANEL_SPLIT_SEPARATOR_CLASS = "h-4 w-px shrink-0 bg-border/65";
|
||||
|
||||
export const THREAD_DETAILS_PANEL_ROW_POPUP_CLASS = CHAT_GLASS_ROW_POPUP_CLASS;
|
||||
export const THREAD_DETAILS_PANEL_ROW_POPUP_CLASS = "w-(--anchor-width)";
|
||||
|
||||
export const THREAD_DETAILS_PANEL_MENU_POPUP_CLASS = CHAT_GLASS_MENU_POPUP_CLASS;
|
||||
export const THREAD_DETAILS_PANEL_MENU_POPUP_CLASS = "min-w-60 max-w-(--available-width)";
|
||||
+10
-52
@@ -437,19 +437,6 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
|
||||
);
|
||||
}
|
||||
|
||||
.floating-glass-surface,
|
||||
.chat-composer-lower-chrome {
|
||||
background: color-mix(in srgb, var(--card) 20%, transparent);
|
||||
}
|
||||
|
||||
.floating-glass-surface {
|
||||
box-shadow:
|
||||
0 18px 48px -20px rgb(0 0 0 / 28%),
|
||||
0 4px 14px -7px rgb(0 0 0 / 22%);
|
||||
-webkit-backdrop-filter: blur(16px);
|
||||
backdrop-filter: blur(16px);
|
||||
}
|
||||
|
||||
.chat-composer-glass {
|
||||
background: color-mix(in srgb, var(--background) var(--glass-opacity), transparent);
|
||||
-webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
|
||||
@@ -517,6 +504,7 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
|
||||
|
||||
.chat-composer-glass-host {
|
||||
position: relative;
|
||||
box-shadow: 0 12px 28px -18px rgb(0 0 0 / 40%);
|
||||
}
|
||||
|
||||
.chat-composer-glass-host::after {
|
||||
@@ -555,13 +543,10 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
|
||||
border-radius: 0 0 16px 16px;
|
||||
-webkit-mask-image: linear-gradient(to bottom, transparent 0 1rem, black 1rem);
|
||||
mask-image: linear-gradient(to bottom, transparent 0 1rem, black 1rem);
|
||||
box-shadow: 0 12px 28px -18px rgb(0 0 0 / 40%);
|
||||
content: "";
|
||||
}
|
||||
|
||||
.dark .floating-glass-surface {
|
||||
background: color-mix(in srgb, var(--card) 45%, transparent);
|
||||
}
|
||||
|
||||
.dark .chat-composer-glass-shell {
|
||||
--chat-composer-glass-surface: color-mix(in srgb, var(--background) 96%, var(--color-white));
|
||||
--chat-composer-outline: color-mix(in srgb, var(--color-white) 5%, transparent);
|
||||
@@ -586,6 +571,7 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
|
||||
transparent calc(1rem + 10px)
|
||||
),
|
||||
rgb(255 255 255 / 2%);
|
||||
box-shadow: 0 14px 32px -18px rgb(0 0 0 / 75%);
|
||||
}
|
||||
|
||||
@supports not (clip-path: shape(from 0 0, line to 1px 1px)) {
|
||||
@@ -685,38 +671,15 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
|
||||
0 24px 72px -20px rgb(0 0 0 / 90%);
|
||||
}
|
||||
|
||||
.dark .floating-glass-surface {
|
||||
box-shadow:
|
||||
0 18px 48px -20px rgb(0 0 0 / 60%),
|
||||
0 4px 14px -7px rgb(0 0 0 / 40%);
|
||||
.dark .dialog-backdrop {
|
||||
background: color-mix(in srgb, var(--background) 64%, transparent);
|
||||
}
|
||||
|
||||
.chat-composer-glass-shell-with-context::before {
|
||||
border-radius: 0;
|
||||
/*
|
||||
* One continuous glass layer: a 22px composer joined to a 16px strip,
|
||||
* whose visible sides align with the composer's bottom tangents.
|
||||
*/
|
||||
clip-path: shape(
|
||||
from 0 22px,
|
||||
curve to 22px 0 with 0 9.85px / 9.85px 0,
|
||||
line to calc(100% - 22px) 0,
|
||||
curve to 100% 22px with calc(100% - 9.85px) 0 / 100% 9.85px,
|
||||
line to 100% calc(100% - var(--chat-composer-context-extension) - 22px),
|
||||
curve to calc(100% - 22px) calc(100% - var(--chat-composer-context-extension)) with 100%
|
||||
calc(100% - var(--chat-composer-context-extension) - 9.85px) / calc(100% - 9.85px)
|
||||
calc(100% - var(--chat-composer-context-extension)),
|
||||
line to calc(100% - 22px) calc(100% - 16px),
|
||||
curve to calc(100% - 38px) 100% with calc(100% - 22px) calc(100% - 7.16px) /
|
||||
calc(100% - 29.16px) 100%,
|
||||
line to 38px 100%,
|
||||
curve to 22px calc(100% - 16px) with 29.16px 100% / 22px calc(100% - 7.16px),
|
||||
line to 22px calc(100% - var(--chat-composer-context-extension)),
|
||||
curve to 0 calc(100% - var(--chat-composer-context-extension) - 22px) with 9.85px
|
||||
calc(100% - var(--chat-composer-context-extension)) / 0
|
||||
calc(100% - var(--chat-composer-context-extension) - 9.85px),
|
||||
line to 0 22px,
|
||||
close
|
||||
.glass-opacity-slider {
|
||||
--glass-slider-progress: 0%;
|
||||
--glass-slider-fill-offset: 0.5rem;
|
||||
--glass-slider-fill-position: calc(
|
||||
var(--glass-slider-progress) + var(--glass-slider-fill-offset)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -735,11 +698,6 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
|
||||
}
|
||||
|
||||
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
|
||||
.floating-glass-surface,
|
||||
.chat-composer-lower-chrome {
|
||||
background: var(--background);
|
||||
}
|
||||
|
||||
.chat-composer-glass,
|
||||
.alert-glass {
|
||||
background: var(--background) !important;
|
||||
|
||||
Reference in new issue
Block a user