fix(web): restore v2 composer chrome
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
b75aa98050
commit
165ce66c97
6 files changed
+428
-197
No files matched your search
@@ -31,8 +31,7 @@ import {
|
||||
reconcileRetainedMountedThreadIds,
|
||||
resolveThreadMetadataUpdateForNextTurn,
|
||||
resolveSendEnvMode,
|
||||
startNewThreadForProject,
|
||||
shouldShowBranchMismatchBanner,
|
||||
shouldShowComposerContextStrip,
|
||||
shouldWriteThreadErrorToCurrentServerThread,
|
||||
} from "./ChatView.logic";
|
||||
|
||||
@@ -160,30 +159,44 @@ describe("resolveThreadMetadataUpdateForNextTurn", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("buildThreadTurnInterruptInput", () => {
|
||||
it("targets the session's active running turn", () => {
|
||||
const activeTurnId = TurnId.make("turn-running");
|
||||
|
||||
describe("shouldShowComposerContextStrip", () => {
|
||||
it("shows git context on a draft with an active project", () => {
|
||||
expect(
|
||||
buildThreadTurnInterruptInput(
|
||||
makeThread({
|
||||
session: {
|
||||
...readySession,
|
||||
status: "running",
|
||||
activeTurnId,
|
||||
},
|
||||
}),
|
||||
),
|
||||
).toEqual({ threadId, turnId: activeTurnId });
|
||||
shouldShowComposerContextStrip({
|
||||
routeKind: "draft",
|
||||
isGitRepo: true,
|
||||
hasActiveProject: true,
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("omits a turn id when the session is not running", () => {
|
||||
expect(buildThreadTurnInterruptInput(makeThread({ session: readySession }))).toEqual({
|
||||
threadId,
|
||||
});
|
||||
it("hides git context after the draft becomes a thread", () => {
|
||||
expect(
|
||||
shouldShowComposerContextStrip({
|
||||
routeKind: "server",
|
||||
isGitRepo: true,
|
||||
hasActiveProject: true,
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("hides git context without a git-backed project", () => {
|
||||
expect(
|
||||
shouldShowComposerContextStrip({
|
||||
routeKind: "draft",
|
||||
isGitRepo: false,
|
||||
hasActiveProject: true,
|
||||
}),
|
||||
).toBe(false);
|
||||
expect(
|
||||
shouldShowComposerContextStrip({
|
||||
routeKind: "draft",
|
||||
isGitRepo: true,
|
||||
hasActiveProject: false,
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("deriveComposerSendState", () => {
|
||||
it("treats expired terminal pills as non-sendable content", () => {
|
||||
const state = deriveComposerSendState({
|
||||
|
||||
@@ -268,6 +268,14 @@ export function resolveSendEnvMode(input: {
|
||||
return input.isGitRepo ? input.requestedEnvMode : "local";
|
||||
}
|
||||
|
||||
export function shouldShowComposerContextStrip(input: {
|
||||
routeKind: "draft" | "server";
|
||||
isGitRepo: boolean;
|
||||
hasActiveProject: boolean;
|
||||
}): boolean {
|
||||
return input.routeKind === "draft" && input.isGitRepo && input.hasActiveProject;
|
||||
}
|
||||
|
||||
export function cloneComposerImageForRetry(
|
||||
image: ComposerImageAttachment,
|
||||
): ComposerImageAttachment {
|
||||
|
||||
@@ -298,8 +298,7 @@ import {
|
||||
resolveSendEnvMode,
|
||||
revokeBlobPreviewUrl,
|
||||
revokeUserMessagePreviewUrls,
|
||||
shouldWriteThreadErrorToCurrentServerThread,
|
||||
startNewThreadForProject,
|
||||
shouldShowComposerContextStrip,
|
||||
waitForStartedServerThread,
|
||||
} from "./ChatView.logic";
|
||||
import type { ThreadSyncPhase } from "../threadSync";
|
||||
@@ -449,14 +448,11 @@ type EnvironmentUnavailableState = {
|
||||
readonly connection: EnvironmentConnectionPresentation;
|
||||
};
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
type ThreadPlanCatalogEntry = {
|
||||
readonly id: ThreadId;
|
||||
readonly projection: OrchestrationV2ThreadProjection;
|
||||
};
|
||||
|
||||
>>>>>>> d454b3880e (Retire V1 client orchestration parity)
|
||||
function eventPathContainsSelector(event: Event, selector: string): boolean {
|
||||
const path = event.composedPath();
|
||||
if (path.length === 0 && event.target) {
|
||||
@@ -2334,15 +2330,6 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
);
|
||||
const draftTimelineEntries = useMemo(
|
||||
() =>
|
||||
<<<<<<< HEAD
|
||||
deriveTimelineEntries(
|
||||
timelineMessages,
|
||||
activeThread?.proposedPlans ?? [],
|
||||
workLogEntries,
|
||||
turnPlans,
|
||||
),
|
||||
[activeThread?.proposedPlans, timelineMessages, turnPlans, workLogEntries],
|
||||
=======
|
||||
optimisticUserMessages.map(
|
||||
(message) =>
|
||||
({
|
||||
@@ -2353,7 +2340,6 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
}) as const,
|
||||
),
|
||||
[optimisticUserMessages],
|
||||
>>>>>>> d454b3880e (Retire V1 client orchestration parity)
|
||||
);
|
||||
const timelineEntries = isServerThread ? serverTimelineEntries : draftTimelineEntries;
|
||||
const { turnDiffSummaries } = useTurnDiffSummaries(serverProjection);
|
||||
@@ -2449,9 +2435,9 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
// Default true while loading to avoid toolbar flicker.
|
||||
const isGitRepo = gitStatusQuery.data?.isRepo ?? true;
|
||||
const showComposerContextStrip = shouldShowComposerContextStrip({
|
||||
hasActiveProject: activeProject !== null,
|
||||
routeKind,
|
||||
isGitRepo,
|
||||
showEnvironmentIndicator: showComposerEnvironmentIndicator,
|
||||
hasActiveProject: activeProject !== null,
|
||||
});
|
||||
const initialDiffPanelGitScope =
|
||||
gitStatusQuery.data?.hasWorkingTreeChanges === true ? "unstaged" : "branch";
|
||||
@@ -5491,27 +5477,11 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
beginLocalDispatch({ preparingWorktree: false });
|
||||
setThreadError(threadIdForSend, null);
|
||||
|
||||
<<<<<<< HEAD
|
||||
// Position this sent row once LegendList has measured the anchored tail.
|
||||
isAtEndRef.current = true;
|
||||
timelineScrollModeRef.current = "anchoring-new-turn";
|
||||
liveFollowUserScrollGenerationRef.current = anchorUserScrollGenerationRef.current;
|
||||
setTimelineLiveFollowEnabled(true);
|
||||
pendingTimelineAnchorRef.current = messageIdForSend;
|
||||
activeTimelineAnchorIndexRef.current = null;
|
||||
showScrollDebouncer.current.cancel();
|
||||
setShowScrollToBottom(false);
|
||||
setTimelineAnchor({
|
||||
threadKey: scopedThreadKey(scopeThreadRef(activeThread.environmentId, threadIdForSend)),
|
||||
messageId: messageIdForSend,
|
||||
});
|
||||
=======
|
||||
// Scroll to the current end *before* adding the optimistic message.
|
||||
isAtEndRef.current = true;
|
||||
showScrollDebouncer.current.cancel();
|
||||
setShowScrollToBottom(false);
|
||||
await legendListRef.current?.scrollToEnd?.({ animated: false });
|
||||
>>>>>>> d454b3880e (Retire V1 client orchestration parity)
|
||||
|
||||
setOptimisticUserMessages((existing) => [
|
||||
...existing,
|
||||
@@ -5536,51 +5506,12 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
let failure: AtomCommandResult<unknown, unknown> | null =
|
||||
settingsResult._tag === "Failure" ? settingsResult : null;
|
||||
|
||||
<<<<<<< HEAD
|
||||
const startResult = await startThreadTurn({
|
||||
environmentId,
|
||||
input: {
|
||||
threadId: threadIdForSend,
|
||||
message: {
|
||||
messageId: messageIdForSend,
|
||||
role: "user",
|
||||
text: outgoingMessageText,
|
||||
attachments: [],
|
||||
},
|
||||
modelSelection: ctxSelectedModelSelection,
|
||||
titleSeed: activeThread.title,
|
||||
runtimeMode,
|
||||
interactionMode: nextInteractionMode,
|
||||
...(nextInteractionMode === "default" && activeProposedPlan
|
||||
? {
|
||||
sourceProposedPlan: {
|
||||
threadId: activeThread.id,
|
||||
planId: activeProposedPlan.id,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
createdAt: messageCreatedAt,
|
||||
},
|
||||
});
|
||||
failure = startResult._tag === "Failure" ? startResult : null;
|
||||
}
|
||||
|
||||
if (failure === null) {
|
||||
acknowledgeActiveThreadWoke();
|
||||
sendInFlightRef.current = false;
|
||||
return;
|
||||
}
|
||||
|
||||
setOptimisticUserMessages((existing) =>
|
||||
existing.filter((message) => message.id !== messageIdForSend),
|
||||
=======
|
||||
if (failure === null) {
|
||||
// Keep the mode toggle and plan-follow-up banner in sync immediately
|
||||
// while the same-thread implementation turn is starting.
|
||||
setComposerDraftInteractionMode(
|
||||
scopeThreadRef(activeThread.environmentId, threadIdForSend),
|
||||
nextInteractionMode,
|
||||
>>>>>>> d454b3880e (Retire V1 client orchestration parity)
|
||||
);
|
||||
|
||||
const startResult = await startThreadTurn({
|
||||
@@ -5622,31 +5553,6 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
}
|
||||
}
|
||||
sendInFlightRef.current = false;
|
||||
<<<<<<< HEAD
|
||||
resetLocalDispatch();
|
||||
},
|
||||
[
|
||||
activeThread,
|
||||
activeProposedPlan,
|
||||
acknowledgeActiveThreadWoke,
|
||||
beginLocalDispatch,
|
||||
isConnecting,
|
||||
isSendBusy,
|
||||
isServerThread,
|
||||
localCheckoutBranchMismatch,
|
||||
persistThreadSettingsForNextTurn,
|
||||
resetLocalDispatch,
|
||||
runtimeMode,
|
||||
setComposerDraftInteractionMode,
|
||||
setThreadError,
|
||||
startThreadTurn,
|
||||
activeThreadRef,
|
||||
autoOpenPlanSidebar,
|
||||
environmentId,
|
||||
composerRef,
|
||||
],
|
||||
);
|
||||
=======
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5663,7 +5569,6 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
sendInFlightRef.current = false;
|
||||
resetLocalDispatch();
|
||||
}
|
||||
>>>>>>> d454b3880e (Retire V1 client orchestration parity)
|
||||
|
||||
const onImplementPlanInNewThread = useCallback(async () => {
|
||||
if (
|
||||
@@ -6330,79 +6235,144 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
threadId={activeThread.id}
|
||||
/>
|
||||
) : null}
|
||||
<div className="relative z-10">
|
||||
<ChatComposer
|
||||
composerRef={composerRef}
|
||||
composerDraftTarget={composerDraftTarget}
|
||||
environmentId={environmentId}
|
||||
routeKind={routeKind}
|
||||
routeThreadRef={routeThreadRef}
|
||||
draftId={draftId}
|
||||
activeThreadId={activeThreadId}
|
||||
activeThreadEnvironmentId={activeThread?.environmentId}
|
||||
activeThread={activeThread}
|
||||
isServerThread={isServerThread}
|
||||
isLocalDraftThread={isLocalDraftThread}
|
||||
phase={phase}
|
||||
isConnecting={isConnecting}
|
||||
isSendBusy={isSendBusy}
|
||||
isPreparingWorktree={isPreparingWorktree}
|
||||
environmentUnavailable={activeEnvironmentUnavailableState}
|
||||
activePendingApproval={activePendingApproval}
|
||||
pendingApprovals={pendingApprovals}
|
||||
pendingUserInputs={pendingUserInputs}
|
||||
activePendingProgress={activePendingProgress}
|
||||
activePendingResolvedAnswers={activePendingResolvedAnswers}
|
||||
activePendingIsResponding={activePendingIsResponding}
|
||||
activePendingDraftAnswers={activePendingDraftAnswers}
|
||||
activePendingQuestionIndex={activePendingQuestionIndex}
|
||||
respondingRequestIds={respondingRequestIds}
|
||||
showPlanFollowUpPrompt={showPlanFollowUpPrompt}
|
||||
activeProposedPlan={activeProposedPlan}
|
||||
activePlan={activePlan}
|
||||
sidebarProposedPlan={sidebarProposedPlan}
|
||||
planSidebarLabel={planSidebarLabel}
|
||||
planSidebarOpen={planSidebarOpen}
|
||||
runtimeMode={runtimeMode}
|
||||
interactionMode={interactionMode}
|
||||
lockedProvider={modelPickerLockedProvider}
|
||||
providerStatuses={providerStatuses as ServerProvider[]}
|
||||
activeProjectDefaultModelSelection={activeProject?.defaultModelSelection}
|
||||
activeThreadModelSelection={activeThread?.modelSelection}
|
||||
activeThreadVisibleTurnItems={serverVisibleTurnItems}
|
||||
resolvedTheme={resolvedTheme}
|
||||
settings={settings}
|
||||
keybindings={keybindings}
|
||||
terminalOpen={Boolean(terminalUiState.terminalOpen)}
|
||||
gitCwd={gitCwd}
|
||||
promptRef={promptRef}
|
||||
composerImagesRef={composerImagesRef}
|
||||
composerTerminalContextsRef={composerTerminalContextsRef}
|
||||
composerElementContextsRef={composerElementContextsRef}
|
||||
shouldAutoScrollRef={isAtEndRef}
|
||||
scheduleStickToBottom={scrollToEnd}
|
||||
onSend={onSend}
|
||||
onInterrupt={onInterrupt}
|
||||
onImplementPlanInNewThread={onImplementPlanInNewThread}
|
||||
onRespondToApproval={onRespondToApproval}
|
||||
onSelectActivePendingUserInputOption={onSelectActivePendingUserInputOption}
|
||||
onAdvanceActivePendingUserInput={onAdvanceActivePendingUserInput}
|
||||
onPreviousActivePendingUserInputQuestion={
|
||||
onPreviousActivePendingUserInputQuestion
|
||||
}
|
||||
onChangeActivePendingUserInputCustomAnswer={
|
||||
onChangeActivePendingUserInputCustomAnswer
|
||||
}
|
||||
onProviderModelSelect={onProviderModelSelect}
|
||||
getModelDisabledReason={getModelDisabledReason}
|
||||
toggleInteractionMode={toggleInteractionMode}
|
||||
handleRuntimeModeChange={handleRuntimeModeChange}
|
||||
handleInteractionModeChange={handleInteractionModeChange}
|
||||
togglePlanSidebar={togglePlanSidebar}
|
||||
focusComposer={focusComposer}
|
||||
scheduleComposerFocus={scheduleComposerFocus}
|
||||
setThreadError={setThreadError}
|
||||
onExpandImage={onExpandTimelineImage}
|
||||
<div
|
||||
ref={draftHeroTransition.composerAnchorRef}
|
||||
className="relative z-10"
|
||||
style={
|
||||
forceExpandedMobileComposer
|
||||
? { viewTransitionName: MOBILE_COMPOSER_VIEW_TRANSITION_NAME }
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<div
|
||||
className={cn(
|
||||
"chat-composer-glass-shell relative mx-auto w-full max-w-3xl",
|
||||
showComposerContextStrip && "chat-composer-glass-shell-with-context",
|
||||
)}
|
||||
>
|
||||
<div className="chat-composer-glass-host relative z-10 w-full rounded-[22px]">
|
||||
<div className="relative z-10">
|
||||
<ChatComposer
|
||||
composerRef={composerRef}
|
||||
composerDraftTarget={composerDraftTarget}
|
||||
environmentId={environmentId}
|
||||
routeKind={routeKind}
|
||||
routeThreadRef={routeThreadRef}
|
||||
draftId={draftId}
|
||||
activeThreadId={activeThreadId}
|
||||
activeThreadEnvironmentId={activeThread?.environmentId}
|
||||
activeThread={activeThread}
|
||||
isServerThread={isServerThread}
|
||||
isLocalDraftThread={isLocalDraftThread}
|
||||
forceExpandedOnMobile={forceExpandedMobileComposer && isDraftHeroState}
|
||||
projectSelectionRequired={isLocalDraftThread && activeProject === null}
|
||||
phase={phase}
|
||||
isConnecting={isConnecting}
|
||||
isSendBusy={isSendBusy}
|
||||
isPreparingWorktree={isPreparingWorktree}
|
||||
environmentUnavailable={activeEnvironmentUnavailableState}
|
||||
activePendingApproval={activePendingApproval}
|
||||
pendingApprovals={pendingApprovals}
|
||||
pendingUserInputs={pendingUserInputs}
|
||||
activePendingProgress={activePendingProgress}
|
||||
activePendingResolvedAnswers={activePendingResolvedAnswers}
|
||||
activePendingIsResponding={activePendingIsResponding}
|
||||
activePendingDraftAnswers={activePendingDraftAnswers}
|
||||
activePendingQuestionIndex={activePendingQuestionIndex}
|
||||
respondingRequestIds={respondingRequestIds}
|
||||
showPlanFollowUpPrompt={showPlanFollowUpPrompt}
|
||||
activeProposedPlan={activeProposedPlan}
|
||||
activePlan={activePlan}
|
||||
sidebarProposedPlan={sidebarProposedPlan}
|
||||
planSidebarLabel={planSidebarLabel}
|
||||
planSidebarOpen={planSidebarOpen}
|
||||
runtimeMode={runtimeMode}
|
||||
interactionMode={interactionMode}
|
||||
lockedProvider={modelPickerLockedProvider}
|
||||
providerStatuses={providerStatuses as ServerProvider[]}
|
||||
activeProjectDefaultModelSelection={
|
||||
activeProject?.defaultModelSelection
|
||||
}
|
||||
activeThreadModelSelection={activeThread?.modelSelection}
|
||||
activeThreadVisibleTurnItems={serverVisibleTurnItems}
|
||||
resolvedTheme={resolvedTheme}
|
||||
settings={settings}
|
||||
keybindings={keybindings}
|
||||
terminalOpen={Boolean(terminalUiState.terminalOpen)}
|
||||
gitCwd={gitCwd}
|
||||
promptRef={promptRef}
|
||||
composerImagesRef={composerImagesRef}
|
||||
composerTerminalContextsRef={composerTerminalContextsRef}
|
||||
composerElementContextsRef={composerElementContextsRef}
|
||||
shouldAutoScrollRef={isAtEndRef}
|
||||
scheduleStickToBottom={scrollToEnd}
|
||||
onSend={onSend}
|
||||
onInterrupt={onInterrupt}
|
||||
onImplementPlanInNewThread={onImplementPlanInNewThread}
|
||||
onRespondToApproval={onRespondToApproval}
|
||||
onSelectActivePendingUserInputOption={
|
||||
onSelectActivePendingUserInputOption
|
||||
}
|
||||
onAdvanceActivePendingUserInput={onAdvanceActivePendingUserInput}
|
||||
onPreviousActivePendingUserInputQuestion={
|
||||
onPreviousActivePendingUserInputQuestion
|
||||
}
|
||||
onChangeActivePendingUserInputCustomAnswer={
|
||||
onChangeActivePendingUserInputCustomAnswer
|
||||
}
|
||||
onProviderModelSelect={onProviderModelSelect}
|
||||
getModelDisabledReason={getModelDisabledReason}
|
||||
toggleInteractionMode={toggleInteractionMode}
|
||||
handleRuntimeModeChange={handleRuntimeModeChange}
|
||||
handleInteractionModeChange={handleInteractionModeChange}
|
||||
togglePlanSidebar={togglePlanSidebar}
|
||||
focusComposer={focusComposer}
|
||||
scheduleComposerFocus={scheduleComposerFocus}
|
||||
setThreadError={setThreadError}
|
||||
onExpandImage={onExpandTimelineImage}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="min-h-0">
|
||||
<div
|
||||
data-terminal-open={terminalUiState.terminalOpen ? "true" : undefined}
|
||||
className="relative z-0"
|
||||
>
|
||||
{showComposerContextStrip && (
|
||||
<div className="pointer-events-auto">
|
||||
<BranchToolbar
|
||||
environmentId={activeThread.environmentId}
|
||||
threadId={activeThread.id}
|
||||
{...(routeKind === "draft" && draftId ? { draftId } : {})}
|
||||
onEnvModeChange={onEnvModeChange}
|
||||
startFromOrigin={startFromOrigin}
|
||||
onStartFromOriginChange={onStartFromOriginChange}
|
||||
{...(canOverrideServerThreadEnvMode
|
||||
? { effectiveEnvModeOverride: envMode }
|
||||
: {})}
|
||||
{...(canOverrideServerThreadEnvMode
|
||||
? {
|
||||
activeThreadBranchOverride: activeThreadBranch,
|
||||
onActiveThreadBranchOverrideChange:
|
||||
setPendingServerThreadBranch,
|
||||
}
|
||||
: {})}
|
||||
envLocked={envLocked}
|
||||
onComposerFocusRequest={scheduleComposerFocus}
|
||||
{...(canCheckoutPullRequestIntoThread
|
||||
? { onCheckoutPullRequestRequest: openPullRequestDialog }
|
||||
: {})}
|
||||
{...(hasMultipleEnvironments ? { onEnvironmentChange } : {})}
|
||||
availableEnvironments={logicalProjectEnvironments}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-hidden
|
||||
className="h-[calc(env(safe-area-inset-bottom)+1rem)] sm:h-[calc(env(safe-area-inset-bottom)+1.25rem)]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2680,7 +2680,7 @@ export const ChatComposer = memo(function ChatComposer(props: ChatComposerProps)
|
||||
<form
|
||||
ref={composerFormRef}
|
||||
onSubmit={submitComposer}
|
||||
className="chat-content-lane"
|
||||
className="mx-auto w-full min-w-0 max-w-3xl"
|
||||
data-chat-composer-form="true"
|
||||
>
|
||||
<div
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { memo } from "react";
|
||||
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
|
||||
|
||||
import { cn } from "~/lib/utils";
|
||||
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
|
||||
|
||||
interface ChatHeaderProps {
|
||||
activeThreadTitle: string;
|
||||
|
||||
+242
-3
@@ -684,6 +684,12 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
|
||||
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));
|
||||
backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
|
||||
}
|
||||
|
||||
.chat-composer-glass-shell {
|
||||
--chat-composer-glass-surface: var(--card);
|
||||
--chat-composer-outline: rgb(0 0 0 / 8%);
|
||||
@@ -692,11 +698,230 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
|
||||
isolation: isolate;
|
||||
}
|
||||
|
||||
.dark .floating-glass-surface,
|
||||
.dark .chat-composer-lower-chrome {
|
||||
.chat-composer-glass-shell::before {
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
inset: 0;
|
||||
border-radius: 22px;
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--chat-composer-glass-surface) var(--glass-opacity),
|
||||
transparent
|
||||
);
|
||||
-webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
|
||||
backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
|
||||
content: "";
|
||||
}
|
||||
|
||||
.chat-composer-glass-shell-with-context {
|
||||
--chat-composer-context-extension: 2.25rem;
|
||||
}
|
||||
|
||||
.chat-composer-glass-shell-with-context::before {
|
||||
border-radius: 0;
|
||||
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
|
||||
);
|
||||
}
|
||||
|
||||
@media (min-width: 40rem) {
|
||||
.chat-composer-glass-shell-with-context {
|
||||
--chat-composer-context-extension: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
.chat-composer-glass-host {
|
||||
position: relative;
|
||||
box-shadow: 0 12px 28px -18px rgb(0 0 0 / 40%);
|
||||
}
|
||||
|
||||
.chat-composer-glass-host::after {
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
inset: 0;
|
||||
border: 1px solid var(--chat-composer-outline);
|
||||
border-radius: inherit;
|
||||
content: "";
|
||||
}
|
||||
|
||||
.chat-composer-glass-shell-with-context .chat-composer-glass-host::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%
|
||||
);
|
||||
}
|
||||
|
||||
.chat-composer-context-strip {
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
}
|
||||
|
||||
.chat-composer-context-strip::before {
|
||||
position: absolute;
|
||||
z-index: -1;
|
||||
inset: 0;
|
||||
border: 1px solid var(--chat-composer-outline);
|
||||
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);
|
||||
--chat-composer-highlight: rgb(255 255 255 / 3%);
|
||||
}
|
||||
|
||||
.dark .chat-composer-glass-host {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.dark .chat-composer-glass-host::after {
|
||||
box-shadow: inset 0 1px var(--chat-composer-highlight);
|
||||
}
|
||||
|
||||
.dark .chat-composer-context-strip::before {
|
||||
border-color: rgb(255 255 255 / 7%);
|
||||
background:
|
||||
linear-gradient(
|
||||
to bottom,
|
||||
transparent 0 1rem,
|
||||
rgb(0 0 0 / 18%) 1rem,
|
||||
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)) {
|
||||
.chat-composer-glass-shell-with-context::before {
|
||||
inset-block-end: var(--chat-composer-context-extension);
|
||||
border-radius: 22px;
|
||||
clip-path: none;
|
||||
}
|
||||
|
||||
.chat-composer-context-strip::before {
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--chat-composer-glass-surface) var(--glass-opacity),
|
||||
transparent
|
||||
);
|
||||
-webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
|
||||
backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
|
||||
}
|
||||
|
||||
.dark .chat-composer-context-strip::before {
|
||||
background:
|
||||
linear-gradient(
|
||||
to bottom,
|
||||
transparent 0 1rem,
|
||||
rgb(0 0 0 / 18%) 1rem,
|
||||
transparent calc(1rem + 10px)
|
||||
),
|
||||
linear-gradient(rgb(255 255 255 / 2%), rgb(255 255 255 / 2%)),
|
||||
color-mix(in srgb, var(--chat-composer-glass-surface) var(--glass-opacity), transparent);
|
||||
}
|
||||
}
|
||||
|
||||
.alert-glass {
|
||||
--alert-glass-tint: transparent;
|
||||
|
||||
background:
|
||||
linear-gradient(
|
||||
color-mix(in srgb, var(--alert-glass-tint) 4%, transparent),
|
||||
color-mix(in srgb, var(--alert-glass-tint) 4%, transparent)
|
||||
),
|
||||
color-mix(in srgb, var(--background) var(--glass-opacity), transparent) !important;
|
||||
-webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
|
||||
backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
|
||||
}
|
||||
|
||||
.alert-glass[data-variant="error"] {
|
||||
--alert-glass-tint: var(--destructive);
|
||||
}
|
||||
|
||||
.alert-glass[data-variant="info"] {
|
||||
--alert-glass-tint: var(--info);
|
||||
}
|
||||
|
||||
.alert-glass[data-variant="success"] {
|
||||
--alert-glass-tint: var(--success);
|
||||
}
|
||||
|
||||
.alert-glass[data-variant="warning"] {
|
||||
--alert-glass-tint: var(--warning);
|
||||
}
|
||||
|
||||
.dropdown-glass,
|
||||
.dialog-glass {
|
||||
background: color-mix(in srgb, var(--background) var(--glass-opacity), transparent);
|
||||
-webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
|
||||
backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
|
||||
}
|
||||
|
||||
.dialog-backdrop {
|
||||
background: color-mix(in srgb, var(--background) 60%, transparent);
|
||||
-webkit-backdrop-filter: blur(4px);
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
|
||||
.dropdown-glass {
|
||||
border: 1px solid color-mix(in srgb, var(--foreground) 10%, transparent);
|
||||
box-shadow: 0 16px 40px -18px rgb(0 0 0 / 55%);
|
||||
}
|
||||
|
||||
.dialog-glass {
|
||||
border-color: color-mix(in srgb, var(--foreground) 10%, transparent);
|
||||
box-shadow: 0 24px 64px -24px rgb(0 0 0 / 65%);
|
||||
}
|
||||
|
||||
.dark .dropdown-glass {
|
||||
box-shadow: 0 18px 44px -18px rgb(0 0 0 / 80%);
|
||||
}
|
||||
|
||||
.dark .model-picker-surface.model-picker-surface {
|
||||
background: color-mix(in srgb, var(--background) var(--glass-opacity), transparent);
|
||||
}
|
||||
|
||||
.dark .dialog-glass {
|
||||
border-color: color-mix(in srgb, var(--color-white) 8%, transparent);
|
||||
box-shadow:
|
||||
inset 0 1px rgb(255 255 255 / 4%),
|
||||
0 24px 72px -20px rgb(0 0 0 / 90%);
|
||||
}
|
||||
|
||||
.dark .floating-glass-surface {
|
||||
box-shadow:
|
||||
0 18px 48px -20px rgb(0 0 0 / 60%),
|
||||
@@ -1067,7 +1292,21 @@ 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(--card);
|
||||
background: var(--background);
|
||||
}
|
||||
|
||||
.chat-composer-glass,
|
||||
.alert-glass {
|
||||
background: var(--background) !important;
|
||||
}
|
||||
|
||||
.chat-composer-glass-shell::before {
|
||||
background: var(--chat-composer-glass-surface);
|
||||
}
|
||||
|
||||
.dialog-glass,
|
||||
.dropdown-glass {
|
||||
background: var(--popover) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user