Commit Graph
1308 Commits
Author SHA1 Message Date
MK Fain 5f76931941 Hide GlobalChatPane on settings pages
- 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
2025-12-03 21:22:47 -06:00
MK Fain 6527f42e2f Fix infinite reload loop in GlobalChatProvider
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.
2025-12-03 21:18:49 -06:00
MK Fain a42ea724fa Fix GlobalChatPane 3-second delay using loadingReleasedRef
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.
2025-12-03 21:17:07 -06:00
MK Fain ad217937a3 Fix GlobalChatPane input delay after AI response completes
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.
2025-12-03 21:14:45 -06:00
MK Fain 6457fbda76 Auto-focus textarea when GlobalChatPane opens
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.
2025-12-03 21:08:00 -06:00
MK Fain b78a912af1 Fix GlobalChatPane input delay after AI finishes responding
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.
2025-12-03 20:56:46 -06:00
MK Fain b1bbf58867 Change GlobalChatPane minimize button back to X icon 2025-12-03 20:53:37 -06:00
MK Fain ecf6b72b21 Fix close button z-index on FloatingChatButton
Moved close button to render after main button so it appears on top
and is clickable in the overlapping area
2025-12-03 20:49:37 -06:00
MK Fain 1b287b90aa Add hover close button to FloatingChatButton and hide on settings pages
- 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
2025-12-03 20:47:13 -06:00
MK Fain e9a6177c5b Replace minimize icon with minus icon in GlobalChatPane
Changed from Minimize2 to Minus icon for the minimize button
2025-12-03 20:43:04 -06:00
MK Fain 361b6dae3c Keep textarea focused in GlobalChatPane after AI responds
- 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
2025-12-03 20:40:05 -06:00
MK Fain 37071cde85 Fix GlobalChatPane (popup chat) auto-scroll behavior
- 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
2025-12-03 20:36:36 -06:00
MK Fain fc6ddbf8d6 Fix chat pane auto-scroll behavior
- 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
2025-12-03 20:30:22 -06:00
MK Fain e23c843ef9 Fix GlobalChatProvider parseProviderModel usage
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.
2025-12-03 20:10:18 -06:00
MK Fain 0c4de2e2c0 Fix global chat issues and move chat system prompt setting
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
2025-12-03 20:03:53 -06:00
MK Fain 477d055797 Improve unread message indicator for floating chat
- 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
2025-12-03 19:50:10 -06:00
MK Fain 15c8040e35 Fix: Move FloatingChatButton and GlobalChatPane inside Router
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.
2025-12-03 19:47:29 -06:00
MK Fain 68702abc41 Add floating global chat feature
- 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
2025-12-03 19:44:12 -06:00
Alex Gleason f41d70442a Prevent the Nostr settings dialog from refreshing 2025-12-03 17:06:29 -06:00
Alex Gleason 6f94aaa45e Allow editing t-tags on Nostr repos 2025-12-03 16:40:01 -06:00
Alex Gleason a2ffc7bf9c Display provider favicon in Add Provider dialog 2025-12-03 12:49:45 -06:00
Alex Gleason 4bc223e5af Revert "Merge branch 'text-chats' into 'main'"
This reverts commit 7badd0113f, reversing
changes made to 02dcd5cbe8.
2025-12-03 12:01:53 -06:00
Alex Gleason 2179c8fdce Revert "Don't display toast on own chat page"
This reverts commit 00b476085d.
2025-12-03 12:00:09 -06:00
Alex Gleason 00b476085d Don't display toast on own chat page 2025-12-03 02:47:11 -06:00
Alex Gleason 7badd0113f Merge branch 'text-chats' into 'main'
Text chats

See merge request soapbox-pub/shakespeare!79
2025-12-03 08:40:15 +00:00
Alex Gleason b3f47d41cb Don't use flexible sidebar in ChatView 2025-12-03 02:36:40 -06:00
Alex Gleason 8cf2b8a9d4 Display spinner for text chats 2025-12-03 02:31:13 -06:00
Alex Gleason f8743e3c63 Fix chat autostart 2025-12-03 02:25:28 -06:00
Alex Gleason ca0ae22cd3 Add start_project tool to text chats 2025-12-03 02:00:47 -06:00
Alex Gleason 01df64fce0 No useless escape 2025-12-03 01:53:05 -06:00
Alex Gleason 300fd26268 Add max width to text chats 2025-12-03 01:51:29 -06:00
Alex Gleason 0c42af082a Improve Chat Not Found design 2025-12-03 01:41:10 -06:00
Alex Gleason 4f552334b2 Allow deleting a chat 2025-12-03 01:40:28 -06:00
Alex Gleason bb9245118c Refresh sidebar when starting new chat, allow more characters in chat title 2025-12-03 01:33:34 -06:00
Alex Gleason 2c42efd4e1 Skip somethings for chats idk 2025-12-03 01:27:37 -06:00
Alex Gleason d3187d8c77 Improve chats icon 2025-12-03 01:11:39 -06:00
Alex Gleason ab039d2fb7 Text chats 2025-12-03 01:05:00 -06:00
Alex Gleason 02dcd5cbe8 Add Git Identity icon 2025-12-03 00:37:22 -06:00
Alex Gleason 69d8dfa9cd Add asterisks near required fields in Settings forms 2025-12-03 00:33:05 -06:00
Alex Gleason 43ad67b048 Add icons to Settings pages 2025-12-03 00:25:12 -06:00
Alex Gleason 5d1e2ddea0 Add "Vibed with Shakespeare" to system prompt 2025-12-02 20:29:53 -06:00
Alex Gleason e83ff56722 Fix CreditsDialog padding 2025-12-02 13:39:59 -06:00
Alex Gleason 56d9bca5c7 Increment the generated project id instead of falling back to untitled 2025-12-01 23:47:06 -06:00
Alex Gleason 89244d88e5 Fix updating templates 2025-12-01 23:34:06 -06:00
Alex Gleason 2096d526c4 Load skills from project dir in addition to plugins 2025-12-01 23:19:02 -06:00
Alex Gleason 367a6834eb typecheck fixes 2025-12-01 21:06:47 -06:00
Alex Gleason 9ede6bbd21 Provider name is a required field - backfill it when parsing config 2025-12-01 20:51:38 -06:00
Alex Gleason c1ad18bab7 Display nice model name in ModeleSelector if it's available 2025-12-01 17:52:18 -06:00
Alex Gleason 0e27c4d394 Display provider favicons instead of fullId in ModelSelector 2025-12-01 17:32:41 -06:00
Alex Gleason cd77a8edd5 Add background color to Nostr accounts in settings 2025-12-01 17:22:23 -06:00