A lightweight design agent built with libfx. Describe a page and an agent writes it as one HTML file.
TypeScript
Keep the phone from zooming into the prompt and name the pane switch
Esteban Suarez173b1fc43e1c
diff --git a/app/globals.css b/app/globals.cssindex 2611d20..4283112 100644--- a/app/globals.css+++ b/app/globals.css@@ -168,6 +168,14 @@ textarea {font: inherit;}+/* iOS Safari zooms into a focused field under 16px and leaves the page panned. */+@media (pointer: coarse) {+ input,+ textarea {+ font-size: 16px;+ }+}+button:not(:disabled),a,label,diff --git a/components/chat-app.tsx b/components/chat-app.tsxindex e599259..554a6a1 100644--- a/components/chat-app.tsx+++ b/components/chat-app.tsx@@ -41,7 +41,6 @@ import Sidebar from './sidebar'import SidebarGestures, { type SidebarGestureControls } from './sidebar-gestures'import { Button } from './ui/button'import { Popover, PopoverContent, PopoverTrigger } from './ui/popover'-import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip'import SourceLink from './source-link'import {DEFAULT_VIEW,@@ -1810,7 +1809,7 @@ export default function ChatApp({ account, sidebar, boot, preference, defaultMod</div><header className="shrink-0 border-b border-border bg-background">- <div className="flex h-12 items-center gap-1.5 px-4">+ <div className="flex h-12 items-center gap-1 px-2 md:gap-1.5 md:px-4"><Buttonref={menuButtonRef}variant="ghost"@@ -1949,31 +1948,23 @@ export default function ChatApp({ account, sidebar, boot, preference, defaultMod/>))}- {/* Only a phone switches between the conversation and the preview. */}- <Tooltip>- <TooltipTrigger asChild>- <Button- ref={previewButtonRef}- variant={previewOpen ? 'secondary' : 'ghost'}- size="icon-sm"- className="lg:hidden"- aria-label={previewOpen ? 'close preview' : 'open preview'}- aria-expanded={previewOpen}- aria-controls="preview-pane"- {...fastClick(() => {- setInteractionNotice(null)- if (previewOpen) closePreview()- else setPreviewVisibility(true)- })}- >- <svg viewBox="0 0 16 16" className="size-4" aria-hidden="true">- <rect x="2" y="3.5" width="12" height="9" fill="none" stroke="currentColor" strokeWidth="1.5" />- <rect x="9.25" y="3.5" width="4.75" height="9" fill="currentColor" />- </svg>- </Button>- </TooltipTrigger>- <TooltipContent>{previewOpen ? 'close preview' : 'open preview'}</TooltipContent>- </Tooltip>+ {/* Only a phone switches between the conversation and the preview;+ the label names the pane the tap goes to. */}+ <Button+ ref={previewButtonRef}+ variant="ghost"+ size="sm"+ className="shrink-0 px-2 font-normal lg:hidden"+ aria-expanded={previewOpen}+ aria-controls="preview-pane"+ {...fastClick(() => {+ setInteractionNotice(null)+ if (previewOpen) closePreview()+ else setPreviewVisibility(true)+ })}+ >+ {previewOpen ? 'chat' : 'preview'}+ </Button></div>{visibleErrorNotice && (<div role="alert" className="bg-error/10 px-4 py-2 text-sm text-error">