- Replace dual-pill toggle with single icon button
- Building mode: shows MessageCircle icon to switch to Chatting
- Chatting mode: shows Hammer icon to switch back to Building
- Keep compose box structure consistent between both modes
- Remove unused imports (Hammer from ChatInput, MessageCircle from GlobalChatPane)
- Remove toggle tabs from top of mobile chat pane
- Add pill-style toggle button inside the compose area (similar to Lovable's UI)
- Toggle shows Building (hammer icon) and Chatting (message icon) modes
- Toggle appears in both ChatInput and GlobalChatPane embedded mode
- Maintains consistent styling with rounded-full bg-muted design
- Hide FloatingChatButton on mobile for all pages except home (/ and /giftcard)
- Add Building/Chatting toggle on mobile Chat tab in ProjectView
- Add embedded mode to GlobalChatPane for inline rendering without fixed positioning
- Add translations for "building" and "chatting" in all locales (en, pt, zh, ha, yo, ig)
- Created src/lib/globalChatSystem.ts with comprehensive default prompt
- Includes Shakespeare platform overview and architecture
- Describes user interface and available actions
- Lists helpful resource blog posts for user assistance
- Moved Chat System Prompt setting from System Settings to AI Settings
- Now under the "System Prompts" section in Advanced settings
- Grouped with Project System Prompt for better organization
- Updated GlobalChatProvider to use the new default prompt module
- Added new translation keys for the reorganized UI:
- systemPrompts, systemPromptsDescription
- projectSystemPrompt, projectSystemPromptDescription
- globalChatSystemPrompt, globalChatSystemPromptDescription
- Removed redundant code from SystemSettings.tsx
Resources included in the new default prompt:
- AI model selection guide
- Configuring AI providers
- Using local AI models
- Editing code in Shakespeare
- Deploying and sharing projects
- Importing existing projects
- Version control with Git
- Debugging tips
- Better prompting techniques
- Added useLocation hook to GlobalChatPane component
- Added check to hide GlobalChatPane when on settings pages (pathname starts with '/settings')
- Matches existing behavior of FloatingChatButton which already hides on settings pages
- Ensures consistent UX where both the chat button and pane are hidden in settings
Removed `isLoading` and `messages` from sendMessage's dependency array.
These were causing the callback to be recreated on every state change,
triggering infinite re-renders.
Instead, capture current messages inside the setMessages updater function
to avoid needing messages in the deps array.
The issue was that setIsLoading(false) was being called twice:
1. Inside the for-await loop when finish_reason is received
2. In the finally block after the loop completes (3 seconds later)
The finally block's setIsLoading(false) was overriding the early release,
causing React to wait until the entire async iterator finished draining
before updating the UI state.
Solution: Use a ref to track if loading was already released, and skip
the finally block's setIsLoading call if we already released it early.
Release the loading state immediately when finish_reason is received,
but don't break from the for-await loop. Breaking triggers async iterator
cleanup which can cause a multi-second delay before the input becomes
available again. Instead, let the stream drain naturally while the UI
is already unlocked for user input.
When the global chat pane is opened, the textarea is now automatically
focused so users can immediately start typing without needing to click
on the input field first.
Check for finish_reason in stream chunks to detect when the AI has
finished generating content, and release isLoading immediately rather
than waiting for the stream connection to fully close.
- Added "x" button that appears when hovering over the chat button
- Clicking "x" temporarily hides the button until page navigation or refresh
- Button no longer appears on /settings/* pages
- Reset hidden state when navigating to a different page
- Focus textarea immediately after sending message (not after AI response)
- Add useEffect to refocus textarea when isLoading becomes false
- User can now type their next message right away without clicking
- Scroll to bottom when chat opens using requestAnimationFrame
- Track userScrolledUp ref to detect when user manually scrolls up
- Auto-scroll follows streaming content by watching lastMessageContent
- Reset scroll tracking when clicking scroll-to-bottom button
- Reset scroll tracking when chat opens
- Only auto-scroll if user hasn't manually scrolled up to read history
Also reverted unintended changes to main ChatPane.tsx
- Add userScrolledUp ref to track when user manually scrolls away from bottom
- Auto-scroll to bottom only when user hasn't manually scrolled up
- Reset scroll tracking when clicking scroll-to-bottom button
- Reset scroll tracking when switching between projects
- Ensures new messages always scroll into view unless user is reading history
The parseProviderModel function returns { model, provider } but the code
was trying to destructure { providerId, modelId }. Fixed to correctly
use the actual return values and pass the required providers array
parameter to the function.
1. Fixed user message not appearing in global chat
2. Made project chat and global chat remember separate models
- Added separate localStorage storage for global chat model
- Project chat continues to use recentlyUsedModels from AISettings
- Global chat now stores its model independently
3. Moved Chat System Prompt setting from Preferences to System Settings
4. Removed chat pop-out functionality
- Removed isPoppedOut state from GlobalChatContext
- Removed handlePopOut function from GlobalChatPane
- Removed pop-out button from desktop chat header
- Removed isPoppedOut check from FloatingChatButton
- Add hasUnread state to track whether user has seen new messages
- Mark messages as read when chat is opened
- Mark as unread when assistant responds while chat is closed
- Change indicator from message count to simple dot for cleaner UX
The ModelSelector component uses useNavigate which requires Router context.
Move the floating chat components from App.tsx into AppRouter.tsx where
they have access to the BrowserRouter/HashRouter context.
- Add GlobalChatContext, GlobalChatProvider for managing chat state
- Create FloatingChatButton component with unread message indicator
- Create GlobalChatPane with desktop (floating panel) and mobile (full screen) views
- Features include:
- Streaming AI responses with markdown rendering
- Auto context trimming when messages exceed ~50k tokens
- Easy text copy from messages (hover to reveal copy button)
- Pop-out to separate window
- Minimize/dismiss functionality
- Clear chat history
- Mobile-optimized full-screen drawer
- Add settings in Preferences page:
- Enable/disable floating chat button
- Customize chat system prompt
- Add translations for all supported languages (en, pt, zh, ha, yo, ig)
- Integrate with existing AI provider configuration