Reserve space for inline thread details panel
- Move the inline thread panel to an absolute overlay - Add shared inset styling so the timeline and composer avoid overlap - Rename composer glass styling to the shared floating surface class
This commit is contained in:
1 parent
361df65ffb
commit
e201350381
5 files changed
+52
-16
No files matched your search
@@ -1375,6 +1375,7 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
threadPanelPresentation,
|
||||
),
|
||||
);
|
||||
const inlineThreadPanelOpen = threadPanelOpen && threadPanelPresentation === "inline";
|
||||
|
||||
useEffect(() => {
|
||||
if (!activeThreadRef) return;
|
||||
@@ -5000,7 +5001,10 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
onDismiss={() => setThreadError(activeThread.id, null)}
|
||||
/>
|
||||
{/* Main content area with optional plan sidebar */}
|
||||
<div className="flex min-h-0 min-w-0 flex-1">
|
||||
<div
|
||||
className="relative flex min-h-0 min-w-0 flex-1"
|
||||
data-thread-details-inline-reserved={inlineThreadPanelOpen ? "true" : undefined}
|
||||
>
|
||||
{/* Chat column */}
|
||||
<div className="relative flex min-h-0 min-w-0 flex-1 flex-col">
|
||||
{/* Messages Wrapper */}
|
||||
@@ -5039,7 +5043,7 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
{/* scroll to bottom pill — shown when user has scrolled away from the bottom */}
|
||||
{showScrollToBottom && (
|
||||
<div
|
||||
className="pointer-events-none absolute left-1/2 z-30 flex -translate-x-1/2 justify-center py-1.5"
|
||||
className="chat-scroll-to-bottom pointer-events-none absolute z-30 flex justify-center py-1.5"
|
||||
style={{ bottom: composerOverlayHeight + 4 }}
|
||||
>
|
||||
<button
|
||||
@@ -5174,7 +5178,7 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
) : null}
|
||||
</div>
|
||||
{/* end chat column */}
|
||||
{threadPanelOpen && threadPanelPresentation === "inline" ? (
|
||||
{inlineThreadPanelOpen ? (
|
||||
<ThreadDetailsPanel mode="inline" {...threadDetailsPanelProps} />
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
@@ -2096,7 +2096,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
|
||||
ref={composerSurfaceRef}
|
||||
data-chat-composer-mobile-collapsed={isComposerCollapsedMobile ? "true" : "false"}
|
||||
className={cn(
|
||||
"chat-composer-glass rounded-[20px] border transition-colors duration-200 has-focus-visible:border-ring/45",
|
||||
"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,
|
||||
composerProviderState.composerSurfaceClassName,
|
||||
|
||||
@@ -457,7 +457,7 @@ export const MessagesTimeline = memo(function MessagesTimeline({
|
||||
maintainScrollAtEndThreshold={0.1}
|
||||
maintainVisibleContentPosition
|
||||
onScroll={handleScroll}
|
||||
className="scrollbar-gutter-both h-full min-h-0 overflow-x-hidden overscroll-y-contain px-3 sm:px-5"
|
||||
className="messages-timeline-scroll scrollbar-gutter-both h-full min-h-0 overflow-x-hidden overscroll-y-contain"
|
||||
ListHeaderComponent={listHeader}
|
||||
ListFooterComponent={TIMELINE_LIST_FOOTER}
|
||||
/>
|
||||
|
||||
@@ -131,7 +131,12 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) {
|
||||
|
||||
const card = (
|
||||
<div
|
||||
className="overflow-hidden rounded-[18px] border border-border/75 bg-card/95 shadow-[0_8px_28px_rgba(0,0,0,0.045)] dark:shadow-[0_12px_30px_rgba(0,0,0,0.18)]"
|
||||
className={cn(
|
||||
"floating-glass-surface overflow-x-hidden rounded-[20px] border border-border/75",
|
||||
props.mode === "inline"
|
||||
? "max-h-full overflow-y-auto overscroll-contain [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
|
||||
: "overflow-y-hidden",
|
||||
)}
|
||||
data-thread-details-card
|
||||
>
|
||||
<section aria-labelledby="thread-details-project-heading">
|
||||
@@ -285,7 +290,7 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) {
|
||||
return (
|
||||
<aside
|
||||
aria-label="Thread details"
|
||||
className="w-[clamp(18rem,24vw,21rem)] shrink-0 overflow-y-auto bg-background p-3 pl-0"
|
||||
className="absolute inset-y-0 right-[var(--app-scrollbar-width)] z-20 w-[var(--thread-details-panel-width)] p-3"
|
||||
data-thread-details-panel="inline"
|
||||
>
|
||||
{card}
|
||||
|
||||
+36
-9
@@ -13,6 +13,8 @@
|
||||
--workspace-native-controls-inset: 0px;
|
||||
--workspace-titlebar-control-size: 1.75rem;
|
||||
--workspace-titlebar-control-gap: 0.75rem;
|
||||
--thread-details-panel-width: clamp(18rem, 24vw, 21rem);
|
||||
--thread-details-panel-inset: 0px;
|
||||
}
|
||||
|
||||
[data-slot="sidebar-wrapper"] {
|
||||
@@ -146,20 +148,38 @@
|
||||
@apply flex h-10 min-h-10 shrink-0 items-center border-b border-border/60 bg-background;
|
||||
}
|
||||
|
||||
.chat-composer-horizontal-inset {
|
||||
padding-inline-start: calc(env(safe-area-inset-left) + 0.75rem);
|
||||
padding-inline-end: calc(env(safe-area-inset-right) + 0.75rem);
|
||||
[data-thread-details-inline-reserved="true"] {
|
||||
--thread-details-panel-inset: var(--thread-details-panel-width);
|
||||
}
|
||||
|
||||
.chat-composer-glass,
|
||||
.messages-timeline-scroll {
|
||||
padding-inline-start: 0.75rem;
|
||||
padding-inline-end: calc(0.75rem + var(--thread-details-panel-inset));
|
||||
}
|
||||
|
||||
.chat-scroll-to-bottom {
|
||||
inset-inline-start: 0;
|
||||
inset-inline-end: var(--thread-details-panel-inset);
|
||||
}
|
||||
|
||||
.chat-composer-horizontal-inset {
|
||||
padding-inline-start: calc(env(safe-area-inset-left) + 0.75rem);
|
||||
padding-inline-end: calc(
|
||||
env(safe-area-inset-right) + 0.75rem + var(--thread-details-panel-inset)
|
||||
);
|
||||
}
|
||||
|
||||
.floating-glass-surface,
|
||||
.chat-composer-lower-chrome {
|
||||
background: color-mix(in srgb, var(--card) 20%, transparent);
|
||||
}
|
||||
|
||||
.chat-composer-glass {
|
||||
.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-shared-blur {
|
||||
@@ -167,12 +187,12 @@
|
||||
backdrop-filter: blur(16px);
|
||||
}
|
||||
|
||||
.dark .chat-composer-glass,
|
||||
.dark .floating-glass-surface,
|
||||
.dark .chat-composer-lower-chrome {
|
||||
background: color-mix(in srgb, var(--card) 45%, transparent);
|
||||
}
|
||||
|
||||
.dark .chat-composer-glass {
|
||||
.dark .floating-glass-surface {
|
||||
box-shadow:
|
||||
0 18px 48px -20px rgb(0 0 0 / 60%),
|
||||
0 4px 14px -7px rgb(0 0 0 / 40%);
|
||||
@@ -185,14 +205,21 @@
|
||||
}
|
||||
|
||||
@media (min-width: 40rem) {
|
||||
.messages-timeline-scroll {
|
||||
padding-inline-start: 1.25rem;
|
||||
padding-inline-end: calc(1.25rem + var(--thread-details-panel-inset));
|
||||
}
|
||||
|
||||
.chat-composer-horizontal-inset {
|
||||
padding-inline-start: calc(env(safe-area-inset-left) + 1.25rem);
|
||||
padding-inline-end: calc(env(safe-area-inset-right) + 1.25rem);
|
||||
padding-inline-end: calc(
|
||||
env(safe-area-inset-right) + 1.25rem + var(--thread-details-panel-inset)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
|
||||
.chat-composer-glass,
|
||||
.floating-glass-surface,
|
||||
.chat-composer-lower-chrome {
|
||||
background: var(--card);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user