- Manually add AI response to chatHistory after streaming completes
- Fix missing Hermes responses when reopening modal
- Update modal title to 'uncloseai.' with link to Nous Research Hermes
- Add comprehensive debugging for conversation history save/load
- Ensure proper history synchronization between modules
- Save selected voice to localStorage and restore on modal open
- Improve model selection restoration from localStorage
- Save settings panel open/close state
- Add console logging for settings changes
- Maintain user preferences across sessions
- Fix follow-up Hermes responses not showing when modal reopens
- Properly sync chatHistory between ui.js and chat.js modules
- Use getChatHistory() and updateChatHistory() for consistent state
- Ensure AI responses are saved and loaded correctly
- Add console logs to track which messages are being loaded and displayed
- Debug why Hermes messages might not be showing when modal reopens
- Log message details and chatBox append operations
- Help identify if issue is with loading, processing, or displaying messages
- Only generate intro message when no conversation history exists
- Save generated intro to chatHistory so it persists across modal opens
- Set up page context when loading existing conversation history
- Prevent intro from being regenerated every time modal opens
- Intro message now properly saved and reused like other messages
- Add sendMessageWithCustomHistory function to handle intro generation
- Fix TypeError: sendMessageWithHistory is not a function
- Custom function allows intro to use different system prompt than conversation
- Maintains streaming response for real-time intro generation
- Fixes intro message generation with proper API call handling
- Create specialized intro system prompt for 3-paragraph welcome generation
- Use separate conversation system prompt for follow-up questions
- Intro prompt: focused on generating structured welcome message
- Conversation prompt: optimized for answering questions about page content
- Use translation sendMessage for custom history in intro generation
- Maintain page context throughout conversation while separating concerns
- Use setSystemMessageAppend to add page context to system message
- All follow-up questions now have full page context available
- Update existing system message in chatHistory with page content
- Hermes can now reference specific details (like Nathan) in follow-up questions
- Maintains coherent conversation with proper page context throughout
- Provide full page content to Hermes instead of just preview
- Include complete page context in initial system message
- Tell Hermes to maintain context for future questions in conversation
- Enable Hermes to reference specific details, names, and topics from page
- Fix issue where follow-up questions lacked proper page context
- Should now be able to answer questions about Nathan and other page details
- Add play/pause TTS button to the generated intro message
- Include delete button for consistency with other AI messages
- Full pause/resume functionality for intro message TTS
- Intro message now has same interaction capabilities as chat responses
- Uses speakChatText for clean audio generation
- Use Hermes AI to generate page-specific welcome message
- Extract current page content and title for context
- Create 3-paragraph intro that acknowledges specific page content
- Show loading message while generating contextual intro
- Fallback to basic intro if generation fails
- Make intro relevant to what user is actually viewing
- Import chatHistory and sendMessage at top level instead of dynamic imports
- Use imported chatHistory directly in loadHistory and clearChat functions
- Ensure Hermes has proper conversation context when resuming chats
- Fix issue where Hermes responses weren't loading from conversation history
- Add debug logging to verify chat history synchronization
- TTS buttons now toggle between play (🔊), pause (⏸️), and loading (⏳) states
- Click once to generate and play audio
- Click again to pause playing audio
- Click third time to resume paused audio
- Audio automatically resets icon to 🔊 when playback ends
- Added to both new message and historical message TTS buttons
- Add speakChatText function that skips extractSpokenTokens preprocessing
- Chat messages are already clean text that don't need markdown/HTML cleanup
- Simplify chat TTS button handlers to use clean direct TTS approach
- Separate chat TTS from webpage TTS which needs content preprocessing
- Much faster and more reliable for chat conversations
- Use direct TTS API calls for chat and historical message TTS buttons
- Skip the extractSpokenTokens preprocessing that was causing failures
- Import TTS_API_URL and API_KEY constants for direct API access
- Maintain same audio result format for compatibility
- Fix chat TTS buttons not responding due to extractSpokenTokens hanging
- Sync loaded conversation history with chat.js module on modal open
- Clear chat history in both localStorage and chat.js module when clearing
- Make loadHistory async to properly await chat module import
- Ensure conversation continuity across page refreshes and modal sessions
- Add comprehensive logging for history synchronization
- Add proper error handling for browser auto-play restrictions
- Set button text correctly based on auto-play success/failure
- Add console logging for debugging auto-play behavior
- Gracefully handle cases where auto-play is blocked
- Save chat history to localStorage after each AI response
- Load complete conversation history with TTS buttons on modal open
- Add TTS and delete buttons to historical AI messages
- Ensure conversation continuity when reopening modal
- Add debugging logs for history save operations
- Add ID to voice select element for reliable access
- Fix TTS button click handler to find voice selection properly
- Add debugging logs for voice selection
- Use document.getElementById instead of variable scope
- Add subtitle showing uncloseai branding and current page title
- Display 'You are discussing: [page title]' context
- Maintain mobile-responsive header layout with title container
- Fix sendMessage iteration error by importing from chat module
- Add missing imports for storage functions (loadConversationHistory, clearConversationHistory)
- Fix function calls to use imported modules instead of window globals
- Include all features: model selection, voice selection, file upload, page reading, translation, conversation history, clear chat, TTS for responses
- Maintain collapsible settings panel for mobile optimization
- Full screen on mobile, centered modal on desktop
- Simple flex layout instead of complex grid
- Modern chat bubble design
- Auto-resizing input with proper mobile keyboard handling
- Minimal UI - only essential controls
- Better touch targets and mobile interactions
- Remove max-width: 800px that was forcing modal to be too wide
- Let modal use only 95vw to scale properly with viewport
- Should prevent overflow on smaller screens
- Add box-sizing: border-box to Hermes modal and content to prevent width overflow
- Add flex-wrap to TTS voice selection to prevent horizontal overflow
- Ensure all modal content respects 95vw width constraints
- Fix layout issues on mobile devices
- Remove automatic model dropdown creation that was breaking blog layout
- Update Hermes modal to use 95vw sizing like other modals
- Add showModal() and backdrop click handling for consistency
- Use transform-based centering for proper mobile positioning
- All modals now have consistent sizing and behavior
- Use 95vw x 95vh for both TTS and translate modals
- Remove complex mobile/desktop detection logic
- Keep elegant styling with borders and shadows
- Minimize whitespace while maintaining good design
- Works consistently across all screen sizes
- Make TTS and translate modals take full viewport on mobile (≤768px)
- Remove borders, shadows, and border-radius for native app experience
- Keep centered modal design with shadows on desktop (>768px)
- Improve mobile usability with maximum screen real estate
- Remove forced width/height constraints that broke modal appearance
- Keep transform-based centering to fix mobile viewport issues
- Let content determine modal size naturally for better visual design
- Preserve original styling while maintaining mobile compatibility
- Replace margin: auto with explicit centering using transform: translate(-50%, -50%)
- Use showModal() instead of modal.open for proper mobile behavior
- Add responsive sizing with 90vw width and proper max-width constraints
- Add backdrop click handlers for modal closing
- Add touch-action: manipulation for better touch responsiveness
- Fix both TTS and translation modals disappearing on small viewports
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Separate DOM creation from event handler setup in floating button
- Add self-contained click handler with multiple fallback methods
- Enable floating button in preview windows with UNCLOSEAI_SKIP_INIT flag
- Improve modal function detection with dynamic imports
- Add extensive debugging for button click issues
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Rename tokenizer.js to token_estimator.js to reflect its purpose
- Update import in translation.js
- Add development journal documenting NVIDIA 4090 performance metrics
- Create simplified BPE tokenizer based on tiktoken core logic
- Use real production metrics: 3,144 tokens/s prompt, 121 tokens/s generation
- Add accurate processing time estimates for translation ETA
- Add HTTP error checking for 404 endpoint issues
- Ensure models are loaded before translation attempts
- Add response validation with clear error messages
- Fix floating button DOM timing in preview windows
- Remove modal/dialog DOM from translation preview content
- Fix 404 errors by properly checking model registry for endpoints
- Enable floating button in preview windows with partial initialization
- Reverted the broken openTranslateModal function to a working state.
- Re-implemented the logic to correctly inject the <base> tag for relative paths and to ensure the translation notice is displayed correctly.
- Ran biome to format the code and ensure there are no syntax errors.
- The placeholder restoration logic now processes placeholders in reverse order, ensuring that nested content (like links within HTML tags) is restored correctly.