Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions apps/web/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,26 @@
* {
@apply border-border outline-ring/50;
}
html {
-webkit-text-size-adjust: 100%;
text-size-adjust: 100%;
/* A tap shows the control's own pressed state, not the browser's grey box. */
-webkit-tap-highlight-color: transparent;
}
body {
@apply bg-background text-foreground font-sans;
/* The page stays put: no rubber-band of the whole app, no pull to refresh. */
overscroll-behavior: none;
}
/* No double-tap zoom, so taps answer at once. */
a,
button,
input,
label,
select,
textarea,
[role='button'],
[role='tab'] {
touch-action: manipulation;
}
}
18 changes: 17 additions & 1 deletion apps/web/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Metadata } from 'next'
import type { Metadata, Viewport } from 'next'
import { SITE_NAME } from '@/lib/site'
import { GeistSans } from 'geist/font/sans'
import { GeistMono } from 'geist/font/mono'
Expand All @@ -16,6 +16,22 @@ export const dynamic = 'force-dynamic'
export const metadata: Metadata = {
title: SITE_NAME,
description: 'A v0.app clone built with AI Elements and Geist.',
// Added to a phone's home screen, it opens full screen, like an app.
appleWebApp: { capable: true, title: SITE_NAME, statusBarStyle: 'default' },
}

// A phone: the page runs edge to edge (the shell pads for the notch and the
// home bar), the keyboard shrinks the page rather than covering the composer,
// and the browser's bars take the page's colour.
export const viewport: Viewport = {
width: 'device-width',
initialScale: 1,
viewportFit: 'cover',
interactiveWidget: 'resizes-content',
themeColor: [
{ media: '(prefers-color-scheme: light)', color: '#ffffff' },
{ media: '(prefers-color-scheme: dark)', color: '#0f0f11' },
],
}

export default async function RootLayout({
Expand Down
16 changes: 16 additions & 0 deletions apps/web/app/manifest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { MetadataRoute } from 'next'
import { SITE_NAME } from '@/lib/site'

// Installed on a phone, the app opens on its own, without the browser's bars.
export default function manifest(): MetadataRoute.Manifest {
return {
name: SITE_NAME,
short_name: SITE_NAME,
description: 'A v0.app clone built with AI Elements and Geist.',
start_url: '/',
display: 'standalone',
background_color: '#ffffff',
theme_color: '#ffffff',
icons: [{ src: '/icon.svg', sizes: 'any', type: 'image/svg+xml' }],
}
}
4 changes: 4 additions & 0 deletions apps/web/components/ai-elements/prompt-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,10 @@ export const PromptInputTextarea = ({
if (e.shiftKey) {
return
}
// A touch keyboard's return key starts a new line; the send button sends.
if (window.matchMedia('(pointer: coarse)').matches) {
return
}
e.preventDefault()

// Check if the submit button is disabled before submitting
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/chat/chat-conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export function ChatConversation({
taskDisabled={isSubmitting || restoringMessageId !== null}
vercelProjectId={vercelProjectId}
/>
<div className="shrink-0 px-3 pb-3">
<div className="shrink-0 px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] md:pb-3">
<PromptBox
compact
isSubmitting={isSubmitting || restoringMessageId !== null}
Expand Down
Loading
Loading