897c0278fb
Features: - Complete tracker configuration UI with add/remove functionality - User Stats: Custom stats, status fields, skills section - Info Box: Configurable widgets (date, weather, temp, time, location, events) - Present Characters: Custom fields, relationships, character stats, thoughts - Character-specific stats with color interpolation - New multi-line format for cleaner AI generation and parsing - Auto-cleanup of placeholder brackets in AI responses - Relationship badges with emoji mapping - Advanced inventory v2 system with multi-location storage - Responsive mobile support with horizontal scrolling - Removed legacy format support for cleaner codebase - Fixed context injection for together mode (no duplication) - Updated README with new features and configuration guide
5.3 KiB
5.3 KiB
Tracker Customization Feature - Implementation Complete ✅
Summary
Implemented a comprehensive tracker customization system allowing users to fully customize what trackers display, track, and format.
What Was Implemented
1. Settings Schema (state.js)
- Added
trackerConfigwith three sections:userStats: customStats array, RPG attributes toggle, status section config, skills section configinfoBox: widget toggles (date/weather/temp/time/location/events), date format, temperature unitpresentCharacters: customFields array, character stats config
2. Edit Trackers Modal (trackerEditor.js - 600+ lines)
- Complete UI with 3 tabs: User Stats | Info Box | Present Characters
- User Stats Tab:
- Add/remove/rename custom stats
- Toggle RPG attributes (STR/DEX/CON/INT/WIS/CHA/LVL)
- Configure status section (enable/disable, mood emoji, custom fields)
- Configure skills section (enable/disable, custom fields)
- Info Box Tab:
- Toggle individual widgets (date, weather, temperature, time, location, recent events)
- Select date format (dd/mm/yy, mm/dd/yy, yyyy-mm-dd)
- Choose temperature unit (Celsius/Fahrenheit)
- Present Characters Tab:
- Add/remove/rename custom character fields
- Reorder fields with up/down buttons
- Select character stats to track
- Save/Cancel/Reset functionality
3. Migration System (persistence.js)
migrateToTrackerConfig()converts oldstatNamesto newcustomStatsformat- Auto-runs on settings load
- Ensures backward compatibility with existing user data
4. Dynamic Rendering
User Stats (userStats.js):
renderUserStats()loops through enabled customStats only- Conditionally renders:
- RPG attributes section
- Status section with optional mood emoji
- Skills section
buildUserStatsText()generates dynamic tracker text from config
Info Box (infoBox.js):
renderInfoBox()conditionally renders widgets based on toggles- Applies date format conversions
- Converts temperature between Celsius and Fahrenheit
- Maintains responsive CSS grid layout
Present Characters (thoughts.js):
renderThoughts()parses custom fields dynamically- Renders character cards with variable field count
- Relationship badge conditional on "Relationship" field existence
- Generic
.rpg-character-fieldclass for all custom fields
5. Dynamic Prompt Generation (promptBuilder.js)
generateTrackerInstructions()builds prompts fromtrackerConfig:- User Stats format from enabled customStats array
- RPG attributes line if enabled
- Status/Skills sections if enabled
- Info Box format with only enabled widgets
- Present Characters format with custom fields
6. Flexible Parsing (parser.js)
parseUserStats()updated to:- Parse custom stat names dynamically using regex
- Parse RPG attributes if enabled
- Parse status section with optional mood emoji
- Parse skills section if enabled
- Store stats using normalized IDs
7. UI Integration
- Added "Edit Trackers" button next to Settings button
- Modal HTML in template.html with tab navigation
- Complete CSS styling for all editor UI elements
- Mobile-responsive design
8. CSS Updates
- Added
.rpg-skills-sectionstyling - Added
.rpg-character-fieldgeneric styling - Updated
.rpg-settings-buttons-rowfor two-button layout - 300+ lines of tracker editor modal CSS
- Flexbox layouts auto-handle variable content counts
Files Modified
Core:
src/core/state.js- Added trackerConfig schemasrc/core/persistence.js- Added migration function
UI:
src/systems/ui/trackerEditor.js- NEW FILE (600+ lines)template.html- Edit Trackers button, modal HTMLstyle.css- Editor styling, new sections CSS
Rendering:
src/systems/rendering/userStats.js- Dynamic renderingsrc/systems/rendering/infoBox.js- Widget toggles, format conversionsrc/systems/rendering/thoughts.js- Custom fields rendering
Generation:
src/systems/generation/promptBuilder.js- Dynamic instructionssrc/systems/generation/parser.js- Flexible parsing
Integration:
index.js- Import and initialize tracker editor
Testing Checklist
- Open Edit Trackers modal
- User Stats Tab:
- Add/remove/rename stats
- Toggle RPG attributes
- Enable/disable status section
- Add custom status fields
- Enable/disable skills section
- Add custom skill fields
- Info Box Tab:
- Toggle each widget on/off
- Change date format
- Change temperature unit
- Present Characters Tab:
- Add/remove/rename fields
- Reorder fields
- Select character stats
- Save and verify:
- Panels update with new configuration
- AI receives correct prompt format
- AI response parses correctly
- Manual edits work
- Settings persist after refresh
Known Features
- Backward Compatible: Old settings automatically migrate to new format
- Fully Dynamic: All rendering adapts to user configuration
- Format Conversion: Automatic date format and temperature unit conversion
- Flexible Parsing: Handles variable stat names and field counts
- Mobile-Friendly: All UI elements responsive
- Validation: Prevents duplicate stat/field names
Ready for Testing!
All phases complete. Zero compilation errors. Ready to test in SillyTavern! 🎉