Commit Graph
1334 Commits
Author SHA1 Message Date
Alex Gleason ff692b752c Merge remote-tracking branch 'origin/main' into global-chat 2025-12-04 16:03:57 -06:00
Alex Gleason 5ce53fdcc0 Fix CI 2025-12-04 16:03:06 -06:00
Alex Gleason 2096c83b3c Let baseDomain be configured for Cloudflare and Deno Deploy 2025-12-04 00:17:11 -06:00
Alex Gleason bbb4a2534b Fix Deno Deploy so it works 2025-12-04 00:02:50 -06:00
Alex Gleason 5685c6f52f Fix Deno config in configUtils 2025-12-03 23:57:01 -06:00
Alex Gleason 12c4acf3d5 Add Deno Deploy adapter 2025-12-03 23:48:20 -06:00
Alex Gleason 77a648e77e Redesign inputs on other pages 2025-12-03 23:20:02 -06:00
Alex Gleason ff6932ecda Upload Cloudflare files in parallel 2025-12-03 23:11:15 -06:00
Alex Gleason 74b5f60df8 Improve Get Key inputs 2025-12-03 23:02:50 -06:00
Alex Gleason 6c4bd9bd7c Deploy to Cloudflare Workers instead of Cloudflare Pages 2025-12-03 22:57:12 -06:00
MK Fain c6a9ce2046 fix: auto-scroll in GlobalChatPane embedded mode
The scroll effects were checking `isOpen` which is false in embedded mode.
Now checks for either `isOpen` or `embedded` to enable auto-scrolling.
2025-12-03 22:30:54 -06:00
MK Fain ee784b149e hide Chat header in GlobalChatPane when mobile toggle is present
The header is redundant in mobile view since context is clear from the toggle button
2025-12-03 22:16:49 -06:00
MK Fain 093423ea0b simplify: use single icon button for Building/Chatting toggle
- 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)
2025-12-03 22:14:12 -06:00
MK Fain ed512c5d64 refactor(mobile): move Building/Chatting toggle into compose box
- 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
2025-12-03 22:06:51 -06:00
Alex Gleason 45061bfbb9 Merge remote-tracking branch 'origin/main' into cf 2025-12-03 22:05:31 -06:00
Alex Gleason 6ce25ad2a1 Add the missing headers to the OPTIONS response 2025-12-03 22:05:05 -06:00
Alex Gleason 1f896b2ab5 Merge remote-tracking branch 'origin/main' into cf 2025-12-03 22:04:33 -06:00
Alex Gleason ed7f60692d Allow PUT and PATCH through CORS proxy 2025-12-03 21:58:02 -06:00
MK Fain 395a7a76bb feat(mobile): improve GlobalChatPane behavior on mobile screens
- 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)
2025-12-03 21:57:41 -06:00
MK Fain 075495fe7c Move Chat System Prompt to AI Settings and add Shakespeare context
- 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
2025-12-03 21:42:58 -06:00
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
Alex Gleason cc8a02a564 Fix Cloudflare config persistence 2025-12-03 21:21:30 -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
Alex Gleason 9017c5c382 Fix Cloudflare deploy 2025-12-03 20:53:04 -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
Alex Gleason 3f3ac26c65 Fix account ID URL 2025-12-03 20:28:33 -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
Alex Gleason fef40abcae Improve input external link hover style 2025-12-03 20:09:47 -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
Alex Gleason b345145ad3 Improve design of "Get Key" inputs 2025-12-03 20:02:50 -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 46db6542aa Add Cloudflare deployment provider 2025-12-03 19:37:36 -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