Fix iOS keyboard background and add PWA standalone detection

This commit is contained in:
Chris Scott committed 2025-11-27 11:24:47 -05:00
1 parent dcf2dd68e7
commit 6c88f23b5f
4 files changed
+41 -4

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="manifest" href="/manifest.json" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="theme-color" content="#0a0a0a" />
<meta name="description" content="AI-powered coding assistant interface" />
<meta name="apple-mobile-web-app-capable" content="yes" />
@@ -4,6 +4,7 @@ import { useSettings } from '@/hooks/useSettings'
import { useCommands } from '@/hooks/useCommands'
import { useCommandHandler } from '@/hooks/useCommandHandler'
import { useFileSearch } from '@/hooks/useFileSearch'
import { useStandalone } from '@/hooks/useStandalone'
import { CommandSuggestions } from '@/components/command/CommandSuggestions'
import { FileSuggestions } from './FileSuggestions'
@@ -76,6 +77,8 @@ export function PromptInput({
showFileSuggestions,
directory
)
const isStandalone = useStandalone()
const handleSubmit = () => {
if (!prompt.trim() || disabled) return
@@ -415,7 +418,7 @@ export function PromptInput({
return (
<div className="backdrop-blur-md bg-background/90 border border-border rounded-lg p-3 mx-2 mb-2 md:mx-4 md:mb-4 max-w-4xl md:mx-auto">
<div className={`backdrop-blur-md bg-background/90 border border-border rounded-lg p-1 md:p-3 mx-2 md:mx-4 md:mb-4 max-w-4xl md:mx-auto ${isStandalone ? 'mb-6' : 'mb-1'}`}>
<textarea
@@ -429,7 +432,7 @@ export function PromptInput({
: "Send a message... (Cmd/Ctrl+Enter)"
}
disabled={disabled || hasActiveStream}
className={`w-full bg-background px-3 py-2 text-[16px] text-foreground placeholder-muted-foreground focus:outline-none resize-none min-h-[36px] max-h-[120px] disabled:opacity-50 disabled:cursor-not-allowed md:text-sm rounded-lg ${
className={`w-full bg-background px-3 text-[16px] text-foreground placeholder-muted-foreground focus:outline-none resize-none min-h-[36px] max-h-[120px] disabled:opacity-50 disabled:cursor-not-allowed md:text-sm rounded-lg ${
isBashMode
? 'border-purple-500/50 bg-purple-500/5'
: ''
@@ -441,7 +444,7 @@ export function PromptInput({
<div className="flex gap-2 items-center">
<button
onClick={handleModeToggle}
className={`px-2 py-1 rounded-md text-xs font-medium border ${modeBg} ${modeColor} hover:opacity-80 transition-opacity cursor-pointer`}
className={`w-16 px-2 py-1 rounded-md text-xs font-medium border ${modeBg} ${modeColor} hover:opacity-80 transition-opacity cursor-pointer`}
>
{currentMode.toUpperCase()}
</button>
+22
View File
@@ -0,0 +1,22 @@
import { useState, useEffect } from 'react'
export function useStandalone() {
const [isStandalone, setIsStandalone] = useState(false)
useEffect(() => {
const checkStandalone = () => {
const isIOSStandalone = ('standalone' in window.navigator) && (window.navigator as Navigator & { standalone: boolean }).standalone
const isDisplayModeStandalone = window.matchMedia('(display-mode: standalone)').matches
setIsStandalone(isIOSStandalone || isDisplayModeStandalone)
}
checkStandalone()
const mediaQuery = window.matchMedia('(display-mode: standalone)')
mediaQuery.addEventListener('change', checkStandalone)
return () => mediaQuery.removeEventListener('change', checkStandalone)
}, [])
return isStandalone
}
+12
View File
@@ -40,14 +40,26 @@
--color-accent-foreground: #111827;
}
html {
background-color: #0a0a0a;
}
:root:not(.dark) html {
background-color: #ffffff;
}
body {
background: linear-gradient(to bottom right, #0a0a0a, #0d0d0d, #0a0a0a);
color: var(--color-foreground);
transition: background-color 0.3s ease, color 0.3s ease;
min-height: 100vh;
min-height: 100dvh;
}
:root:not(.dark) body {
background: linear-gradient(to bottom right, #ffffff, #f0f0f0, #ffffff);
min-height: 100vh;
min-height: 100dvh;
}
/* Custom animations */