fix(web): respect iOS safe areas across mobile chrome & other mobile layout fixes (#2392)
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
13 files changed
+277
-65
No files matched your search
+4
-1
@@ -2,7 +2,10 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, viewport-fit=cover, interactive-widget=resizes-content"
|
||||
/>
|
||||
<meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)" />
|
||||
<meta name="theme-color" content="#161616" media="(prefers-color-scheme: dark)" />
|
||||
<meta name="theme-color" content="#161616" />
|
||||
|
||||
@@ -54,7 +54,7 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
|
||||
}, [navigate]);
|
||||
|
||||
return (
|
||||
<SidebarProvider defaultOpen>
|
||||
<SidebarProvider className="h-dvh! min-h-0!" defaultOpen>
|
||||
<Sidebar
|
||||
side="left"
|
||||
collapsible="offcanvas"
|
||||
|
||||
@@ -1,18 +1,41 @@
|
||||
import { scopeProjectRef, scopeThreadRef } from "@t3tools/client-runtime";
|
||||
import type { EnvironmentId, ThreadId } from "@t3tools/contracts";
|
||||
import {
|
||||
ChevronDownIcon,
|
||||
CloudIcon,
|
||||
FolderGit2Icon,
|
||||
FolderGitIcon,
|
||||
FolderIcon,
|
||||
MonitorIcon,
|
||||
} from "lucide-react";
|
||||
import { memo, useMemo } from "react";
|
||||
|
||||
import { useComposerDraftStore, type DraftId } from "../composerDraftStore";
|
||||
import { useIsMobile } from "../hooks/useMediaQuery";
|
||||
import { useStore } from "../store";
|
||||
import { createProjectSelectorByRef, createThreadSelectorByRef } from "../storeSelectors";
|
||||
import {
|
||||
type EnvMode,
|
||||
type EnvironmentOption,
|
||||
resolveCurrentWorkspaceLabel,
|
||||
resolveEnvModeLabel,
|
||||
resolveEffectiveEnvMode,
|
||||
resolveLockedWorkspaceLabel,
|
||||
} from "./BranchToolbar.logic";
|
||||
import { BranchToolbarBranchSelector } from "./BranchToolbarBranchSelector";
|
||||
import { BranchToolbarEnvironmentSelector } from "./BranchToolbarEnvironmentSelector";
|
||||
import { BranchToolbarEnvModeSelector } from "./BranchToolbarEnvModeSelector";
|
||||
import { Button } from "./ui/button";
|
||||
import {
|
||||
Menu,
|
||||
MenuGroup,
|
||||
MenuGroupLabel,
|
||||
MenuPopup,
|
||||
MenuRadioGroup,
|
||||
MenuRadioItem,
|
||||
MenuSeparator,
|
||||
MenuTrigger,
|
||||
} from "./ui/menu";
|
||||
import { Separator } from "./ui/separator";
|
||||
|
||||
interface BranchToolbarProps {
|
||||
@@ -30,6 +53,126 @@ interface BranchToolbarProps {
|
||||
onEnvironmentChange?: (environmentId: EnvironmentId) => void;
|
||||
}
|
||||
|
||||
interface MobileRunContextSelectorProps {
|
||||
envLocked: boolean;
|
||||
envModeLocked: boolean;
|
||||
environmentId: EnvironmentId;
|
||||
availableEnvironments: readonly EnvironmentOption[] | undefined;
|
||||
showEnvironmentPicker: boolean;
|
||||
onEnvironmentChange: ((environmentId: EnvironmentId) => void) | undefined;
|
||||
effectiveEnvMode: EnvMode;
|
||||
activeWorktreePath: string | null;
|
||||
onEnvModeChange: (mode: EnvMode) => void;
|
||||
}
|
||||
|
||||
const MobileRunContextSelector = memo(function MobileRunContextSelector({
|
||||
envLocked,
|
||||
envModeLocked,
|
||||
environmentId,
|
||||
availableEnvironments,
|
||||
showEnvironmentPicker,
|
||||
onEnvironmentChange,
|
||||
effectiveEnvMode,
|
||||
activeWorktreePath,
|
||||
onEnvModeChange,
|
||||
}: MobileRunContextSelectorProps) {
|
||||
const activeEnvironment = useMemo(
|
||||
() => availableEnvironments?.find((env) => env.environmentId === environmentId) ?? null,
|
||||
[availableEnvironments, environmentId],
|
||||
);
|
||||
const environmentLabel = activeEnvironment?.label ?? "Run on";
|
||||
const EnvironmentIcon = activeEnvironment?.isPrimary ? MonitorIcon : CloudIcon;
|
||||
const WorkspaceIcon =
|
||||
effectiveEnvMode === "worktree"
|
||||
? FolderGit2Icon
|
||||
: activeWorktreePath
|
||||
? FolderGitIcon
|
||||
: FolderIcon;
|
||||
const workspaceLabel = envModeLocked
|
||||
? resolveLockedWorkspaceLabel(activeWorktreePath)
|
||||
: effectiveEnvMode === "worktree"
|
||||
? resolveEnvModeLabel("worktree")
|
||||
: resolveCurrentWorkspaceLabel(activeWorktreePath);
|
||||
|
||||
return (
|
||||
<Menu>
|
||||
<MenuTrigger
|
||||
render={<Button variant="ghost" size="xs" />}
|
||||
className="min-w-0 max-w-[48%] flex-1 justify-start text-muted-foreground/70 hover:text-foreground/80 md:hidden"
|
||||
>
|
||||
{showEnvironmentPicker ? (
|
||||
<>
|
||||
<EnvironmentIcon className="size-3 shrink-0" />
|
||||
<span className="min-w-0 truncate">{environmentLabel}</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<WorkspaceIcon className="size-3 shrink-0" />
|
||||
<span className="min-w-0 truncate">{workspaceLabel}</span>
|
||||
</>
|
||||
)}
|
||||
<ChevronDownIcon className="size-3 shrink-0 opacity-50" />
|
||||
</MenuTrigger>
|
||||
<MenuPopup align="start" side="top" className="w-64">
|
||||
{showEnvironmentPicker && availableEnvironments && onEnvironmentChange ? (
|
||||
<>
|
||||
<MenuGroup>
|
||||
<MenuGroupLabel>Run on</MenuGroupLabel>
|
||||
<MenuRadioGroup
|
||||
value={environmentId}
|
||||
onValueChange={(value) => onEnvironmentChange(value as EnvironmentId)}
|
||||
>
|
||||
{availableEnvironments.map((env) => {
|
||||
const Icon = env.isPrimary ? MonitorIcon : CloudIcon;
|
||||
return (
|
||||
<MenuRadioItem
|
||||
key={env.environmentId}
|
||||
disabled={envLocked}
|
||||
value={env.environmentId}
|
||||
>
|
||||
<span className="flex min-w-0 items-center gap-1.5">
|
||||
<Icon className="size-3" />
|
||||
<span className="min-w-0 truncate">{env.label}</span>
|
||||
</span>
|
||||
</MenuRadioItem>
|
||||
);
|
||||
})}
|
||||
</MenuRadioGroup>
|
||||
</MenuGroup>
|
||||
<MenuSeparator />
|
||||
</>
|
||||
) : null}
|
||||
<MenuGroup>
|
||||
<MenuGroupLabel>Workspace</MenuGroupLabel>
|
||||
<MenuRadioGroup
|
||||
value={effectiveEnvMode}
|
||||
onValueChange={(value) => onEnvModeChange(value as EnvMode)}
|
||||
>
|
||||
<MenuRadioItem disabled={envModeLocked} value="local">
|
||||
<span className="flex min-w-0 items-center gap-1.5">
|
||||
{activeWorktreePath ? (
|
||||
<FolderGitIcon className="size-3" />
|
||||
) : (
|
||||
<FolderIcon className="size-3" />
|
||||
)}
|
||||
<span className="min-w-0 truncate">
|
||||
{resolveCurrentWorkspaceLabel(activeWorktreePath)}
|
||||
</span>
|
||||
</span>
|
||||
</MenuRadioItem>
|
||||
<MenuRadioItem disabled={envModeLocked} value="worktree">
|
||||
<span className="flex min-w-0 items-center gap-1.5">
|
||||
<FolderGit2Icon className="size-3" />
|
||||
<span className="min-w-0 truncate">{resolveEnvModeLabel("worktree")}</span>
|
||||
</span>
|
||||
</MenuRadioItem>
|
||||
</MenuRadioGroup>
|
||||
</MenuGroup>
|
||||
</MenuPopup>
|
||||
</Menu>
|
||||
);
|
||||
});
|
||||
|
||||
export const BranchToolbar = memo(function BranchToolbar({
|
||||
environmentId,
|
||||
threadId,
|
||||
@@ -74,34 +217,51 @@ export const BranchToolbar = memo(function BranchToolbar({
|
||||
});
|
||||
const envModeLocked = envLocked || (serverThread !== undefined && activeWorktreePath !== null);
|
||||
|
||||
const showEnvironmentPicker =
|
||||
availableEnvironments && availableEnvironments.length > 1 && onEnvironmentChange;
|
||||
const showEnvironmentPicker = Boolean(
|
||||
availableEnvironments && availableEnvironments.length > 1 && onEnvironmentChange,
|
||||
);
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
if (!hasActiveThread || !activeProject) return null;
|
||||
|
||||
return (
|
||||
<div className="mx-auto flex w-full max-w-208 items-center justify-between px-2.5 pb-3 pt-1 sm:px-3">
|
||||
<div className="flex items-center gap-1">
|
||||
{showEnvironmentPicker && (
|
||||
<>
|
||||
<BranchToolbarEnvironmentSelector
|
||||
envLocked={envLocked}
|
||||
environmentId={environmentId}
|
||||
availableEnvironments={availableEnvironments}
|
||||
onEnvironmentChange={onEnvironmentChange}
|
||||
/>
|
||||
<Separator orientation="vertical" className="mx-0.5 h-3.5!" />
|
||||
</>
|
||||
)}
|
||||
<BranchToolbarEnvModeSelector
|
||||
envLocked={envModeLocked}
|
||||
<div className="mx-auto flex w-full max-w-208 items-center gap-2 px-2.5 pb-3 pt-1 sm:px-3">
|
||||
{isMobile ? (
|
||||
<MobileRunContextSelector
|
||||
envLocked={envLocked}
|
||||
envModeLocked={envModeLocked}
|
||||
environmentId={environmentId}
|
||||
availableEnvironments={availableEnvironments}
|
||||
showEnvironmentPicker={showEnvironmentPicker}
|
||||
onEnvironmentChange={onEnvironmentChange}
|
||||
effectiveEnvMode={effectiveEnvMode}
|
||||
activeWorktreePath={activeWorktreePath}
|
||||
onEnvModeChange={onEnvModeChange}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex min-w-0 shrink-0 items-center gap-1">
|
||||
{showEnvironmentPicker && availableEnvironments && onEnvironmentChange && (
|
||||
<>
|
||||
<BranchToolbarEnvironmentSelector
|
||||
envLocked={envLocked}
|
||||
environmentId={environmentId}
|
||||
availableEnvironments={availableEnvironments}
|
||||
onEnvironmentChange={onEnvironmentChange}
|
||||
/>
|
||||
<Separator orientation="vertical" className="mx-0.5 h-3.5!" />
|
||||
</>
|
||||
)}
|
||||
<BranchToolbarEnvModeSelector
|
||||
envLocked={envModeLocked}
|
||||
effectiveEnvMode={effectiveEnvMode}
|
||||
activeWorktreePath={activeWorktreePath}
|
||||
onEnvModeChange={onEnvModeChange}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<BranchToolbarBranchSelector
|
||||
className="min-w-0 flex-1 justify-end md:ml-auto md:flex-none"
|
||||
environmentId={environmentId}
|
||||
threadId={threadId}
|
||||
{...(draftId ? { draftId } : {})}
|
||||
|
||||
@@ -19,6 +19,7 @@ import { readEnvironmentApi } from "../environmentApi";
|
||||
import { gitBranchSearchInfiniteQueryOptions, gitQueryKeys } from "../lib/gitReactQuery";
|
||||
import { useGitStatus } from "../lib/gitStatusState";
|
||||
import { newCommandId } from "../lib/utils";
|
||||
import { cn } from "../lib/utils";
|
||||
import { parsePullRequestReference } from "../pullRequestReference";
|
||||
import { useStore } from "../store";
|
||||
import { createProjectSelectorByRef, createThreadSelectorByRef } from "../storeSelectors";
|
||||
@@ -45,6 +46,7 @@ import {
|
||||
import { stackedThreadToast, toastManager } from "./ui/toast";
|
||||
|
||||
interface BranchToolbarBranchSelectorProps {
|
||||
className?: string;
|
||||
environmentId: EnvironmentId;
|
||||
threadId: ThreadId;
|
||||
draftId?: DraftId;
|
||||
@@ -76,6 +78,7 @@ function getBranchTriggerLabel(input: {
|
||||
}
|
||||
|
||||
export function BranchToolbarBranchSelector({
|
||||
className,
|
||||
environmentId,
|
||||
threadId,
|
||||
draftId,
|
||||
@@ -577,11 +580,11 @@ export function BranchToolbarBranchSelector({
|
||||
>
|
||||
<ComboboxTrigger
|
||||
render={<Button variant="ghost" size="xs" />}
|
||||
className="text-muted-foreground/70 hover:text-foreground/80"
|
||||
className={cn("min-w-0 text-muted-foreground/70 hover:text-foreground/80", className)}
|
||||
disabled={(isBranchesSearchPending && branches.length === 0) || isBranchActionPending}
|
||||
>
|
||||
<span className="max-w-[240px] truncate">{triggerLabel}</span>
|
||||
<ChevronDownIcon />
|
||||
<span className="min-w-0 max-w-[240px] truncate">{triggerLabel}</span>
|
||||
<ChevronDownIcon className="shrink-0" />
|
||||
</ComboboxTrigger>
|
||||
<ComboboxPopup align="end" side="top" className="w-80">
|
||||
<div className="border-b p-1">
|
||||
|
||||
@@ -58,6 +58,7 @@ export const BranchToolbarEnvModeSelector = memo(function BranchToolbarEnvModeSe
|
||||
|
||||
return (
|
||||
<Select
|
||||
modal={false}
|
||||
value={effectiveEnvMode}
|
||||
onValueChange={(value) => onEnvModeChange(value as EnvMode)}
|
||||
items={envModeItems}
|
||||
|
||||
@@ -54,6 +54,7 @@ export const BranchToolbarEnvironmentSelector = memo(function BranchToolbarEnvir
|
||||
|
||||
return (
|
||||
<Select
|
||||
modal={false}
|
||||
value={environmentId}
|
||||
onValueChange={(value) => onEnvironmentChange(value as EnvironmentId)}
|
||||
items={environmentItems}
|
||||
|
||||
@@ -3281,14 +3281,14 @@ export default function ChatView(props: ChatViewProps) {
|
||||
{/* Top bar */}
|
||||
<header
|
||||
className={cn(
|
||||
"border-b border-border px-3 sm:px-5",
|
||||
"border-b border-border",
|
||||
isElectron
|
||||
? cn(
|
||||
"drag-region flex h-[52px] items-center wco:h-[env(titlebar-area-height)]",
|
||||
"drag-region flex h-[52px] items-center px-3 sm:px-5 wco:h-[env(titlebar-area-height)]",
|
||||
reserveTitleBarControlInset &&
|
||||
"wco:pr-[calc(100vw-env(titlebar-area-width)-env(titlebar-area-x)+1em)]",
|
||||
)
|
||||
: "py-2 sm:py-3",
|
||||
: "pb-2 pl-[calc(env(safe-area-inset-left)+0.75rem)] pr-[calc(env(safe-area-inset-right)+0.75rem)] pt-2 sm:pb-3 sm:pl-[calc(env(safe-area-inset-left)+1.25rem)] sm:pr-[calc(env(safe-area-inset-right)+1.25rem)] sm:pt-3",
|
||||
)}
|
||||
>
|
||||
<ChatHeader
|
||||
@@ -3374,7 +3374,14 @@ export default function ChatView(props: ChatViewProps) {
|
||||
</div>
|
||||
|
||||
{/* Input bar */}
|
||||
<div className={cn("px-3 pt-1.5 sm:px-5 sm:pt-2", isGitRepo ? "pb-1" : "pb-3 sm:pb-4")}>
|
||||
<div
|
||||
className={cn(
|
||||
"pl-[calc(env(safe-area-inset-left)+0.75rem)] pr-[calc(env(safe-area-inset-right)+0.75rem)] pt-1.5 sm:pl-[calc(env(safe-area-inset-left)+1.25rem)] sm:pr-[calc(env(safe-area-inset-right)+1.25rem)] sm:pt-2",
|
||||
isGitRepo
|
||||
? "pb-[calc(env(safe-area-inset-bottom)+0.25rem)]"
|
||||
: "pb-[calc(env(safe-area-inset-bottom)+0.75rem)] sm:pb-[calc(env(safe-area-inset-bottom)+1rem)]",
|
||||
)}
|
||||
>
|
||||
<ChatComposer
|
||||
ref={composerRef}
|
||||
composerDraftTarget={composerDraftTarget}
|
||||
@@ -3443,34 +3450,34 @@ export default function ChatView(props: ChatViewProps) {
|
||||
setThreadError={setThreadError}
|
||||
onExpandImage={onExpandTimelineImage}
|
||||
/>
|
||||
{isGitRepo && (
|
||||
<BranchToolbar
|
||||
environmentId={activeThread.environmentId}
|
||||
threadId={activeThread.id}
|
||||
{...(routeKind === "draft" && draftId ? { draftId } : {})}
|
||||
onEnvModeChange={onEnvModeChange}
|
||||
{...(canOverrideServerThreadEnvMode ? { effectiveEnvModeOverride: envMode } : {})}
|
||||
{...(canOverrideServerThreadEnvMode
|
||||
? {
|
||||
activeThreadBranchOverride: activeThreadBranch,
|
||||
onActiveThreadBranchOverrideChange: setPendingServerThreadBranch,
|
||||
}
|
||||
: {})}
|
||||
envLocked={envLocked}
|
||||
onComposerFocusRequest={scheduleComposerFocus}
|
||||
{...(canCheckoutPullRequestIntoThread
|
||||
? { onCheckoutPullRequestRequest: openPullRequestDialog }
|
||||
: {})}
|
||||
{...(hasMultipleEnvironments
|
||||
? {
|
||||
availableEnvironments: logicalProjectEnvironments,
|
||||
onEnvironmentChange,
|
||||
}
|
||||
: {})}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{isGitRepo && (
|
||||
<BranchToolbar
|
||||
environmentId={activeThread.environmentId}
|
||||
threadId={activeThread.id}
|
||||
{...(routeKind === "draft" && draftId ? { draftId } : {})}
|
||||
onEnvModeChange={onEnvModeChange}
|
||||
{...(canOverrideServerThreadEnvMode ? { effectiveEnvModeOverride: envMode } : {})}
|
||||
{...(canOverrideServerThreadEnvMode
|
||||
? {
|
||||
activeThreadBranchOverride: activeThreadBranch,
|
||||
onActiveThreadBranchOverrideChange: setPendingServerThreadBranch,
|
||||
}
|
||||
: {})}
|
||||
envLocked={envLocked}
|
||||
onComposerFocusRequest={scheduleComposerFocus}
|
||||
{...(canCheckoutPullRequestIntoThread
|
||||
? { onCheckoutPullRequestRequest: openPullRequestDialog }
|
||||
: {})}
|
||||
{...(hasMultipleEnvironments
|
||||
? {
|
||||
availableEnvironments: logicalProjectEnvironments,
|
||||
onEnvironmentChange,
|
||||
}
|
||||
: {})}
|
||||
/>
|
||||
)}
|
||||
{pullRequestDialogState ? (
|
||||
<PullRequestThreadDialog
|
||||
key={pullRequestDialogState.key}
|
||||
|
||||
@@ -1490,7 +1490,7 @@ function ComposerPromptEditorInner({
|
||||
const rootElement = editor.getRootElement();
|
||||
if (!rootElement) return;
|
||||
const boundedCursor = clampCollapsedComposerCursor(snapshotRef.current.value, nextCursor);
|
||||
rootElement.focus();
|
||||
rootElement.focus({ preventScroll: true });
|
||||
editor.update(() => {
|
||||
$setSelectionAtComposerOffset(boundedCursor);
|
||||
});
|
||||
@@ -1621,7 +1621,7 @@ function ComposerPromptEditorInner({
|
||||
contentEditable={
|
||||
<ContentEditable
|
||||
className={cn(
|
||||
"block max-h-[200px] min-h-17.5 w-full overflow-y-auto whitespace-pre-wrap wrap-break-word bg-transparent text-base sm:text-[14px] leading-relaxed text-foreground focus:outline-none",
|
||||
"block max-h-[200px] min-h-17.5 w-full overflow-y-auto whitespace-pre-wrap wrap-break-word bg-transparent text-[16px] leading-relaxed text-foreground focus:outline-none sm:text-[14px]",
|
||||
className,
|
||||
)}
|
||||
data-testid="composer-editor"
|
||||
@@ -1632,7 +1632,7 @@ function ComposerPromptEditorInner({
|
||||
}
|
||||
placeholder={
|
||||
terminalContexts.length > 0 ? null : (
|
||||
<div className="pointer-events-none absolute inset-0 text-base sm:text-[14px] leading-relaxed text-muted-foreground/35">
|
||||
<div className="pointer-events-none absolute inset-0 text-[16px] leading-relaxed text-muted-foreground/35 sm:text-[14px]">
|
||||
{placeholder}
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -16,6 +16,7 @@ import ProjectScriptsControl, { type NewProjectScriptInput } from "../ProjectScr
|
||||
import { Toggle } from "../ui/toggle";
|
||||
import { SidebarTrigger } from "../ui/sidebar";
|
||||
import { OpenInPicker } from "./OpenInPicker";
|
||||
import { usePrimaryEnvironmentId } from "../../environments/primary";
|
||||
|
||||
interface ChatHeaderProps {
|
||||
activeThreadEnvironmentId: EnvironmentId;
|
||||
@@ -68,6 +69,10 @@ export const ChatHeader = memo(function ChatHeader({
|
||||
onToggleTerminal,
|
||||
onToggleDiff,
|
||||
}: ChatHeaderProps) {
|
||||
const primaryEnvironmentId = usePrimaryEnvironmentId();
|
||||
const isRemoteEnvironment =
|
||||
primaryEnvironmentId !== null && activeThreadEnvironmentId !== primaryEnvironmentId;
|
||||
|
||||
return (
|
||||
<div className="@container/header-actions flex min-w-0 flex-1 items-center gap-2">
|
||||
<div className="flex min-w-0 flex-1 items-center gap-2 overflow-hidden sm:gap-3">
|
||||
@@ -101,7 +106,7 @@ export const ChatHeader = memo(function ChatHeader({
|
||||
onDeleteScript={onDeleteProjectScript}
|
||||
/>
|
||||
)}
|
||||
{activeProjectName && (
|
||||
{activeProjectName && !isRemoteEnvironment && (
|
||||
<OpenInPicker
|
||||
keybindings={keybindings}
|
||||
availableEditors={availableEditors}
|
||||
|
||||
@@ -245,7 +245,14 @@ function Sidebar({
|
||||
<SheetTitle>Sidebar</SheetTitle>
|
||||
<SheetDescription>Displays the mobile sidebar.</SheetDescription>
|
||||
</SheetHeader>
|
||||
<div className="flex h-full w-full flex-col">{children}</div>
|
||||
<div
|
||||
className={cn(
|
||||
"flex h-full w-full flex-col pb-safe pt-safe",
|
||||
side === "left" ? "pl-safe" : "pr-safe",
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
</SheetPopup>
|
||||
</Sheet>
|
||||
</SidebarInstanceContext.Provider>
|
||||
|
||||
+28
-3
@@ -58,6 +58,22 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* Safe-area inset utilities for surfaces that opt into edge-to-edge rendering.
|
||||
Insets resolve to 0 when the browser already constrains the layout viewport
|
||||
to the safe area. */
|
||||
@utility pt-safe {
|
||||
padding-top: max(env(safe-area-inset-top), 0px);
|
||||
}
|
||||
@utility pb-safe {
|
||||
padding-bottom: max(env(safe-area-inset-bottom), 0px);
|
||||
}
|
||||
@utility pl-safe {
|
||||
padding-left: max(env(safe-area-inset-left), 0px);
|
||||
}
|
||||
@utility pr-safe {
|
||||
padding-right: max(env(safe-area-inset-right), 0px);
|
||||
}
|
||||
|
||||
/* Suppress all transitions during theme changes */
|
||||
.no-transitions,
|
||||
.no-transitions *,
|
||||
@@ -138,19 +154,28 @@ body {
|
||||
sans-serif;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
body {
|
||||
min-height: calc(100svh + env(safe-area-inset-top));
|
||||
overscroll-behavior: none;
|
||||
}
|
||||
|
||||
body {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#root {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
overflow-y: hidden;
|
||||
overflow-x: hidden;
|
||||
overflow-x: clip;
|
||||
overflow-y: hidden;
|
||||
overscroll-behavior-y: none;
|
||||
padding-top: max(env(safe-area-inset-top), 0px);
|
||||
}
|
||||
|
||||
body::after {
|
||||
|
||||
@@ -240,7 +240,7 @@ function ChatThreadRouteView() {
|
||||
if (!shouldUseDiffSheet) {
|
||||
return (
|
||||
<>
|
||||
<SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
|
||||
<SidebarInset className="h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh">
|
||||
<ChatView
|
||||
environmentId={threadRef.environmentId}
|
||||
threadId={threadRef.threadId}
|
||||
@@ -261,7 +261,7 @@ function ChatThreadRouteView() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
|
||||
<SidebarInset className="h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh">
|
||||
<ChatView
|
||||
environmentId={threadRef.environmentId}
|
||||
threadId={threadRef.threadId}
|
||||
|
||||
@@ -55,7 +55,7 @@ function DraftChatThreadRouteView() {
|
||||
|
||||
if (canonicalThreadRef) {
|
||||
return (
|
||||
<SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
|
||||
<SidebarInset className="h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh">
|
||||
<ChatView
|
||||
environmentId={canonicalThreadRef.environmentId}
|
||||
threadId={canonicalThreadRef.threadId}
|
||||
@@ -70,7 +70,7 @@ function DraftChatThreadRouteView() {
|
||||
}
|
||||
|
||||
return (
|
||||
<SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground">
|
||||
<SidebarInset className="h-svh min-h-0 overflow-hidden overscroll-y-none bg-background text-foreground md:h-dvh">
|
||||
<ChatView
|
||||
draftId={draftId}
|
||||
environmentId={draftSession.environmentId}
|
||||
|
||||
Reference in new issue
Block a user