An AI-powered search engine with a generative UI
TypeScript generative-aigenerative-uinextjsollamareactsearxngshadcn-uitailwindcsstavilytypescriptupstashvercel-ai-sdk
fix: resolve mobile overflow issues with horizontal scrolling
Yoshiki Miura22e4188de365
diff --git a/components/artifact/chat-artifact-container.tsx b/components/artifact/chat-artifact-container.tsxindex cbdd33fe..101e0047 100644--- a/components/artifact/chat-artifact-container.tsx+++ b/components/artifact/chat-artifact-container.tsx@@ -183,7 +183,7 @@ export function ChatArtifactContainer({)}{/* Mobile: full-width chat + drawer */}- <div className="md:hidden flex-1 h-full">+ <div className="md:hidden flex-1 h-full min-w-0">{children}<InspectorDrawer /></div>diff --git a/components/chat-messages.tsx b/components/chat-messages.tsxindex 1eab5374..14904a6a 100644--- a/components/chat-messages.tsx+++ b/components/chat-messages.tsx@@ -182,7 +182,7 @@ export function ChatMessages({sections.length > 0 ? 'flex-1 overflow-y-auto' : '')}>- <div className="relative mx-auto w-full max-w-3xl px-4">+ <div className="relative mx-auto w-full max-w-full md:max-w-3xl px-4">{sections.map((section, sectionIndex) => (<divkey={section.id}diff --git a/components/chat-panel.tsx b/components/chat-panel.tsxindex 6284ffbb..87a7d948 100644--- a/components/chat-panel.tsx+++ b/components/chat-panel.tsx@@ -156,7 +156,7 @@ export function ChatPanel({setIsInputFocused(false)inputRef.current?.blur()}}- className={cn('max-w-3xl w-full mx-auto relative')}+ className={cn('max-w-full md:max-w-3xl w-full mx-auto relative')}>{/* Scroll to bottom button - only shown when showScrollToBottomButton is true */}{showScrollToBottomButton && messages.length > 0 && (diff --git a/components/collapsible-message.tsx b/components/collapsible-message.tsxindex 325497de..502b03af 100644--- a/components/collapsible-message.tsx+++ b/components/collapsible-message.tsx@@ -63,7 +63,7 @@ export function CollapsibleMessage({{isCollapsible ? (<divclassName={cn(- 'flex-1 overflow-hidden',+ 'flex-1 overflow-hidden min-w-0',variant === 'default' && showBorder && 'rounded-lg border bg-card',variant === 'default' && !showBorder && 'rounded-lg bg-card',variant === 'process' && 'rounded-lg border bg-card',@@ -88,7 +88,7 @@ export function CollapsibleMessage({{header && (<divclassName={cn(- 'overflow-hidden',+ 'overflow-hidden min-w-0',variant === 'default' && 'text-sm flex-1',variant === 'minimal' && 'text-sm flex items-center gap-1',(variant === 'process' || variant === 'process-sub') &&diff --git a/components/search-results.tsx b/components/search-results.tsxindex 5b1efb16..074cf5e5 100644--- a/components/search-results.tsx+++ b/components/search-results.tsx@@ -85,15 +85,15 @@ export function SearchResults({return (<div className="flex flex-wrap -m-1">{displayedGridResults.map((result, index) => (- <div className="w-1/2 md:w-1/4 p-1" key={index}>+ <div className="w-1/2 md:w-1/4 p-1 min-w-0" key={index}><Link href={result.url} passHref target="_blank"><Card className="flex-1 h-full hover:bg-muted/50 transition-colors">- <CardContent className="p-2 flex flex-col justify-between h-full">+ <CardContent className="p-2 flex flex-col justify-between h-full min-w-0"><p className="text-xs line-clamp-2 min-h-8">{result.title || result.content}</p>- <div className="mt-2 flex items-center space-x-1">- <Avatar className="h-4 w-4">+ <div className="mt-2 flex items-center space-x-1 min-w-0">+ <Avatar className="h-4 w-4 shrink-0"><AvatarImagesrc={`https://www.google.com/s2/favicons?domain=${new URL(result.url).hostname@@ -104,7 +104,7 @@ export function SearchResults({{new URL(result.url).hostname[0]}</AvatarFallback></Avatar>- <div className="text-xs opacity-60 truncate">+ <div className="text-xs opacity-60 truncate min-w-0">{`${displayUrlName(result.url)} - ${index + 1}`}</div></div>diff --git a/components/section.tsx b/components/section.tsxindex 71e68df0..1291d8a0 100644--- a/components/section.tsx+++ b/components/section.tsx@@ -111,7 +111,7 @@ export function ToolArgsSection({return (<Sectionsize="sm"- className="py-0 flex items-center justify-between w-full gap-2 overflow-hidden"+ className="py-0 flex items-center justify-between w-full gap-2 overflow-hidden min-w-0"><div className="min-w-0 flex-1 overflow-hidden"><ToolBadge tool={tool} isLoading={isLoading}>