Commit graph

172 commits

Author SHA1 Message Date
7063e382a9 feat: add copy buttons and user message delete, remove confirmation dialogs 2025-07-02 13:05:09 -04:00
f55e7e3ac4 feat: add ChunkFive font with absolute path and uncloseai branding to all modals 2025-07-02 12:45:09 -04:00
087e828583 refactor: rename hermes modal to uncloseai embedded modal 2025-07-02 12:33:34 -04:00
05cfcf2b95 fix(hermes): remove upload button from modal 2025-07-02 12:16:25 -04:00
2048e25cd5 fix(hermes): ensure AI responses are saved to conversation history
- 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
2025-07-02 10:11:51 -04:00
76e168cecf feat(hermes): restore localStorage for model and voice settings
- 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
2025-07-02 09:56:24 -04:00
de112973e6 fix(hermes): sync conversation history between ui.js and chat.js modules
- 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
2025-07-02 09:54:33 -04:00
8d8ee38e96 debug(hermes): add logging to track conversation history display
- 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
2025-07-02 09:38:57 -04:00
ecae7e9b4c fix(hermes): save intro message to history and prevent regeneration
- 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
2025-07-02 09:26:32 -04:00
4486cec23b fix(hermes): create custom sendMessageWithCustomHistory function
- 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
2025-07-02 09:05:18 -04:00
4110a8130b feat(hermes): implement dual system prompts for intro vs conversation
- 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
2025-07-02 08:36:43 -04:00
712473f516 fix(hermes): set page context in system message for entire conversation
- 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
2025-07-02 08:34:51 -04:00
71a2c3d00d improve(hermes): enhance context setup for coherent conversations
- 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
2025-07-02 08:33:35 -04:00
3cbcd64e92 fix(hermes): add TTS and delete buttons to contextual intro message
- 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
2025-07-02 08:15:30 -04:00
e8bef319da feat(hermes): generate contextual intro message using LLM
- 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
2025-07-02 08:08:46 -04:00
051f589c4e fix(hermes): properly sync chat history with imported module
- 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
2025-07-02 08:03:01 -04:00
d8d4b2a47b feat(tts): add pause/resume functionality to chat TTS buttons
- 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
2025-07-02 08:01:00 -04:00
bab44f680b refactor(tts): create dedicated speakChatText function for chat messages
- 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
2025-07-02 07:58:24 -04:00
59aacd7954 fix(tts): bypass extractSpokenTokens for chat TTS buttons
- 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
2025-07-02 07:55:16 -04:00
a59b7a2395 fix(hermes): properly sync chat history between modal and chat module
- 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
2025-07-02 07:42:54 -04:00
d996a1351b enhance(tts): improve auto-play handling with browser policy support
- 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
2025-07-02 07:36:04 -04:00
831f91e585 fix(hermes): resolve const actions redeclaration error
- Rename second actions array to controlActions to avoid variable conflict
- Fix SyntaxError: redeclaration of const actions
2025-07-02 07:30:46 -04:00
a8ef25ef6c fix(hermes): persist conversation history across modal sessions
- 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
2025-07-02 07:29:04 -04:00
8651aaa54a fix(hermes): make TTS button responsive on AI messages
- 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
2025-07-02 07:24:28 -04:00
af580c67ac feat(hermes): restore page context in modal header
- Add subtitle showing uncloseai branding and current page title
- Display 'You are discussing: [page title]' context
- Maintain mobile-responsive header layout with title container
2025-07-02 07:22:00 -04:00
2a8e020f9c fix(hermes): remove duplicate action buttons 2025-07-02 07:20:16 -04:00
f7241e0d0d fix(hermes): complete mobile-first modal with all features
- 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
2025-07-02 07:14:05 -04:00
532de5519f fix: template literal syntax errors in hermes modal 2025-07-02 07:03:14 -04:00
3b2f1acf86 feat: complete mobile-first hermes modal redesign
- 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
2025-07-02 07:01:17 -04:00
e972cbfd0a wip: start mobile-first hermes modal redesign 2025-07-02 06:51:16 -04:00
24c696638c fix(hermes): prevent modal overflow, only chat area scrolls 2025-07-01 22:25:34 -04:00
06ce02bc29 fix(hermes): remove max-width constraint from hermes modal
- 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
2025-07-01 22:19:29 -04:00
42c3246684 fix(mobile): prevent modal overflow issues
- 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
2025-07-01 22:12:39 -04:00
ec9853be45 fix(ui): remove unwanted model dropdowns and standardize hermes modal
- 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
2025-07-01 22:04:21 -04:00
525a4317b8 fix(mobile): simplify modal sizing with 95% viewport usage
- 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
2025-07-01 21:58:19 -04:00
ef9919ce84 feat(mobile): full-screen modals on mobile devices
- 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
2025-07-01 21:49:53 -04:00
bdd33652a3 fix(ui): restore natural modal sizing while keeping mobile positioning
- 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
2025-07-01 21:44:46 -04:00
88644403b6 fix(mobile): fix modal positioning and mobile support
- 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>
2025-07-01 21:38:57 -04:00
caaa347b35 fix(preview): separate button creation from initialization for preview windows
- 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>
2025-07-01 21:10:37 -04:00
5a05201fd9 fix(ui): correct import path for estimateProcessingTime function
Import estimateProcessingTime from translation.js instead of token_estimator.js
where it's actually defined
2025-07-01 20:46:24 -04:00
fc22c4a60d fix(translation): wait for preview document.body before adding notice
Prevents 'previewWindow.document.body is null' error by polling
until body is available before appending the AI functionality notice
2025-07-01 20:42:23 -04:00
9e6bbe4b19 refactor: rename tokenizer to token_estimator for clarity
- Rename tokenizer.js to token_estimator.js to reflect its purpose
- Update import in translation.js
- Add development journal documenting NVIDIA 4090 performance metrics
2025-07-01 20:31:07 -04:00
2845bb16d8 feat(tokenizer): add BPE tokenizer with real vLLM 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
2025-07-01 20:26:23 -04:00
796887fb38 fix(translation): open preview in new tab with full browser controls
Remove popup window restrictions to provide better user experience
with address bar, navigation buttons, and other browser features
2025-07-01 20:00:05 -04:00
9df24f7935 fix(ui): make floating button functional in preview windows
Move global scope exports before skip init check so toggleHermesModal
and other functions are available for button click handlers
2025-07-01 19:57:58 -04:00
02fff63f73 fix(translation): improve error handling and preview functionality
- 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
2025-07-01 19:56:26 -04:00
2e8fa6e30b fix(translation): resolve preview issues and endpoint errors
- 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
2025-07-01 19:44:12 -04:00
7854715ecb fix(translation): implement skip init flag to prevent duplicate JS executions 2025-07-01 19:30:29 -04:00
17e3883bff fix(translation): correct syntax and logic in translation modal
- 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.
2025-07-01 18:23:02 -04:00
206731c589 fix(translation): restore nested placeholders correctly
- The placeholder restoration logic now processes placeholders in reverse order, ensuring that nested content (like links within HTML tags) is restored correctly.
2025-07-01 17:53:10 -04:00