Commit Graph
7 Commits
Author SHA1 Message Date
diodiogod 986093a207 Add character voice previews and improve alias manager drag feedback 2026-07-24 21:57:53 -03:00
diodiogod da223f49f7 Fix language code detection: load supported languages on module init
Ensure SUPPORTED_LANGUAGES in language-constants.js is populated with all 55 codes
before event handlers run, so isLanguageCode() works correctly. Prevents duplicate
language codes like [hr:|hr:|...] by properly detecting language codes vs parameters.
2025-10-31 18:38:58 -03:00
diodiogod 8e880592d3 Fix language dropdown persistence and character replacement with language prefix
1. Language dropdown selection now persistent - restore value AFTER options
   are loaded from API, not before (fixes race condition)

2. Character button now recognizes language-prefixed characters like
   [en:broom_salesman|seed:3] and replaces just the character part,
   producing [en:new_char|seed:3] instead of adding duplicate character
2025-10-31 18:11:12 -03:00
diodiogod 293229aaf7 Load language list dynamically from API endpoint
Changed from static getSupportedLanguages() to dynamic API fetch,
matching the character loading pattern. Now fetches from
/api/tts-audio-suite/available-languages with fallback to hardcoded list.
Adds console message when languages are loaded.
2025-10-31 17:52:50 -03:00
diodiogod 368ccd0dd4 Create language constants source of truth and fix language tag logic
- Added language-constants.js with API-driven language list (fallback to hardcoded)
- Added /api/tts-audio-suite/available-languages endpoint in __init__.py
- Updated widget-ui-builder.js to use getSupportedLanguages()
- Updated widget-event-handlers.js to use isLanguageCode() for detection
- Fixes issue where [seed:5|steps:3] now correctly becomes [de:|seed:5|steps:3]
  instead of [de:5|steps:3] by properly detecting language codes vs parameters
2025-10-31 17:48:06 -03:00
diodiogod fc79682b5f Add functional language tag button to TTS editor
Implements language tag insertion matching character/parameter buttons:
- Inserts [lang:] or [lang:Character] tags at cursor
- Supports all 9 languages (en, de, fr, ja, es, it, pt, th, no)
- Modifies existing tags (replaces language in [lang:Char] format)
- Creates new tags when cursor not in tag
- Integrates with tag editor UI builder and event handlers
2025-10-31 17:28:45 -03:00
diodiogod b78cdbe2fc Refactor monolithic widget into modular architecture
Major refactoring to improve code maintainability:
- Reduced main widget file from 1677→900 lines (46% reduction)
- Extracted UI builders into separate modules:
  * widget-ui-builder.js (237 lines) - History, Character, Language, Validation sections
  * widget-parameter-section.js (237 lines) - Parameter controls with dynamic inputs
  * widget-preset-system.js (102 lines) - Preset management
- All original functionality preserved with identical behavior
- Parameter tag insertion now working with full event handler
- Note: Language selector currently only displays, doesn't auto-add to tags (design limitation)

Modules are properly organized with clear separation of concerns while maintaining all original logic and event handling.
2025-10-31 16:54:22 -03:00