fix(web): restore v2 composer chrome
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
20a3519393
commit
a8fb548145
7 files changed
+292
-237
No files matched your search
@@ -286,7 +286,7 @@ export const BranchToolbar = memo(function BranchToolbar({
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex w-full items-center gap-2 border-t border-border/60 px-3 py-2">
|
||||
<div className="chat-composer-context-strip -mt-4 mx-auto flex w-[calc(100%-2.75rem)] max-w-[calc(48rem-2.75rem)] items-center gap-2 px-1 pt-5 pb-1">
|
||||
{isMobile ? (
|
||||
<MobileRunContextSelector
|
||||
envLocked={envLocked}
|
||||
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
reconcileRetainedMountedThreadIds,
|
||||
resolveThreadMetadataUpdateForNextTurn,
|
||||
resolveSendEnvMode,
|
||||
shouldShowComposerContextStrip,
|
||||
shouldWriteThreadErrorToCurrentServerThread,
|
||||
} from "./ChatView.logic";
|
||||
|
||||
@@ -107,6 +108,45 @@ describe("resolveThreadMetadataUpdateForNextTurn", () => {
|
||||
).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe("shouldShowComposerContextStrip", () => {
|
||||
it("shows git context on a draft with an active project", () => {
|
||||
expect(
|
||||
shouldShowComposerContextStrip({
|
||||
routeKind: "draft",
|
||||
isGitRepo: true,
|
||||
hasActiveProject: true,
|
||||
}),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
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({
|
||||
|
||||
@@ -224,6 +224,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 {
|
||||
|
||||
@@ -274,6 +274,7 @@ import {
|
||||
resolveSendEnvMode,
|
||||
revokeBlobPreviewUrl,
|
||||
revokeUserMessagePreviewUrls,
|
||||
shouldShowComposerContextStrip,
|
||||
waitForStartedServerThread,
|
||||
} from "./ChatView.logic";
|
||||
import { useLocalStorage } from "~/hooks/useLocalStorage";
|
||||
@@ -2422,6 +2423,11 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
terminalUiLaunchContext?.threadId === activeThreadId ? terminalUiLaunchContext : null;
|
||||
// Default true while loading to avoid toolbar flicker.
|
||||
const isGitRepo = gitStatusQuery.data?.isRepo ?? true;
|
||||
const showComposerContextStrip = shouldShowComposerContextStrip({
|
||||
routeKind,
|
||||
isGitRepo,
|
||||
hasActiveProject: activeProject !== null,
|
||||
});
|
||||
const initialDiffPanelGitScope =
|
||||
gitStatusQuery.data?.hasWorkingTreeChanges === true ? "unstaged" : "branch";
|
||||
const diffPanelGitStatusResolutionKey = gitStatusQuery.data ? "resolved" : "pending";
|
||||
@@ -5751,25 +5757,8 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
? panelLayoutControls
|
||||
: null}
|
||||
<ChatHeader
|
||||
activeThreadEnvironmentId={activeThread.environmentId}
|
||||
activeThreadId={activeThread.id}
|
||||
{...(routeKind === "draft" && draftId ? { draftId } : {})}
|
||||
activeThreadTitle={activeThread.title}
|
||||
activeProjectName={activeProject?.title}
|
||||
activeProjectCwd={activeProject?.workspaceRoot ?? null}
|
||||
openInCwd={gitCwd}
|
||||
activeProjectScripts={activeProject?.scripts}
|
||||
preferredScriptId={
|
||||
activeProject ? (lastInvokedScriptByProjectId[activeProject.id] ?? null) : null
|
||||
}
|
||||
keybindings={keybindings}
|
||||
availableEditors={availableEditors}
|
||||
rightPanelOpen={rightPanelOpen}
|
||||
gitCwd={gitCwd}
|
||||
onRunProjectScript={runProjectScript}
|
||||
onAddProjectScript={saveProjectScript}
|
||||
onUpdateProjectScript={updateProjectScript}
|
||||
onDeleteProjectScript={deleteProjectScript}
|
||||
rightPanelOpen={inlineRightPanelOwnsTitleBar}
|
||||
/>
|
||||
</header>
|
||||
|
||||
@@ -5899,92 +5888,101 @@ function ChatViewContent(props: ChatViewProps) {
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
<div className="chat-composer-glass-host mx-auto w-full max-w-3xl 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
|
||||
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"
|
||||
>
|
||||
{isGitRepo && (
|
||||
{showComposerContextStrip && (
|
||||
<div className="pointer-events-auto">
|
||||
<BranchToolbar
|
||||
environmentId={activeThread.environmentId}
|
||||
|
||||
@@ -2246,7 +2246,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,111 +1,25 @@
|
||||
import { scopeThreadRef } from "@t3tools/client-runtime/environment";
|
||||
import type {
|
||||
EditorId,
|
||||
EnvironmentId,
|
||||
ProjectScript,
|
||||
ResolvedKeybindingsConfig,
|
||||
ThreadId,
|
||||
} from "@t3tools/contracts";
|
||||
import { memo } from "react";
|
||||
|
||||
import type { DraftId } from "~/composerDraftStore";
|
||||
import { useT3ProjectFileScripts } from "~/hooks/useT3ProjectFileScripts";
|
||||
import { cn } from "~/lib/utils";
|
||||
import { usePrimaryEnvironmentId } from "../../state/environments";
|
||||
import GitActionsControl from "../GitActionsControl";
|
||||
import { ProjectFavicon } from "../ProjectFavicon";
|
||||
import ProjectScriptsControl, {
|
||||
type NewProjectScriptInput,
|
||||
type ProjectScriptActionResult,
|
||||
} from "../ProjectScriptsControl";
|
||||
import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip";
|
||||
import { OpenInPicker } from "./OpenInPicker";
|
||||
|
||||
interface ChatHeaderProps {
|
||||
activeThreadEnvironmentId: EnvironmentId;
|
||||
activeThreadId: ThreadId;
|
||||
draftId?: DraftId;
|
||||
activeThreadTitle: string;
|
||||
activeProjectName: string | undefined;
|
||||
activeProjectCwd: string | null;
|
||||
openInCwd: string | null;
|
||||
activeProjectScripts: ReadonlyArray<ProjectScript> | undefined;
|
||||
preferredScriptId: string | null;
|
||||
keybindings: ResolvedKeybindingsConfig;
|
||||
availableEditors: ReadonlyArray<EditorId>;
|
||||
rightPanelOpen: boolean;
|
||||
gitCwd: string | null;
|
||||
onRunProjectScript: (script: ProjectScript) => void;
|
||||
onAddProjectScript: (input: NewProjectScriptInput) => Promise<ProjectScriptActionResult>;
|
||||
onUpdateProjectScript: (
|
||||
scriptId: string,
|
||||
input: NewProjectScriptInput,
|
||||
) => Promise<ProjectScriptActionResult>;
|
||||
onDeleteProjectScript: (scriptId: string) => Promise<ProjectScriptActionResult>;
|
||||
}
|
||||
|
||||
export function shouldShowOpenInPicker(input: {
|
||||
readonly activeProjectName: string | undefined;
|
||||
readonly activeThreadEnvironmentId: EnvironmentId;
|
||||
readonly primaryEnvironmentId: EnvironmentId | null;
|
||||
}): boolean {
|
||||
return (
|
||||
Boolean(input.activeProjectName) &&
|
||||
input.primaryEnvironmentId !== null &&
|
||||
input.activeThreadEnvironmentId === input.primaryEnvironmentId
|
||||
);
|
||||
}
|
||||
|
||||
export const ChatHeader = memo(function ChatHeader({
|
||||
activeThreadEnvironmentId,
|
||||
activeThreadId,
|
||||
draftId,
|
||||
activeThreadTitle,
|
||||
activeProjectName,
|
||||
activeProjectCwd,
|
||||
openInCwd,
|
||||
activeProjectScripts,
|
||||
preferredScriptId,
|
||||
keybindings,
|
||||
availableEditors,
|
||||
rightPanelOpen,
|
||||
gitCwd,
|
||||
onRunProjectScript,
|
||||
onAddProjectScript,
|
||||
onUpdateProjectScript,
|
||||
onDeleteProjectScript,
|
||||
}: ChatHeaderProps) {
|
||||
const primaryEnvironmentId = usePrimaryEnvironmentId();
|
||||
const fileScripts = useT3ProjectFileScripts(
|
||||
activeThreadEnvironmentId,
|
||||
activeProjectScripts ? activeProjectCwd : null,
|
||||
);
|
||||
const showOpenInPicker = shouldShowOpenInPicker({
|
||||
activeProjectName,
|
||||
activeThreadEnvironmentId,
|
||||
primaryEnvironmentId,
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="@container/header-actions flex min-w-0 flex-1 items-center gap-2 sm:gap-3">
|
||||
<div
|
||||
className={cn(
|
||||
"flex min-w-0 flex-1 items-center gap-2 sm:gap-3",
|
||||
rightPanelOpen ? "pr-10" : "pr-24",
|
||||
)}
|
||||
>
|
||||
<div className="flex min-w-0 flex-1 items-center gap-2 overflow-hidden sm:gap-3">
|
||||
{activeProjectName ? (
|
||||
<span className="inline-flex shrink-0 items-center gap-2">
|
||||
<span className="inline-flex min-w-0 items-center gap-1.5">
|
||||
<ProjectFavicon
|
||||
environmentId={activeThreadEnvironmentId}
|
||||
cwd={activeProjectCwd ?? ""}
|
||||
className="size-3.5"
|
||||
/>
|
||||
<span className="max-w-40 truncate text-sm font-medium text-muted-foreground">
|
||||
{activeProjectName}
|
||||
</span>
|
||||
</span>
|
||||
<span aria-hidden className="text-muted-foreground/40">
|
||||
/
|
||||
</span>
|
||||
</span>
|
||||
) : null}
|
||||
<Tooltip>
|
||||
<TooltipTrigger
|
||||
render={
|
||||
@@ -120,41 +34,6 @@ export const ChatHeader = memo(function ChatHeader({
|
||||
<TooltipPopup side="top">{activeThreadTitle}</TooltipPopup>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div
|
||||
data-chat-header-actions
|
||||
className={cn(
|
||||
"flex shrink-0 items-center justify-end gap-2 @3xl/header-actions:gap-3",
|
||||
rightPanelOpen ? "pr-0" : "pr-16",
|
||||
)}
|
||||
>
|
||||
{activeProjectScripts ? (
|
||||
<ProjectScriptsControl
|
||||
scripts={activeProjectScripts}
|
||||
fileScripts={fileScripts}
|
||||
keybindings={keybindings}
|
||||
preferredScriptId={preferredScriptId}
|
||||
onRunScript={onRunProjectScript}
|
||||
onAddScript={onAddProjectScript}
|
||||
onUpdateScript={onUpdateProjectScript}
|
||||
onDeleteScript={onDeleteProjectScript}
|
||||
/>
|
||||
) : null}
|
||||
{showOpenInPicker ? (
|
||||
<OpenInPicker
|
||||
environmentId={activeThreadEnvironmentId}
|
||||
keybindings={keybindings}
|
||||
availableEditors={availableEditors}
|
||||
openInCwd={openInCwd}
|
||||
/>
|
||||
) : null}
|
||||
{activeProjectName ? (
|
||||
<GitActionsControl
|
||||
gitCwd={gitCwd}
|
||||
activeThreadRef={scopeThreadRef(activeThreadEnvironmentId, activeThreadId)}
|
||||
{...(draftId ? { draftId } : {})}
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
+140
-10
@@ -419,21 +419,20 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
|
||||
backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
|
||||
}
|
||||
|
||||
.chat-composer-glass-host {
|
||||
.chat-composer-glass-shell {
|
||||
--chat-composer-glass-surface: var(--card);
|
||||
--chat-composer-outline: rgb(0 0 0 / 8%);
|
||||
|
||||
position: relative;
|
||||
box-shadow:
|
||||
0 0 0 1px rgb(0 0 0 / 8%),
|
||||
0 12px 28px -18px rgb(0 0 0 / 40%);
|
||||
isolation: isolate;
|
||||
}
|
||||
|
||||
.chat-composer-glass-host::before {
|
||||
.chat-composer-glass-shell::before {
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
z-index: 0;
|
||||
inset: 0;
|
||||
border-radius: inherit;
|
||||
border-radius: 22px;
|
||||
background: color-mix(
|
||||
in srgb,
|
||||
var(--chat-composer-glass-surface) var(--glass-opacity),
|
||||
@@ -444,14 +443,145 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
|
||||
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-host {
|
||||
--chat-composer-glass-surface: color-mix(in srgb, var(--background) 84%, var(--color-white));
|
||||
.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%);
|
||||
}
|
||||
|
||||
box-shadow: 0 0 0 1px rgb(255 255 255 / 10%);
|
||||
.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 {
|
||||
@@ -689,7 +819,7 @@ html[data-mobile-composer-route-transition="true"]::view-transition-old(t3-mobil
|
||||
background: var(--background) !important;
|
||||
}
|
||||
|
||||
.chat-composer-glass-host::before {
|
||||
.chat-composer-glass-shell::before {
|
||||
background: var(--chat-composer-glass-surface);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user