Commit graph

283 commits

Author SHA1 Message Date
f0d27bbbef fix: reduce modal width and enforce max-width constraint
Changed desktop modal width from 90vw to 70vw and added \!important
to max-width to ensure modal doesn't fill entire screen on large displays.
2025-07-09 14:26:03 -04:00
de9eeffe70 fix: prevent modal from filling full screen on laptops
Changed mobile detection threshold from 768px to 480px to ensure
centered modal behavior on desktop/laptop screens while preserving
full-screen experience on actual mobile devices.
2025-07-09 10:00:45 -04:00
72c73b9a99 fix: reorganize Python and Node.js examples under Hermes AI Model section
- Changed Node.js Examples from h2 to h3 to be subsection under Using the Hermes AI Model
- Updated table of contents to group all Python and Node.js examples under main Hermes section
- Improved logical document structure with consistent hierarchy
- All AI model examples now properly organized under single main section

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04 15:59:20 -04:00
98996476a8 fix: enhance table of contents visual hierarchy with custom CSS
- Added distinct bullet styles (disc for main, circle for sub-items)
- Implemented proper indentation with padding and margins
- Added subtle left border for nested sections using theme color
- Differentiated font sizes between main sections and subsections
- Improved line height and spacing for better readability
- Maintains PicoCSS compatibility while clearly showing hierarchy

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04 15:56:28 -04:00
d9569c77fe feat: complete table of contents and header structure overhaul
- Added comprehensive hierarchical table of contents with proper h2/h3 nesting
- Added missing section IDs to all headers for proper anchor navigation
- Restructured headers to use only h2 (main sections) and h3 (subsections)
- Organized content with logical grouping: Web Client, OpenAI Client, Hermes Model, Node.js, TTS
- Enhanced navigation with complete coverage of all sections and subsections
- Improved document structure and accessibility with semantic HTML

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04 15:53:57 -04:00
38054643d4 fix: use semantic HTML and PicoCSS styling for table of contents
- Changed from <section> to <aside> for proper semantic navigation
- Removed custom CSS overrides that conflicted with PicoCSS
- Simplified structure from nested ordered/unordered lists to flat unordered list
- Removed inline styling to let PicoCSS handle navigation appearance
- Improved accessibility and framework compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04 15:41:25 -04:00
d9b9b8a5c1 feat: add comprehensive table of contents to index page
- Added navigational table of contents with hierarchical structure
- Added missing section IDs for proper anchor linking
- Organized content into logical sections with subsections
- Included prominent link to demo page for interactive examples
- Improved page navigation and user experience

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04 15:25:02 -04:00
b9be6e512a fix: streamline quick start section and ensure consistent code-first demo structure
- Streamlined index.html quick start section to focus on one-line installation
- Fixed demo.html section ordering to consistently show code examples before live demos
- Corrected section 12 numbering (was duplicate section 11)
- Enhanced demo page user experience with proper code-then-demo flow

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04 15:11:17 -04:00
f79a66ddf0 feat: add comprehensive code documentation to Custom API Examples section 2025-07-04 14:43:51 -04:00
af7019f91b fix: make all code examples visible by default
- Add 'open' attribute to all <details> sections
- Ensure code examples are immediately visible to users
- No need to click to expand - documentation should be accessible
2025-07-04 14:36:30 -04:00
1bf4d26a8a feat: comprehensive demo page documentation improvement
- Add TTS modal button example with openTTSModal() function
- Add translation modal button example with openTranslateModal() function
- Add standalone read page button example with readPageWithHermes() function
- Reorganize all sections to show live examples first, then code examples
- Improve documentation flow: demo first, then implementation details
- Add detailed feature lists and best-use-case descriptions
- Provide multiple implementation options for each feature (widget vs modal vs API)
- Update table of contents to reflect new organization
- Make it easy for people to add widgets to any webpage with clear examples
2025-07-04 14:32:13 -04:00
c57d86c27f fix: properly load all widget functions for demo page
- Restore translate modal demo - it works fine on main app
- Add manual imports for openTranslateModal, openTTSModal, readPageWithHermes
- Ensure all widget functions are available globally for demo widgets
- Fix module loading issues that were causing "is not a function" errors
- Make translation modal work as isolated tool in demo
2025-07-04 14:24:52 -04:00
9148d26496 fix: completely remove smart translate dropdown from demo
- Comment out entire smart dropdown section - no point advertising broken features
- Simplify translation section to only show working translation modal
- Update section title from "Translation Options" to "Translation Modal"
- Change "Live Examples" to "Live Example" (singular)
- Clean up code examples to only show working translate feature
- Remove confusing "two ways to translate" messaging
2025-07-04 14:17:52 -04:00
61b4cb0d5c fix: disable non-working features in demo.html
- Remove file upload references from system message
- Comment out smart-translate feature examples (not working yet)
- Disable smart translate demo with "Under Development" styling
- Keep traditional translate modal working
- Style disabled features with greyed-out appearance
- Fix demo page to only show working functionality
2025-07-04 12:49:53 -04:00
ce7014e83a fix: resolve handleFileUpload ReferenceError while preserving upload code for future
- Restore handleFileUpload import in widget-library.js to fix ReferenceError
- Keep all upload functionality code intact for future development
- Disable upload features in demo.html with "Under Development" messaging
- Remove upload from feature button examples but preserve the code
- Style disabled upload demo with greyed-out appearance
- Fix demo page functionality while maintaining upload code for future fixes
2025-07-04 12:43:04 -04:00
38fdedb6a6 docs: enhance language support documentation and remove auto-detection claims
- Expand README language section with complete list of 19 supported languages
- Add native language names and language codes for each supported language
- Detail language features: manual selection, complete coverage, AI responses
- List comprehensive translation coverage areas (modals, buttons, messages, etc.)
- Update project structure to show language files with descriptions
- Remove auto-detection claims since feature is not working properly
- Change to accurate "manual selection" and "AI-powered translation"
- Fix demo.html to remove false auto-detection advertising

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04 12:31:53 -04:00
8c99a0316e fix: correct demo.html issues and update language count to 19
- Fix demo.html language count from 18 to 19 (verified by counting files)
- Remove "omni-directional" translation claims and use standard "Translation"
- Fix custom TTS example to use speakTextDirect instead of speakText (no Hermes preprocessing)
- Fix all demo functions to properly import modules dynamically
- Add missing imports for sendMessage, uploadFile, speakTextDirect, translateText
- Fix broken custom chat, TTS, file upload, page analysis, and translation examples
- Update README.rst and index.html language counts to accurate 19 languages
- Fix typo "transation" to "translation" in index.html

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04 12:28:15 -04:00
d7cc5531b8 feat: improve streaming completion detection and add syntax highlighting with copy buttons
- Detect when model streaming is complete in all streaming locations
- Add syntax highlighting (hljs) to code blocks after streaming finishes
- Add copy buttons to code blocks after highlighting is applied
- Prevent duplicate copy buttons with CSS class detection
- Optimize performance by doing syntax highlighting and copy buttons only once per message
- Apply improvements to both modal streaming and standalone chat
- Add copy buttons to intro message generation as well

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04 12:22:18 -04:00
41818a202b docs: add comprehensive README.rst and documentation sections to index.html and demo.html
- Created extensive README.rst with full project documentation
- Added brief documentation sections to index.html and demo.html
- Emphasized public domain licensing and open web philosophy
- Fixed branding to use lowercase uncloseai. and unturf.
- Points users to git repository for complete technical details

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04 12:13:15 -04:00
91f446f5ed Revert "fix: explicitly set white color for uncloseai logo text in PicoCSS light mode"
This reverts commit f50ccabcd1.
2025-07-04 12:03:57 -04:00
f50ccabcd1 fix: explicitly set white color for uncloseai logo text in PicoCSS light mode 2025-07-04 11:59:32 -04:00
b49e52678b Revert "fix: use original page content for title generation instead of processed TTS content"
This reverts commit b178e039b2.
2025-07-03 22:40:55 -04:00
b178e039b2 fix: use original page content for title generation instead of processed TTS content 2025-07-03 22:39:55 -04:00
7bb43c7613 fix: make dropdown text color conditional for PicoCSS and fix download button positioning to be next to play buttons 2025-07-03 22:32:44 -04:00
2e655a206b fix: make tab styling conditional - only apply custom CSS for blog version, let PicoCSS handle native styling 2025-07-03 22:20:55 -04:00
f4c39823b1 fix: add proper tab styling to replace bullet points with visual tab design 2025-07-03 22:17:40 -04:00
d8642675df update translate modal title from 'Translate Page' to 'Translate' across all 19 languages 2025-07-03 22:17:01 -04:00
375471e81a feat: replace button-based tabs with PicoCSS tab navigation in translate modal 2025-07-03 22:11:20 -04:00
d24b6fa1bb fix: use correct variable name targetLanguage instead of targetLanguageCode 2025-07-03 22:04:43 -04:00
28d0b516f1 fix: use exact tokenization in translate modal UI instead of rough estimate 2025-07-03 22:01:01 -04:00
e300a93545 fix: replace tokenInfo reference with roughTokenEstimate in translate modal 2025-07-03 21:49:44 -04:00
f53742a9d5 fix: tokenize actual prompt sent to AI instead of raw HTML and remove duplicate tokenization from modal 2025-07-03 21:46:22 -04:00
cda3455a22 fix: remove enforceModalTextColors function and set black text directly on textarea and dropdowns 2025-07-03 21:36:13 -04:00
a8de98a56a fix: improve tokenizer response parsing and force black text on all modal elements 2025-07-03 21:30:41 -04:00
04b062f3f8 fix: strip v1 from tokenize endpoint since it uses base URL not v1 API 2025-07-03 21:24:37 -04:00
5364b6c446 fix: revert v1 prefix from API endpoints to restore Read Page functionality 2025-07-03 21:20:14 -04:00
c2aa8f1fbd fix: ensure form elements have black text on white backgrounds 2025-07-03 21:18:58 -04:00
969dcbc31e fix: simplify modal text colors and add v1 prefix to API endpoints 2025-07-03 21:16:05 -04:00
29a6a82fa1 fix: enforce modal text colors to prevent white-on-white text issues
- Add enforceModalTextColors() function with high CSS specificity
- Use !important declarations to override blog CSS
- Force dark text (#212529) on inputs, buttons, and general content
- Keep white text on user messages for proper contrast
- Add user-message class to user messages for targeted styling
- Prevents unreadable white text on white backgrounds on blog
2025-07-03 21:11:05 -04:00
401d245fe4 CRITICAL FIX: trash buttons now properly update localStorage
- All delete buttons now call loadConversationHistory/saveConversationHistory
- Update both localStorage and chat.js module for consistency
- User message delete: filters by content match
- AI message delete: removes both user and AI messages in pair
- Historical message delete: removes by array index
- Intro message delete: filters by assistant role and content
- No more localStorage sync issues with deleted messages
2025-07-03 21:02:12 -04:00
933ad570ac feat: major TTS improvements for chat messages and Read Page
- Chat TTS now uses speakTextDirect (no Hermes preprocessing, faster)
- Add download buttons (💾) next to all TTS buttons after processing
- Download buttons use generateTitleForTTS for smart filenames
- Read Page download now uses title generator instead of document.title
- Download buttons appear for user messages, AI responses, and historical messages
- Fallback filenames if title generation fails
- All TTS processing is now direct without Hermes delay
2025-07-03 20:58:40 -04:00
cb88b2da38 debug: add error logging to sendMessage wrapper
- Add try/catch with detailed error logging
- Check if sendMessage exists in imported module
- Log module contents if function not found
- Helps diagnose 'sendMessage(...) is not iterable' error
2025-07-03 20:51:50 -04:00
0213a7e632 fix: improve TTS filename generation with strict prompt and fallback
- Enhanced system prompt: MUST generate title, NEVER refuse
- Clear instructions for edge cases (empty, inappropriate, nonsensical text)
- Added fallback logic if Hermes returns empty or refusal messages
- Fallback uses first 30 chars of text or 'audio-file' as last resort
- Ensures downloads always have a valid filename
2025-07-03 20:48:47 -04:00
46f74eab59 CRITICAL FIX: restore chat functionality - sendMessage must be generator
- Change sendMessage to async generator function with yield*
- Fixes 'Error: sendMessage(...) is not iterable' error
- Restores chat functionality in Hermes modal
2025-07-03 20:45:28 -04:00
20ed410ff0 fix: multiple improvements to TTS modal and language switching
- Fix TTS speed control: change default to 0.9, step by 0.05, max 2.0
- Apply playbackRate to audio element so speed actually works
- Add refreshModalUI() function to update UI when language changes
- Re-add upstream tokenizer API with simplified token counting
- Format token counts with commas (e.g., 8,432 tokens)
- Add getTokenCount() for simple integer token counts
- Language switching now refreshes modal UI without hard refresh
2025-07-03 20:42:11 -04:00
beab5d01a8 feat: reuse markdown extraction logic for TTS spoken tokens
- extractSpokenTokens now detects if input is already markdown format
- Updated prompt to handle both markdown and HTML input
- Added markdown to plain text conversion in prompt (bold, links)
- processContentWithHermes now delegates to extractSpokenTokens
- Consistent processing pipeline whether from Batman button or Read Page
- Better reuse of extractWebpageContent markdown format
2025-07-03 20:28:18 -04:00
4dc9568079 feat: improve extractSpokenTokens with JavaScript pre and post-processing
- Pre-clean HTML before sending to Hermes (remove scripts, styles, ads, iframes)
- Decode HTML entities (&nbsp; &amp; etc.) before Hermes processing
- Simplified, clearer system prompt focused on extraction tasks
- Post-process Hermes output with cleanTextForTTS() for final cleanup
- Reduces Hermes workload and improves extraction quality
- Three-stage pipeline: JS pre-clean → Hermes extraction → JS post-clean
2025-07-03 20:23:52 -04:00
17925537a6 feat: optimize TTS with direct processing for modal and Hermes for Read Page
- TTS modal now uses speakTextDirect() with simple JavaScript text cleaning
- No more Hermes preprocessing for modal text (faster, simpler)
- Read Page button still uses speakText() with Hermes for article extraction
- Reduced textarea height from 240px to 100px with vertical resize
- Added cleanTextForTTS() to remove markdown, HTML, and excess whitespace
- Modal gets instant TTS while Read Page gets intelligent content extraction
2025-07-03 20:20:59 -04:00
78ab413e8e fix: remove manual positioning from TTS modal for proper centering
- Remove top, left, and transform properties
- Let dialog element use native browser centering
- Fixes positioning issues across different viewports
- Cleaner solution that works better with dialog element
2025-07-03 20:14:35 -04:00
6cd16664f7 modified: src/tts-modal.js 2025-07-03 20:03:12 -04:00