From 6b2488993f8ad9ff354cafb99973e6e8541ec35a Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 11:57:01 +0000 Subject: [PATCH 1/2] Fix resolution search, model mapping, and UI consistency Co-authored-by: ngoiyaeric <115367894+ngoiyaeric@users.noreply.github.com> --- app/actions.tsx | 2 +- components/chat-panel.tsx | 61 ++++++++++++++--------------- components/header-search-button.tsx | 27 ++++++++----- lib/utils/index.ts | 8 ++-- 4 files changed, 52 insertions(+), 46 deletions(-) diff --git a/app/actions.tsx b/app/actions.tsx index 673b921e..76d73727 100644 --- a/app/actions.tsx +++ b/app/actions.tsx @@ -84,7 +84,7 @@ async function submit(formData?: FormData, skip?: boolean) { }); messages.push({ role: 'user', content }); - const summaryStream = createStreamableValue(''); + const summaryStream = createStreamableValue('Analyzing map view...'); const groupeId = nanoid(); async function processResolutionSearch() { diff --git a/components/chat-panel.tsx b/components/chat-panel.tsx index 7d877ccd..dbf29637 100644 --- a/components/chat-panel.tsx +++ b/components/chat-panel.tsx @@ -13,7 +13,7 @@ import { useSettingsStore } from '@/lib/store/settings' import { PartialRelated } from '@/lib/schema/related' import { getSuggestions } from '@/lib/actions/suggest' import { useMapData } from './map/map-data-context' -import SuggestionsDropdown from './suggestions-dropdown' +import { toast } from 'sonner' interface ChatPanelProps { messages: UIState @@ -56,7 +56,7 @@ export const ChatPanel = forwardRef(({ messages, i // Detect mobile layout useEffect(() => { const checkMobile = () => { - setIsMobile(window.innerWidth <= 1024) + setIsMobile(window.innerWidth < 768) } checkMobile() window.addEventListener('resize', checkMobile) @@ -67,7 +67,7 @@ export const ChatPanel = forwardRef(({ messages, i const file = e.target.files?.[0] if (file) { if (file.size > 10 * 1024 * 1024) { - alert('File size must be less than 10MB') + toast.error('File size must be less than 10MB') return } setSelectedFile(file) @@ -161,31 +161,6 @@ export const ChatPanel = forwardRef(({ messages, i inputRef.current?.focus() }, []) - // New chat button (appears when there are messages) - if (messages.length > 0 && !isMobile) { - return ( -
- -
- ) - } - return (
(({ messages, i : 'sticky bottom-0 bg-background z-10 w-full border-t border-border px-2 py-3 md:px-4' )} > + {/* New chat button (appears when there are messages on desktop) */} + {messages.length > 0 && !isMobile && ( +
+ +
+ )} +
(({ messages, i value={input} data-testid="chat-input" className={cn( - 'resize-none w-full min-h-12 rounded-fill border border-input pl-14 pr-12 pt-3 pb-1 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', + 'resize-none w-full min-h-12 rounded-fill border border-input pr-12 pt-3 pb-1 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', isMobile - ? 'mobile-chat-input input bg-background' - : 'bg-muted' + ? 'mobile-chat-input input bg-background px-4' + : 'bg-muted pl-14' )} onChange={e => { setInput(e.target.value) @@ -294,7 +291,7 @@ export const ChatPanel = forwardRef(({ messages, i {selectedFile && (
- + {selectedFile.name}