From bf03b6f0fe388f588fef0859270c13a20773c11f Mon Sep 17 00:00:00 2001 From: KevIsDev Date: Mon, 28 Apr 2025 11:10:51 +0100 Subject: [PATCH] refactor(chat): move ScrollToBottom function outside BaseChat component Improve code maintainability by relocating the ScrollToBottom function outside the BaseChat component. This reduces complexity and enhances readability. --- app/components/chat/BaseChat.tsx | 32 +++++++++++++++---------------- app/lib/common/prompts/prompts.ts | 5 +---- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index 2128bb1..59b684f 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -217,22 +217,6 @@ export const BaseChat = React.forwardRef( } }, [providerList, provider]); - function ScrollToBottom() { - const { isAtBottom, scrollToBottom } = useStickToBottomContext(); - - return ( - !isAtBottom && ( - - ) - ); - } - const onApiKeysChange = async (providerName: string, apiKey: string) => { const newApiKeys = { ...apiKeys, [providerName]: apiKey }; setApiKeys(newApiKeys); @@ -695,3 +679,19 @@ export const BaseChat = React.forwardRef( return {baseChat}; }, ); + +function ScrollToBottom() { + const { isAtBottom, scrollToBottom } = useStickToBottomContext(); + + return ( + !isAtBottom && ( + + ) + ); +} diff --git a/app/lib/common/prompts/prompts.ts b/app/lib/common/prompts/prompts.ts index 7ad0129..ce44f5d 100644 --- a/app/lib/common/prompts/prompts.ts +++ b/app/lib/common/prompts/prompts.ts @@ -397,7 +397,7 @@ You are Bolt, an expert AI assistant and exceptional senior software developer w - Use premium typography with refined hierarchy and spacing. - Incorporate microbranding (custom icons, buttons, animations) aligned with the brand voice. - Use high-quality, optimized visual assets (photos, illustrations, icons). - - Unless specified by the user, Bolt ALWAYS uses stock photos from Pexels where appropriate, only valid URLs you know exist. Bolt NEVER downloads the images and only links to them in image tags. + - IMPORTANT: Unless specified by the user, Bolt ALWAYS uses stock photos from Pexels where appropriate, only valid URLs you know exist. Bolt NEVER downloads the images and only links to them in image tags. Layout & Structure: - Implement a systemized spacing/sizing system (e.g., 8pt grid, design tokens). @@ -492,9 +492,6 @@ ULTRA IMPORTANT: Think first and reply with the artifact that contains all neces - Include all possible interactions (e.g., buttons, links, etc.) - Include all possible navigation states (e.g., back, forward, etc.) - 8. For photos: - - Unless specified by the user, Bolt ALWAYS uses stock photos from Pexels where appropriate, only valid URLs you know exist. Bolt NEVER downloads the images and only links to them in image tags. - EXPO CONFIGURATION: 1. Define app configuration in app.json: