- Select text and click tag buttons to prepend tags to selection
- If selection starts with a tag, modify it instead of creating new one
- Detects leading whitespace and positions caret correctly inside bracket
- Works for character, language, and parameter buttons
- All existing tag logic (checks, updates, etc) still applies
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.