Skip to content

Commit f51210f

Browse files
committed
fixed some minimal ui issues like scrolling to the bottom of the page whenever it reloads
1 parent 14e32d1 commit f51210f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/app/page.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,8 @@ export default function Home() {
215215
// Set loading state
216216
setIsLoading(true);
217217

218-
// Get AI response
218+
// Send automatic template response
219219
try {
220-
// const apiResponse = await sendChatMessage({
221-
// message: uploadMessage,
222-
// selected_images: [],
223-
// user_id: userId,
224-
// });
225-
226-
// const aiMessage = createMessage(apiResponse.response, "agent");
227220
const aiMessage = createMessage(
228221
`"${file.name}" was uploaded successfully! Now select the images you want to edit and ask away!`,
229222
"agent",
@@ -261,7 +254,9 @@ export default function Home() {
261254
{/* Image Gallery */}
262255
<div className="bg-white/5 backdrop-blur-xl rounded-2xl p-6 shadow-2xl border border-white/10">
263256
<div className="flex items-center justify-between mb-4">
264-
<h2 className="text-xl font-semibold text-gray-200">Your Images</h2>
257+
<h2 className="text-xl font-semibold text-gray-200">
258+
Your Gallery
259+
</h2>
265260
{selectedImages.size === 0 ? (
266261
<p className="text-sm text-gray-400">
267262
Click to select images for editing
@@ -290,6 +285,8 @@ export default function Home() {
290285
onSelect={handleImageSelection}
291286
/>
292287
))}
288+
{/* add some space at the end to not interfere with ImageCard hover animation */}
289+
<div>-</div>
293290
</div>
294291
</div>
295292
</div>

src/ui/chat-interface.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ export default function ChatInterface({
4141
};
4242

4343
useEffect(() => {
44-
scrollToBottom();
44+
// Only scroll if there are more than 1 message (don't scroll on initial load)
45+
if (messages.length > 1) {
46+
scrollToBottom();
47+
}
4548
}, [messages]);
4649

4750
const handleSubmit = (e: React.FormEvent) => {

0 commit comments

Comments
 (0)