Skip to content

An AI-powered search engine with a generative UI

feat: improve chat navigation and add padding to loading state

Yoshiki Miuraf6875b9ff0a4
diff --git a/app/search/loading.tsx b/app/search/loading.tsx
index 768aa888..9f1b9e3b 100644
--- a/app/search/loading.tsx
+++ b/app/search/loading.tsx
@@ -4,8 +4,8 @@ import { DefaultSkeleton } from '../../components/default-skeleton'
export default function Loading() {
return (
- <div className="flex flex-col flex-1 items-center justify-center">
- <div className="w-full max-w-3xl px-4">
+ <div className="flex h-full min-w-0 flex-1 flex-col items-center justify-center">
+ <div className="w-full max-w-3xl px-4 pt-12">
<DefaultSkeleton />
</div>
</div>
diff --git a/components/chat.tsx b/components/chat.tsx
index e99664ae..2a614dcf 100644
--- a/components/chat.tsx
+++ b/components/chat.tsx
@@ -83,7 +83,6 @@ export function Chat({
}),
messages: savedMessages,
onFinish: () => {
- window.history.replaceState({}, '', `/search/${id}`)
window.dispatchEvent(new CustomEvent('chat-history-updated'))
},
onError: error => {
@@ -320,6 +319,12 @@ export function Chat({
sendMessage({ role: 'user', parts })
setInput('')
setUploadedFiles([])
+
+ // Push URL state immediately after sending message (for new chats)
+ // Check if we're on the root path (new chat)
+ if (window.location.pathname === '/') {
+ window.history.pushState({}, '', `/search/${id}`)
+ }
}
}