mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 08:37:22 +00:00
Safe area inset improvements
This commit is contained in:
11 files changed
+201
-185
No files matched your search
Generated
+16
@@ -79,6 +79,7 @@
|
|||||||
"streamdown": "~1.0.0",
|
"streamdown": "~1.0.0",
|
||||||
"tailwind-merge": "^2.5.2",
|
"tailwind-merge": "^2.5.2",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
|
"tailwindcss-safe-area": "^0.8.0",
|
||||||
"turndown": "^7.2.1",
|
"turndown": "^7.2.1",
|
||||||
"uri-templates": "^0.2.0",
|
"uri-templates": "^0.2.0",
|
||||||
"use-stick-to-bottom": "^1.1.1",
|
"use-stick-to-bottom": "^1.1.1",
|
||||||
@@ -10092,6 +10093,21 @@
|
|||||||
"tailwindcss": ">=3.0.0 || insiders"
|
"tailwindcss": ">=3.0.0 || insiders"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/tailwindcss-safe-area": {
|
||||||
|
"version": "0.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tailwindcss-safe-area/-/tailwindcss-safe-area-0.8.0.tgz",
|
||||||
|
"integrity": "sha512-OIKZfSvinI9kZ3hduoSxqP8EfW2rXoKvHnNyTDY2zwem06IIRtLcKdMe0nF98o+Xluk5Fy7mmesr1rSXg/wkhA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/mvllow"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"tailwindcss": "^2.0.0 || >=3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/tailwindcss/node_modules/postcss-selector-parser": {
|
"node_modules/tailwindcss/node_modules/postcss-selector-parser": {
|
||||||
"version": "6.1.2",
|
"version": "6.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz",
|
||||||
|
|||||||
@@ -82,6 +82,7 @@
|
|||||||
"streamdown": "~1.0.0",
|
"streamdown": "~1.0.0",
|
||||||
"tailwind-merge": "^2.5.2",
|
"tailwind-merge": "^2.5.2",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
|
"tailwindcss-safe-area": "^0.8.0",
|
||||||
"turndown": "^7.2.1",
|
"turndown": "^7.2.1",
|
||||||
"uri-templates": "^0.2.0",
|
"uri-templates": "^0.2.0",
|
||||||
"use-stick-to-bottom": "^1.1.1",
|
"use-stick-to-bottom": "^1.1.1",
|
||||||
|
|||||||
@@ -72,20 +72,22 @@ export function AppLayout({
|
|||||||
return (
|
return (
|
||||||
<div className="min-h-dvh bg-gradient-to-br from-primary/5 to-accent/5">
|
<div className="min-h-dvh bg-gradient-to-br from-primary/5 to-accent/5">
|
||||||
{/* Mobile Header */}
|
{/* Mobile Header */}
|
||||||
<header className="h-12 border-b bg-gradient-to-r from-primary/10 via-accent/5 to-primary/10 backdrop-blur px-4 py-3 flex items-center justify-between">
|
<header className="bg-gradient-to-r from-primary/10 via-accent/5 to-primary/10 backdrop-blur pt-safe">
|
||||||
<div className="flex items-center space-x-2">
|
<div className="h-12 px-4 py-3 flex items-center justify-between border-b">
|
||||||
{showSidebar && (
|
<div className="flex items-center space-x-2">
|
||||||
<Button
|
{showSidebar && (
|
||||||
variant="ghost"
|
<Button
|
||||||
size="sm"
|
variant="ghost"
|
||||||
onClick={() => setIsSidebarVisible(!isSidebarVisible)}
|
size="sm"
|
||||||
aria-label="Toggle sidebar"
|
onClick={() => setIsSidebarVisible(!isSidebarVisible)}
|
||||||
>
|
aria-label="Toggle sidebar"
|
||||||
<Menu className="h-4 w-4" />
|
>
|
||||||
</Button>
|
<Menu className="h-4 w-4" />
|
||||||
)}
|
</Button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{headerContent}
|
||||||
</div>
|
</div>
|
||||||
{headerContent}
|
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{/* Mobile Sidebar Overlay - show if showSidebar is true and sidebar is visible */}
|
{/* Mobile Sidebar Overlay - show if showSidebar is true and sidebar is visible */}
|
||||||
|
|||||||
@@ -399,7 +399,7 @@ export function CreditsDialog({ open, onOpenChange, provider }: CreditsDialogPro
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||||
<DialogContent onOpenAutoFocus={(e) => e.preventDefault()} className="max-w-lg w-full max-h-[75vh] overflow-hidden flex flex-col sm:max-w-lg sm:max-h-[75vh] max-sm:w-full max-sm:h-full max-sm:max-w-none max-sm:max-h-none max-sm:m-0 max-sm:rounded-none">
|
<DialogContent onOpenAutoFocus={(e) => e.preventDefault()} className="max-w-lg w-full max-h-[75vh] overflow-hidden flex flex-col sm:max-w-lg sm:max-h-[75vh] max-sm:w-full max-sm:h-dvh-safe max-sm:max-w-none max-sm:max-h-none max-sm:m-0 max-sm:rounded-none">
|
||||||
<DialogHeader className="flex-shrink-0">
|
<DialogHeader className="flex-shrink-0">
|
||||||
<DialogTitle className="flex items-center gap-2 text-lg">
|
<DialogTitle className="flex items-center gap-2 text-lg">
|
||||||
{lightningInvoice ? (
|
{lightningInvoice ? (
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||||
<DialogContent className="max-w-2xl h-[100dvh] sm:h-auto sm:max-h-[90vh] flex flex-col">
|
<DialogContent className="max-w-2xl h-dvh-safe sm:h-auto sm:max-h-[90vh] flex flex-col">
|
||||||
<DialogHeader className="flex-shrink-0">
|
<DialogHeader className="flex-shrink-0">
|
||||||
<DialogTitle className="flex items-center gap-2">
|
<DialogTitle className="flex items-center gap-2">
|
||||||
{step === 'open-source' && (
|
{step === 'open-source' && (
|
||||||
@@ -275,13 +275,15 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
|
|||||||
{step === 'open-source' && (
|
{step === 'open-source' && (
|
||||||
<div className="space-y-6 py-4">
|
<div className="space-y-6 py-4">
|
||||||
<div className="text-center space-y-4">
|
<div className="text-center space-y-4">
|
||||||
<h2 className="text-2xl font-bold">Shakespeare is Open Source software that runs entirely in your web browser</h2>
|
<h2 className="text-2xl font-bold">
|
||||||
|
Shakespeare is Open Source software that runs entirely in your web browser
|
||||||
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid gap-1 max-w-md mx-auto">
|
<div className="grid gap-1 max-w-md mx-auto">
|
||||||
<div className="flex items-start gap-3 p-3 rounded-lg bg-muted/50">
|
<div className="flex items-start gap-3 p-3 rounded-lg bg-muted/50">
|
||||||
<div className="h-2 w-2 rounded-full bg-primary mt-2 flex-shrink-0" />
|
<div className="h-2 w-2 rounded-full bg-primary mt-2 flex-shrink-0" />
|
||||||
<p className="text-sm">Your browser connects directly to third-party AI providers of your choice</p>
|
<p className="text-sm">Your device connects directly to third-party AI providers of your choice</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-start gap-3 p-3 rounded-lg bg-muted/50">
|
<div className="flex items-start gap-3 p-3 rounded-lg bg-muted/50">
|
||||||
<div className="h-2 w-2 rounded-full bg-primary mt-2 flex-shrink-0" />
|
<div className="h-2 w-2 rounded-full bg-primary mt-2 flex-shrink-0" />
|
||||||
@@ -303,7 +305,7 @@ export function OnboardingDialog({ open, onOpenChange }: OnboardingDialogProps)
|
|||||||
|
|
||||||
<div className="space-y-3 max-w-md mx-auto">
|
<div className="space-y-3 max-w-md mx-auto">
|
||||||
<p className="text-xs text-muted-foreground max-w-xl mx-auto">
|
<p className="text-xs text-muted-foreground max-w-xl mx-auto">
|
||||||
Shakespeare is not a cloud service. It's Open Source software that runs in your web browser.
|
Shakespeare is not a cloud service. It's Open Source software that runs on your device.
|
||||||
You agree to the Terms of Service of AI providers you interact with.
|
You agree to the Terms of Service of AI providers you interact with.
|
||||||
Shakespeare is provided "as is" without warranty of any kind.
|
Shakespeare is provided "as is" without warranty of any kind.
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -131,34 +131,36 @@ export function ProjectSidebar({
|
|||||||
return (
|
return (
|
||||||
<div className={cn("flex flex-col h-full bg-gradient-to-b from-sidebar to-sidebar/95", className)}>
|
<div className={cn("flex flex-col h-full bg-gradient-to-b from-sidebar to-sidebar/95", className)}>
|
||||||
{/* Header with Logo */}
|
{/* Header with Logo */}
|
||||||
<div className="flex px-4 h-12 border-b border-sidebar-border bg-gradient-to-r from-primary/10 via-accent/5 to-primary/10">
|
<div className="pt-safe bg-gradient-to-r from-primary/10 via-accent/5 to-primary/10">
|
||||||
<div className="flex items-center justify-between w-full">
|
<div className="flex px-4 h-12 border-b border-sidebar-border">
|
||||||
<button
|
<div className="flex items-center justify-between w-full">
|
||||||
onClick={() => navigateAndClose('/')}
|
<button
|
||||||
className="flex items-center gap-3 hover:opacity-80 transition-opacity text-left"
|
onClick={() => navigateAndClose('/')}
|
||||||
>
|
className="flex items-center gap-3 hover:opacity-80 transition-opacity text-left"
|
||||||
<ShakespeareLogo className="w-6 h-6" />
|
>
|
||||||
<h1 className="text-xl font-semibold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
|
<ShakespeareLogo className="w-6 h-6" />
|
||||||
Shakespeare
|
<h1 className="text-xl font-semibold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
|
||||||
</h1>
|
Shakespeare
|
||||||
</button>
|
</h1>
|
||||||
{(onToggleSidebar || (onClose && isMobile)) && (
|
</button>
|
||||||
<div className="flex items-center gap-1">
|
{(onToggleSidebar || (onClose && isMobile)) && (
|
||||||
<Button
|
<div className="flex items-center gap-1">
|
||||||
variant="ghost"
|
<Button
|
||||||
size="sm"
|
variant="ghost"
|
||||||
className="h-8 w-8 p-0 hover:bg-primary/10 -mr-2"
|
size="sm"
|
||||||
onClick={handleToggleSidebar}
|
className="h-8 w-8 p-0 hover:bg-primary/10 -mr-2"
|
||||||
aria-label={(onClose && isMobile) ? t('closeSidebar') : t('collapseSidebar')}
|
onClick={handleToggleSidebar}
|
||||||
>
|
aria-label={(onClose && isMobile) ? t('closeSidebar') : t('collapseSidebar')}
|
||||||
{(onClose && isMobile) ? (
|
>
|
||||||
<X className="h-4 w-4 text-primary/60 hover:text-primary" />
|
{(onClose && isMobile) ? (
|
||||||
) : (
|
<X className="h-4 w-4 text-primary/60 hover:text-primary" />
|
||||||
<Columns2 className="h-4 w-4 text-primary/60 hover:text-primary" />
|
) : (
|
||||||
)}
|
<Columns2 className="h-4 w-4 text-primary/60 hover:text-primary" />
|
||||||
</Button>
|
)}
|
||||||
</div>
|
</Button>
|
||||||
)}
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -229,8 +231,8 @@ export function ProjectSidebar({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Settings and Help at Bottom */}
|
{/* Settings and Help at Bottom */}
|
||||||
<div className="p-2 border-t border-sidebar-border bg-gradient-to-r from-primary/5 to-accent/5 mt-auto">
|
<div className="border-t border-sidebar-border bg-gradient-to-r from-primary/5 to-accent/5 mt-auto pb-safe">
|
||||||
<div className="flex items-center gap-2">
|
<div className="p-2 flex items-center gap-2">
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
@@ -251,8 +253,6 @@ export function ProjectSidebar({
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -120,10 +120,10 @@ export function SettingsLayout() {
|
|||||||
|
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
return (
|
return (
|
||||||
<div className="min-h-dvh bg-background">
|
<div className="min-h-dvh pb-safe bg-background">
|
||||||
{/* Mobile Header */}
|
{/* Mobile Header */}
|
||||||
<header className="h-12 border-b bg-background px-4 py-3 flex items-center justify-between">
|
<header className="pt-safe bg-background">
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2 h-12 border-b px-4 py-3">
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
|
|||||||
@@ -664,87 +664,87 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o
|
|||||||
<Tabs value={activeTab} className="h-full">
|
<Tabs value={activeTab} className="h-full">
|
||||||
{isPreviewable && (
|
{isPreviewable && (
|
||||||
<TabsContent value="preview" className="h-full mt-0">
|
<TabsContent value="preview" className="h-full mt-0">
|
||||||
<div className="h-full w-full flex flex-col relative">
|
<div className="h-full w-full flex flex-col relative">
|
||||||
{/* Always show browser address bar */}
|
{/* Always show browser address bar */}
|
||||||
<div className="h-12 flex items-center w-full">
|
<div className="h-12 flex items-center w-full">
|
||||||
<BrowserAddressBar
|
<BrowserAddressBar
|
||||||
currentPath={currentPath}
|
currentPath={currentPath}
|
||||||
onNavigate={hasBuiltProject ? navigateIframe : undefined}
|
onNavigate={hasBuiltProject ? navigateIframe : undefined}
|
||||||
onRefresh={hasBuiltProject ? refreshIframe : undefined}
|
onRefresh={hasBuiltProject ? refreshIframe : undefined}
|
||||||
onBack={hasBuiltProject ? goBackIframe : undefined}
|
onBack={hasBuiltProject ? goBackIframe : undefined}
|
||||||
onForward={hasBuiltProject ? goForwardIframe : undefined}
|
onForward={hasBuiltProject ? goForwardIframe : undefined}
|
||||||
canGoBack={hasBuiltProject && historyIndex > 0}
|
canGoBack={hasBuiltProject && historyIndex > 0}
|
||||||
canGoForward={hasBuiltProject && historyIndex < navigationHistory.length - 1}
|
canGoForward={hasBuiltProject && historyIndex < navigationHistory.length - 1}
|
||||||
extraContent={(
|
extraContent={(
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
{(!isMobile && onToggleView && isPreviewable) && (
|
{(!isMobile && onToggleView && isPreviewable) && (
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="sm"
|
||||||
|
onClick={onToggleView}
|
||||||
|
className="h-8 gap-2"
|
||||||
|
>
|
||||||
|
<Code className="h-4 w-4" />
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
<ConsoleDropdown />
|
||||||
|
<Menu />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Content area */}
|
||||||
|
<div className="flex-1">
|
||||||
|
{hasBuiltProject ? (
|
||||||
|
<iframe
|
||||||
|
ref={iframeRef}
|
||||||
|
src={`https://${projectId}.${IFRAME_DOMAIN}/`}
|
||||||
|
className="w-full h-full border-0"
|
||||||
|
title="Project Preview"
|
||||||
|
sandbox="allow-scripts allow-same-origin"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<div className="h-full flex items-center justify-center bg-muted">
|
||||||
|
<div className="text-center">
|
||||||
|
<h3 className="text-lg font-semibold mb-2">{t('projectPreview')}</h3>
|
||||||
|
<p className="text-muted-foreground mb-4">
|
||||||
|
{t('buildProjectToSeePreview')}
|
||||||
|
</p>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
onClick={handleBuildProject}
|
||||||
size="sm"
|
disabled={isBuildLoading}
|
||||||
onClick={onToggleView}
|
variant="outline"
|
||||||
className="h-8 gap-2"
|
className="gap-2"
|
||||||
>
|
>
|
||||||
<Code className="h-4 w-4" />
|
{isBuildLoading ? (
|
||||||
|
<>
|
||||||
|
<Loader2 className="h-5 w-5 animate-spin" />
|
||||||
|
Building...
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<Play className="h-5 w-5" />
|
||||||
|
Build Project
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
</div>
|
||||||
<ConsoleDropdown />
|
|
||||||
<Menu />
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
/>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Content area */}
|
{/* Build loading overlay */}
|
||||||
<div className="flex-1">
|
{isBuildLoading && (
|
||||||
{hasBuiltProject ? (
|
<div className="absolute inset-0 bg-background/50 backdrop-blur-sm flex items-center justify-center z-10">
|
||||||
<iframe
|
<div className="bg-background/90 border rounded-lg p-4 shadow-lg flex items-center gap-3">
|
||||||
ref={iframeRef}
|
<Loader2 className="h-5 w-5 animate-spin text-primary" />
|
||||||
src={`https://${projectId}.${IFRAME_DOMAIN}/`}
|
<span className="text-sm font-medium">Building project...</span>
|
||||||
className="w-full h-full border-0"
|
|
||||||
title="Project Preview"
|
|
||||||
sandbox="allow-scripts allow-same-origin"
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<div className="h-full flex items-center justify-center bg-muted">
|
|
||||||
<div className="text-center">
|
|
||||||
<h3 className="text-lg font-semibold mb-2">{t('projectPreview')}</h3>
|
|
||||||
<p className="text-muted-foreground mb-4">
|
|
||||||
{t('buildProjectToSeePreview')}
|
|
||||||
</p>
|
|
||||||
<Button
|
|
||||||
onClick={handleBuildProject}
|
|
||||||
disabled={isBuildLoading}
|
|
||||||
variant="outline"
|
|
||||||
className="gap-2"
|
|
||||||
>
|
|
||||||
{isBuildLoading ? (
|
|
||||||
<>
|
|
||||||
<Loader2 className="h-5 w-5 animate-spin" />
|
|
||||||
Building...
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<Play className="h-5 w-5" />
|
|
||||||
Build Project
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</TabsContent>
|
||||||
{/* Build loading overlay */}
|
|
||||||
{isBuildLoading && (
|
|
||||||
<div className="absolute inset-0 bg-background/50 backdrop-blur-sm flex items-center justify-center z-10">
|
|
||||||
<div className="bg-background/90 border rounded-lg p-4 shadow-lg flex items-center gap-3">
|
|
||||||
<Loader2 className="h-5 w-5 animate-spin text-primary" />
|
|
||||||
<span className="text-sm font-medium">Building project...</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</TabsContent>
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<TabsContent value="code" className="h-full mt-0">
|
<TabsContent value="code" className="h-full mt-0">
|
||||||
@@ -767,7 +767,7 @@ export function PreviewPane({ projectId, activeTab, onToggleView, projectName, o
|
|||||||
variant="outline"
|
variant="outline"
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => setMobileCodeView('terminal')}
|
onClick={() => setMobileCodeView('terminal')}
|
||||||
className="fixed right-4 bottom-safe-nav z-20 h-12 w-12 p-0 rounded-full shadow-lg bg-background border-2"
|
className="fixed right-4 bottom-14 mb-safe z-20 size-12 p-0 rounded-full shadow-lg bg-background border-2"
|
||||||
>
|
>
|
||||||
<Terminal className="h-6 w-6" />
|
<Terminal className="h-6 w-6" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ const ToastViewport = React.forwardRef<
|
|||||||
<ToastPrimitives.Viewport
|
<ToastPrimitives.Viewport
|
||||||
ref={ref}
|
ref={ref}
|
||||||
className={cn(
|
className={cn(
|
||||||
"fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[480px]",
|
"fixed top-safe z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-safe sm:right-safe sm:top-auto sm:flex-col md:max-w-[480px]",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
+6
-13
@@ -251,19 +251,6 @@
|
|||||||
max-height: 100dvh;
|
max-height: 100dvh;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* iOS Safe Area Support */
|
|
||||||
.safe-area-inset-bottom {
|
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
|
||||||
}
|
|
||||||
|
|
||||||
.safe-area-inset-top {
|
|
||||||
padding-top: env(safe-area-inset-top);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bottom-safe-nav {
|
|
||||||
bottom: calc(env(safe-area-inset-bottom) + 3.75rem);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Mobile navigation button styles - text/icon highlighting only */
|
/* Mobile navigation button styles - text/icon highlighting only */
|
||||||
.mobile-nav-button,
|
.mobile-nav-button,
|
||||||
.mobile-nav-button:hover,
|
.mobile-nav-button:hover,
|
||||||
@@ -298,4 +285,10 @@
|
|||||||
max-height: 100vh;
|
max-height: 100vh;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Capacitor/Mobile specific styles */
|
||||||
|
.keyboard-open {
|
||||||
|
/* Adjust layout when keyboard is open */
|
||||||
|
--keyboard-height: env(keyboard-height, 0px);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+48
-46
@@ -128,56 +128,58 @@ export function ProjectView() {
|
|||||||
|
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
return (
|
return (
|
||||||
<div className="h-dvh flex flex-col bg-background safe-area-inset-top">
|
<div className="h-dvh flex flex-col bg-background">
|
||||||
<header className="overflow-hidden border-b bg-gradient-to-r from-primary/10 via-accent/5 to-primary/10 backdrop-blur supports-[backdrop-filter]:bg-gradient-to-r supports-[backdrop-filter]:from-primary/10 supports-[backdrop-filter]:via-accent/5 supports-[backdrop-filter]:to-primary/10 px-4 py-3 flex items-center justify-between">
|
<header className="pt-safe bg-gradient-to-r from-primary/10 via-accent/5 to-primary/10 backdrop-blur">
|
||||||
<div className="flex items-center space-x-2 overflow-hidden">
|
<div className="h-12 border-b px-4 py-3 flex items-center justify-between">
|
||||||
<Button
|
<div className="flex items-center space-x-2 overflow-hidden">
|
||||||
variant="ghost"
|
<Button
|
||||||
size="sm"
|
variant="ghost"
|
||||||
onClick={() => setIsSidebarVisible(!isSidebarVisible)}
|
size="sm"
|
||||||
>
|
onClick={() => setIsSidebarVisible(!isSidebarVisible)}
|
||||||
<Menu className="h-4 w-4" />
|
>
|
||||||
</Button>
|
<Menu className="h-4 w-4" />
|
||||||
<div className="flex min-w-0 flex-1">
|
</Button>
|
||||||
|
<div className="flex min-w-0 flex-1">
|
||||||
|
{project ? (
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
className="block p-0 h-auto text-sm font-semibold truncate hover:bg-transparent hover:text-primary"
|
||||||
|
onClick={() => setIsProjectDetailsOpen(true)}
|
||||||
|
>
|
||||||
|
{project.name}
|
||||||
|
</Button>
|
||||||
|
) : (
|
||||||
|
<Skeleton className="h-5 w-32" />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
{project ? (
|
{project ? (
|
||||||
<Button
|
<>
|
||||||
variant="ghost"
|
<StarButton
|
||||||
className="block p-0 h-auto text-sm font-semibold truncate hover:bg-transparent hover:text-primary"
|
projectId={project.id}
|
||||||
onClick={() => setIsProjectDetailsOpen(true)}
|
projectName={project.name}
|
||||||
>
|
className="h-8 w-8"
|
||||||
{project.name}
|
/>
|
||||||
</Button>
|
<ActionsMenu
|
||||||
|
projectId={project.id}
|
||||||
|
projectName={project.name}
|
||||||
|
onNewChat={handleNewChat}
|
||||||
|
onProjectDetails={() => setIsProjectDetailsOpen(true)}
|
||||||
|
isLoading={isAILoading}
|
||||||
|
isBuildLoading={build.isPending}
|
||||||
|
onFirstInteraction={handleFirstInteraction}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
) : (
|
) : (
|
||||||
<Skeleton className="h-5 w-32" />
|
<>
|
||||||
|
<Skeleton className="h-8 w-8 rounded" />
|
||||||
|
<Skeleton className="h-8 w-8 rounded" />
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
{project ? (
|
|
||||||
<>
|
|
||||||
<StarButton
|
|
||||||
projectId={project.id}
|
|
||||||
projectName={project.name}
|
|
||||||
className="h-8 w-8"
|
|
||||||
/>
|
|
||||||
<ActionsMenu
|
|
||||||
projectId={project.id}
|
|
||||||
projectName={project.name}
|
|
||||||
onNewChat={handleNewChat}
|
|
||||||
onProjectDetails={() => setIsProjectDetailsOpen(true)}
|
|
||||||
isLoading={isAILoading}
|
|
||||||
isBuildLoading={build.isPending}
|
|
||||||
onFirstInteraction={handleFirstInteraction}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<Skeleton className="h-8 w-8 rounded" />
|
|
||||||
<Skeleton className="h-8 w-8 rounded" />
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{/* Mobile Sidebar Overlay */}
|
{/* Mobile Sidebar Overlay */}
|
||||||
@@ -248,7 +250,7 @@ export function ProjectView() {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="border-t bg-gradient-to-r from-primary/5 via-background to-accent/5 backdrop-blur safe-area-inset-bottom">
|
<div className="border-t bg-gradient-to-r from-primary/5 via-background to-accent/5 backdrop-blur pb-safe">
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
|
|||||||
Reference in new issue
Block a user