From 9e5abc2627e9daa50139d10e5b66eead45417635 Mon Sep 17 00:00:00 2001
From: "google-labs-jules[bot]"
<161369871+google-labs-jules[bot]@users.noreply.github.com>
Date: Mon, 29 Sep 2025 06:29:30 +0000
Subject: [PATCH 1/2] feat: Display example prompts on desktop
Refactored the chat component to ensure that example prompts are displayed on desktop, tablet, and mobile devices.
- Created a new `ConditionalChatMessages` component to handle the logic of displaying either the `EmptyScreen` or the `ChatMessages` based on whether there are messages.
- Updated the `Chat` component to use the new `ConditionalChatMessages` component in both mobile and desktop layouts, removing duplicated code and improving maintainability.
---
components/chat.tsx | 24 +++++++++++-------------
components/conditional-chat-messages.tsx | 24 ++++++++++++++++++++++++
2 files changed, 35 insertions(+), 13 deletions(-)
create mode 100644 components/conditional-chat-messages.tsx
diff --git a/components/chat.tsx b/components/chat.tsx
index 34e92244..df6e4a4f 100644
--- a/components/chat.tsx
+++ b/components/chat.tsx
@@ -3,9 +3,8 @@
import { useEffect, useState } from 'react'
import { usePathname, useRouter } from 'next/navigation'
import { ChatPanel } from './chat-panel'
-import { ChatMessages } from './chat-messages'
-import { EmptyScreen } from './empty-screen'
import { Mapbox } from './map/mapbox-map'
+import { ConditionalChatMessages } from './conditional-chat-messages'
import { useUIState, useAIState } from 'ai/rsc'
import MobileIconsBar from './mobile-icons-bar'
import { useProfileToggle, ProfileToggleEnum } from "@/components/profile-toggle-context";
@@ -86,15 +85,11 @@ export function Chat({ id }: ChatProps) {
- {showEmptyScreen ? (
- {
- setInput(message)
- }}
- />
- ) : (
-
- )}
+
@@ -107,8 +102,11 @@ export function Chat({ id }: ChatProps) {
{/* This is the new div for scrolling */}
- {/* TODO: Add EmptyScreen for desktop if needed */}
-
+
void;
+}) {
+ if (showEmptyScreen) {
+ return (
+ {
+ setInput(message);
+ }}
+ />
+ );
+ }
+
+ return ;
+}
\ No newline at end of file
From d197681180271f2fc71caeebf8ddce7eb0d85306 Mon Sep 17 00:00:00 2001
From: "google-labs-jules[bot]"
<161369871+google-labs-jules[bot]@users.noreply.github.com>
Date: Mon, 29 Sep 2025 06:34:44 +0000
Subject: [PATCH 2/2] feat: Display example prompts on desktop and move them
below the input
This commit updates the chat component to display example prompts on desktop, tablet, and mobile devices, and positions them below the chat input area.
- The `Chat` component is modified to render the `ChatPanel` (input) before the `EmptyScreen` (prompts) or `ChatMessages` (history).
- This change ensures a consistent layout across all screen sizes, with the input field always appearing above the content area.
- The unnecessary `conditional-chat-messages.tsx` component has been removed, and its logic is now handled directly within `chat.tsx`.
---
components/chat.tsx | 31 +++++++++++++++---------
components/conditional-chat-messages.tsx | 24 ------------------
2 files changed, 20 insertions(+), 35 deletions(-)
delete mode 100644 components/conditional-chat-messages.tsx
diff --git a/components/chat.tsx b/components/chat.tsx
index df6e4a4f..59c4d914 100644
--- a/components/chat.tsx
+++ b/components/chat.tsx
@@ -3,8 +3,9 @@
import { useEffect, useState } from 'react'
import { usePathname, useRouter } from 'next/navigation'
import { ChatPanel } from './chat-panel'
+import { ChatMessages } from './chat-messages'
+import { EmptyScreen } from './empty-screen'
import { Mapbox } from './map/mapbox-map'
-import { ConditionalChatMessages } from './conditional-chat-messages'
import { useUIState, useAIState } from 'ai/rsc'
import MobileIconsBar from './mobile-icons-bar'
import { useProfileToggle, ProfileToggleEnum } from "@/components/profile-toggle-context";
@@ -85,11 +86,15 @@ export function Chat({ id }: ChatProps) {
-
+ {showEmptyScreen ? (
+ {
+ setInput(message)
+ }}
+ />
+ ) : (
+
+ )}
@@ -102,12 +107,16 @@ export function Chat({ id }: ChatProps) {
{/* This is the new div for scrolling */}
-
+ {showEmptyScreen ? (
+ {
+ setInput(message)
+ }}
+ />
+ ) : (
+
+ )}
void;
-}) {
- if (showEmptyScreen) {
- return (
- {
- setInput(message);
- }}
- />
- );
- }
-
- return ;
-}
\ No newline at end of file