From 28867d117dc2b44c1e8c7c8019669389cd3e0fa3 Mon Sep 17 00:00:00 2001 From: Innei Date: Thu, 7 Aug 2025 11:08:02 +0800 Subject: [PATCH] fix(ai-chat): adjust layout for WelcomeScreen and ChatInterface - Updated the positioning of the personal prompt in the WelcomeScreen to use absolute positioning for better visibility. - Corrected the translate-y calculation in ChatInterface to ensure proper alignment when no messages are present. These changes enhance the layout and user experience of the AI chat interface. Signed-off-by: Innei --- .../components/layouts/ChatInterface.tsx | 2 +- .../components/layouts/WelcomeScreen.tsx | 41 +++++++++---------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/ai-chat/components/layouts/ChatInterface.tsx b/apps/desktop/layer/renderer/src/modules/ai-chat/components/layouts/ChatInterface.tsx index d9c969eb0..b4cdce21b 100644 --- a/apps/desktop/layer/renderer/src/modules/ai-chat/components/layouts/ChatInterface.tsx +++ b/apps/desktop/layer/renderer/src/modules/ai-chat/components/layouts/ChatInterface.tsx @@ -197,7 +197,7 @@ const ChatInterfaceContent = () => { className={clsx( "absolute mx-auto duration-200 ease-in-out", hasMessages && "inset-x-0 bottom-0 max-w-4xl px-6 pb-6", - !hasMessages && "inset-x-0 bottom-1/2 max-w-3xl translate-y-[calc(100%+2rem)] px-6 pb-6", + !hasMessages && "inset-x-0 bottom-1/2 max-w-3xl translate-y-[calc(100%-2rem)] px-6 pb-6", )} > {error && } diff --git a/apps/desktop/layer/renderer/src/modules/ai-chat/components/layouts/WelcomeScreen.tsx b/apps/desktop/layer/renderer/src/modules/ai-chat/components/layouts/WelcomeScreen.tsx index 95582ea1e..ff25037c3 100644 --- a/apps/desktop/layer/renderer/src/modules/ai-chat/components/layouts/WelcomeScreen.tsx +++ b/apps/desktop/layer/renderer/src/modules/ai-chat/components/layouts/WelcomeScreen.tsx @@ -34,32 +34,12 @@ export const WelcomeScreen = ({ onSend }: WelcomeScreenProps) => {

{APP_NAME} AI

{t("welcome_description")}

- {hasCustomPrompt && ( -
-
-
- Personal Prompt: -
- -
-

- {aiSettings.personalizePrompt} -

-
- )}
-
+
{/* Custom shortcuts first */} {enabledShortcuts.slice(0, 6).map((shortcut, index) => ( { {suggestion} ))} + + {hasCustomPrompt && ( +
+
+
Personal Prompt:
+ +
+

+ {aiSettings.personalizePrompt} +

+
+ )}