Commit graph

141 commits

Author SHA1 Message Date
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
c3b5c94497 fix(translation): ensure CSS and JS work in preview
- The translation preview now includes the full HTML document, ensuring that stylesheets, scripts, and other resources are loaded correctly.
- A <base> tag is injected into the preview to handle relative resource paths.
- Removed a script flag that was incorrectly disabling JavaScript in the translated page, which fixes the issue with dialog boxes not appearing.
2025-07-01 17:49:33 -04:00
7aeba010d6 modified: src/ui.js 2025-07-01 17:31:56 -04:00
fb38570227 modified: src/ui.js 2025-07-01 17:29:27 -04:00
9a71e71873 Add DOCTYPE html and inject uncloseai.js script into preview window 2025-07-01 17:03:50 -04:00
c78a6a231f Auto-open preview window immediately when HTML translation completes 2025-07-01 16:56:48 -04:00
b1ea03fe21 Enhance popup preview with base URL and AI functionality support 2025-07-01 16:51:45 -04:00
4fa252f73d Replace iframe with popup window for HTML translation preview 2025-07-01 16:48:40 -04:00
fad29c828b Add HTML preview with iframe rendering for translations 2025-07-01 16:39:57 -04:00
5d0f299b39 Increase translation limits: 70k max_tokens and 50k content length 2025-07-01 16:33:43 -04:00
6e4770c07e Fix script tag preservation and increase translation content limit 2025-07-01 15:40:39 -04:00
bd09659d3b Implement minimal translation system prompt following Russell's approach 2025-07-01 15:32:12 -04:00
12662d67c9 Add: Translation as standalone feature and in 'full' feature set
- Add createTranslateFeature() function for standalone translate button
- Include 'translate' in custom interface feature switch
- Add translate-only demo section with live example
- Update documentation to show translate in available features
- Translation now works as data-features='translate' or part of 'full'
- Update table of contents and section numbering
2025-07-01 13:09:40 -04:00
7386dd0032 Fix: Proper code block preservation to prevent comment translation
- Track placeholder types and content separately
- Use exact placeholder matching in restoration
- Strengthen prompt with CRITICAL warning about placeholders
- Prevent JavaScript comments from being translated inside code blocks
- Ensure code blocks remain completely unchanged during translation
2025-07-01 12:54:00 -04:00
af50d0823f Update: Use real Hermes-supported language list and Russell's placeholder technique
- Update to 19 languages actually supported by Hermes 3 model
- Match Russell's placeholder naming: __CODE_X__, __URI_X__, __HTML_X__
- Use exact preservation technique from translate_content.py
- Add Bengali, Urdu, Indonesian, Swahili, Marathi, Telugu
- Include Traditional Chinese (zh-tw) support
- Match Team Hermes implementation approach
2025-07-01 12:42:55 -04:00
0fc73e4e33 Add: Omni-directional translation feature with code block preservation
- Add translation.js with 20+ language support
- Implement code block, URL, and HTML tag preservation during translation
- Add translation modal with page translation and custom text modes
- Integrate translation button in all interfaces
- Add translation demo section with live examples
- Support Russell's approach of preserving technical content during translation
- Enable translation of current page content or custom text
2025-07-01 12:35:09 -04:00
061a04f1fe Improve: TTS buttons auto-play with proper state transitions (processing -> pause -> play) 2025-07-01 12:17:27 -04:00
340241c886 Fix: Filter system messages when loading from localStorage to handle legacy data 2025-07-01 10:40:58 -04:00
f13fc85d21 Fix: Remove system message display from file upload functionality 2025-07-01 10:27:52 -04:00
b9d52dc727 Fix: Remove await from non-async context that broke floating button 2025-07-01 10:15:36 -04:00
7e5fa104ca Fix: Hermes modal conversation state and add system message customization
- Fix modal conversation persistence between sessions
- Fix system messages appearing in DOM by filtering display
- Add configurable system message with setSystemMessageAppend()
- Reorganize demo.html with table of contents and code-example pattern
- Add comprehensive documentation for system message customization
- Make all code blocks open by default in demo page
2025-07-01 10:07:12 -04:00
d327d98f77 feat: Restore TTS Anything modal with speed slider and voice selection 2025-06-30 22:17:17 -04:00
d9185376e7 Improve: Add loading state to floating button and optimize modal opening speed
- Show 'loading...' text in floating button while modal opens
- Display modal immediately with loading placeholders
- Load models and Hermes intro asynchronously after modal appears
- Prevent blocking UI during slow network operations
2025-06-30 21:34:46 -04:00
57e29252cb Fix: Move fetchModelsFromEndpoints import to top level to prevent initialization error 2025-06-30 21:12:29 -04:00
ebb316fcf1 Fix: Add Hermes introduction and ensure modal dropdown is populated
- Add dynamic Hermes introduction generation when modal opens
- Fetch models directly in modal instead of copying from existing dropdown
- Fix empty dropdown issue by ensuring models are loaded before display
- Add page-specific intro caching and fallback handling
2025-06-30 21:10:16 -04:00
f455f17fa3 Fix: Make modal functions async to support dynamic imports 2025-06-30 20:57:50 -04:00
195cb3f864 Fix: Resolve model selection and UI issues in modular version
- Fix model dropdown to return correct model names instead of full unique IDs
- Replace problematic DOM traversal in TTS buttons with proper event handlers
- Prevent model dropdown creation on pages without chat interfaces
- Restore full-featured Hermes modal from original implementation
- Add comprehensive modal with model/voice selection, action buttons, and chat interface
- Include conversation history management and message deletion functionality
2025-06-30 20:53:28 -04:00
01df4d1e77 new file: src/chat.js
new file:   src/config.js
	new file:   src/content.js
	new file:   src/file-upload.js
	new file:   src/models.js
	new file:   src/page-reader.js
	new file:   src/storage.js
	new file:   src/tts.js
	new file:   src/ui.js
	modified:   uncloseai.js
	new file:   uncloseai.js.orig
2025-06-30 20:28:42 -04:00
2fed53f74b Enhance demo page with comprehensive isolated examples and integration snippets 2025-06-30 20:07:14 -04:00
7a6996bc30 Fix: Expose uncloseai.js functions to global scope
Exposed , , , , , , , , , and  functions to the global  object. This resolves  issues when these functions are called directly from HTML  attributes, particularly in .
2025-06-30 19:03:22 -04:00
a5fd6902ba Docs: Document UNCLOSEAI_FLOATING_BUTTON in index.html and demo.html
Updated index.html to correctly show the script tag for disabling the floating button. Also added the same documentation to demo.html for consistency.
2025-06-30 18:42:15 -04:00
f8a146f241 Feat: Implement per-page conversation history and ensure per-page Hermes intro caching.
This commit introduces a  function to generate unique localStorage keys based on the current page's URL. This key is now used for storing and retrieving conversation history, ensuring that each page maintains its own isolated chat thread. The Hermes introduction already uses a content-based hash for per-page caching, and this change aligns the conversation history with that behavior. Additionally, clearing the conversation history now only affects the current page and correctly repopulates the Hermes introduction for that page.
2025-06-30 18:28:24 -04:00