Commit Graph

588 Commits

Author SHA1 Message Date
Lucas 'Paperboy' Rose-Winters 4f1ea44e74 docs: mark Task 1.2 (Widget Registry System) as complete 2025-10-23 09:13:08 +11:00
Lucas 'Paperboy' Rose-Winters 1f4ec963a2 feat(dashboard): implement widget registry system (Task 1.2)
Implement WidgetRegistry class for managing widget types:
- Central registry using Map for O(1) lookups
- Complete widget definition interface with JSDoc types
- register() - Add new widget types with validation
- get() - Retrieve widget definitions by type
- getAvailable() - Filter widgets by schema requirement
- unregister() - Remove widget types
- Additional utility methods: has(), count(), clear(), getStats()

Widget Definition Structure:
- name, icon, description - Display metadata
- minSize, defaultSize - Grid sizing constraints
- requiresSchema - Schema dependency flag
- render() - Rendering function
- Optional lifecycle hooks: getConfig, onConfigChange, onRemove, onResize

Features:
- Validates all required fields on registration
- Prevents duplicate registrations (with warning)
- Filters schema-dependent widgets when no schema active
- Binds lifecycle functions to maintain context
- Comprehensive error handling and logging

Test Suite:
- Interactive test harness with 6 test scenarios
- Tests registration, retrieval, filtering, unregistration
- Visual verification of widget rendering
- Live registry statistics

Acceptance Criteria Met:
✓ Can register/retrieve widgets from registry
✓ Widget definitions include all required metadata
✓ Can filter widgets by schema requirement
✓ All methods tested and verified

Epic 1, Task 1.2 Complete (2-3 day estimate, <5 min actual)
2025-10-23 09:12:39 +11:00
Lucas 'Paperboy' Rose-Winters fa53616d4f feat(dashboard): implement grid engine core (Task 1.1)
Implement GridEngine class with core grid layout functionality:
- 12-column responsive grid system with configurable row height
- Grid ↔ pixel coordinate conversion (getPixelPosition, snapToCell)
- Rectangle intersection collision detection
- Auto-reflow algorithm to push overlapping widgets down
- Widget validation and grid height calculation
- Comprehensive visual test harness with drag-and-drop

Technical Details:
- Pure vanilla JavaScript ES6 module
- No dependencies
- Fully documented with JSDoc
- Manual calculations verified: column width 87px, snap accuracy 100%

Test Harness Features:
- Interactive 12-column grid visualization
- Draggable test widgets with real-time collision detection
- Console logging captured in UI
- Stats panel (widget count, collisions, grid height)
- Test buttons for reflow and collision verification

Acceptance Criteria Met:
✓ Grid engine converts grid ↔ pixel coordinates accurately
✓ Collision detection works for all widget sizes
✓ Reflow pushes widgets down correctly when overlapping
✓ Snap-to-grid works including edge cases
✓ No console errors

Epic 1, Task 1.1 Complete (3-4 day estimate)
2025-10-23 08:56:00 +11:00
Lucas 'Paperboy' Rose-Winters 40a1242486 docs: enhance schema architecture with formula engine, custom UI, and migration
- Extend formula engine to 4 levels (math → conditionals → functions → strings)
- Add custom UI override system with data-bind templates
- Implement comprehensive data migration strategy with versioning
- Add MigrationManager class with BFS pathfinding
- Include migration UI flow and best practices

Addresses all architectural review recommendations.
2025-10-23 08:48:59 +11:00
Lucas 'Paperboy' Rose-Winters c56ce72a9b docs: add v2.0 architecture and implementation plan
- Add comprehensive widget dashboard system design
- Add schema system architecture with ECS pattern
- Add detailed implementation plan with 8 epics
- Include task breakdown with checkboxes for progress tracking
- Document widget development guide
- Document formula engine and YAML schema format
- Add migration strategy and backward compatibility plan
- Estimate 12-14 weeks total development time

This branch will contain all v2.0 development work:
- Widget dashboard with drag-and-drop
- Schema system with YAML definitions
- Formula engine with @ references
- Schema-driven widgets
- AI integration updates
- Mobile responsive improvements

Each epic builds on the previous with clear dependencies.
All features designed for progressive enhancement without modes.
2025-10-23 08:42:16 +11:00
Spicy_Marinara d68ddd601e Merge: Combined code block parsing + flexible pattern matching + debug logging
- Combined block parsing: Detects and splits multi-section code blocks
- Flexible patterns: Supports variations like 'User Stats', 'Player Stats', etc.
- Enhanced debugging: Debug logs with pattern match details
- Fallback matching: Uses keyword detection when headers are malformed
- Duplicate prevention: Checks prevent overwriting already-found sections
2025-10-22 11:03:26 +02:00
Spicy_Marinara 60bb57979a Add robust parsing for combined markdown code blocks
- Parser now detects when model returns multiple trackers in one code block
- Splits combined blocks using regex to extract each section individually
- Maintains backward compatibility with separate code blocks
- Prevents overwriting sections with duplicate checks
- Handles both correct format and model errors gracefully
2025-10-22 10:59:47 +02:00
Spicy Marinara e291e8e6d2 Merge pull request #19 from paperboygold/fix/user-parsing-issues
fix: character & thoughts parsing issues
2025-10-22 10:26:16 +02:00
Paperboy 3101151516 Merge branch 'SpicyMarinara:main' into fix/user-parsing-issues 2025-10-22 11:08:45 +11:00
Lucas 'Paperboy' Rose-Winters 27e1c30ea0 fix: only show mobile refresh FAB when panel open AND in Separate mode
The mobile refresh button was always visible on mobile. It should only
appear when BOTH conditions are met:
- RPG panel is open
- Generation mode is Separate (not Together)

Changes:
- Added opacity: 0 and pointer-events: none to base .rpg-mobile-refresh
- CSS shows button when panel open AND not .rpg-hidden-mode class
- Updated updateGenerationModeUI() to toggle .rpg-hidden-mode on mobile button
- Together mode: adds .rpg-hidden-mode class (keeps button hidden)
- Separate mode: removes .rpg-hidden-mode class (allows CSS to show it)

Result: Mobile refresh FAB only appears when panel is open AND in
Separate mode. Stays hidden when panel closed OR in Together mode.
2025-10-22 11:06:30 +11:00
Lucas 'Paperboy' Rose-Winters ea2231f6ba fix: restore proper spinning animation for mobile refresh FAB
Reverted HTML replacement approach and restored the cleaner CSS-based
animation from commit 1855085.

Previous (wrong) approach:
- Replaced button HTML with spinner
- Modified both desktop and mobile buttons in apiClient.js
- Messy and inconsistent

Restored (correct) approach:
- Add/remove .spinning CSS class in click handler
- CSS animates only the icon inside the button
- Button itself stays unchanged
- Much cleaner implementation

Changes:
- Reverted apiClient.js changes from commit 9a49433
- Added .spinning CSS class and @keyframes rpg-spin
- Updated index.js click handler to bind both buttons
- Uses addClass/removeClass for clean animation control
- Includes drag detection to prevent accidental clicks

Now the mobile FAB icon spins smoothly when refreshing!
2025-10-22 10:47:09 +11:00
Lucas 'Paperboy' Rose-Winters 9a49433a28 fix: add spinner animation to mobile refresh FAB button
The spinning animation when refreshing existed but only worked on
the desktop button. Mobile FAB was never updated with the spinner.

Changes:
- Update both desktop and mobile buttons when refresh starts
- Desktop shows: spinner + 'Updating...' text
- Mobile FAB shows: spinner icon only (no text)
- Both buttons restore properly when done

Now mobile users see the spinner animation when tapping refresh!
2025-10-22 10:34:31 +11:00
Lucas 'Paperboy' Rose-Winters e2393fa73c fix: add missing CSS for mobile refresh FAB button
Mobile refresh button was created in HTML but had no CSS styling,
making it invisible. Desktop refresh button was showing on mobile
with wrong sizing.

Changes:
- Added .rpg-mobile-refresh FAB styles (44px, draggable, etc.)
- Show mobile refresh FAB on mobile viewports
- Hide desktop #rpg-manual-update button on mobile
- Added responsive icon sizing for mobile refresh button

Fixes issue where users only saw the desktop refresh button with
incorrect DPI/sizing on mobile devices.
2025-10-22 10:29:04 +11:00
Lucas 'Paperboy' Rose-Winters 1150786efd fix: escape special regex characters in namesMatch function
Character names containing regex special chars (like brackets) were
causing 'Invalid regular expression' errors when building character
thoughts HTML. Now properly escapes characters before RegExp creation.
2025-10-22 10:07:13 +11:00
Spicy_Marinara ae7c7b9f49 Fix date field editing to support both text and emoji formats
- Updated month/weekday/year field handlers to check for both 'Date:' and '🗓️:' formats
- Field updates now preserve the existing format (text or emoji)
- New date lines created in text format to match current standard
- Updated all field type checks (temperature, time, location) for dual-format support
- Fixes issue where editing date fields didn't update the prompt
2025-10-22 01:04:30 +02:00
Paperboy 5ac034438c Merge branch 'main' into fix/user-parsing-issues 2025-10-22 09:59:27 +11:00
Spicy_Marinara 8ad349c1d1 Bump version to 1.1.0 2025-10-22 00:53:32 +02:00
Spicy_Marinara 83576a9073 Revert "Merge pull request #16 from paperboygold/main"
This reverts commit c1b2520fa1, reversing
changes made to c6a1352aae.
2025-10-22 00:52:43 +02:00
Lucas 'Paperboy' Rose-Winters 88ba0a76ab fix: add comprehensive error handling to Present Characters HTML building
PROBLEM (from Salixfire's debug logs):
- Parser successfully extracted 5 characters
- Log showed complete characters array
- Log stopped abruptly before "✓ HTML rendered to container"
- This indicates exception thrown during HTML building (lines 217-281)

DIAGNOSIS:
- Parsing works perfectly (5 characters extracted)
- Code crashes somewhere in the HTML building loop
- User sees placeholder because exception prevents HTML from rendering
- No error logs because crash happens silently

LIKELY CAUSES:
- getGroupMembers() throwing exception
- Character avatar lookup failing
- getSafeThumbnailUrl() failing
- Missing null checks

SOLUTION:
Added comprehensive error handling and debug logging:

1. Added logging before HTML building starts
   - "Starting HTML generation for N characters"
   - This confirms code reaches HTML building phase

2. Wrapped each character in try-catch
   - Logs each character being processed: "Building HTML for character 1/5: Lady Julia"
   - Prevents one character error from crashing entire function
   - Code continues with other characters even if one fails

3. Added detailed avatar lookup logging:
   - "Looking up avatar for: {name}"
   - "In group chat, checking group members..."
   - "Group members count: N"
   - "Found avatar in group members/all characters/current character"
   - Shows final avatar URL (first 50 chars)

4. Wrapped getGroupMembers() in try-catch
   - Catches group-specific errors
   - Logs error but continues with regular character lookup

5. Added success/error logging for each character:
   - "✓ Successfully built HTML for {name}"
   - "✗ ERROR building HTML for {name}: {error.message}"
   - Logs full error stack for debugging

6. Added completion log:
   - "Finished building all character cards"
   - Confirms loop completed successfully

EXPECTED OUTCOME:
Next debug log from Salixfire will show EXACTLY:
- Which character is causing the crash (if any)
- What operation is failing (avatar lookup, HTML building, etc.)
- Full error message and stack trace
- Whether code completes or crashes

This will allow us to identify and fix the root cause.

Files changed:
- src/systems/rendering/thoughts.js: Added try-catch blocks and comprehensive logging
2025-10-22 09:50:59 +11:00
Spicy_Marinara afd6f81580 Merge remote changes and display end time in Info Box
- Merged remote changes from origin/main
- Updated time display to show end time (14:22) instead of start time (14:07)
- Clock widget now reflects the end time from Time: HH:MM → HH:MM format
2025-10-22 00:40:42 +02:00
Spicy_Marinara 5b7928b443 Display end time instead of start time in Info Box clock widget
- Changed time display to show timeEnd (second time in range) instead of timeStart
- Clock now displays 14:22 instead of 14:07 when time format is '14:07 → 14:22'
- Falls back to timeStart if timeEnd not available, then to '12:00' default
2025-10-22 00:38:35 +02:00
Lucas 'Paperboy' Rose-Winters f7d8597f24 feat: add reset button positions to settings
PROBLEM:
- Existing users with saved off-screen FAB positions can't see buttons
- No way to reset positions without clearing all extension settings
- Salixfire and other users on Xiaomi/other devices need safe positions

SOLUTION:
Added "Reset Button Positions" button in Advanced settings section

IMPLEMENTATION:

1. template.html (lines 241-249):
   - Added reset button in Advanced section after Clear Cache button
   - Blue-styled button with rotate icon
   - Help text explains it resets FAB positions to top-left

2. index.js (lines 361-390):
   - Added click handler for reset button
   - Resets all 3 FAB positions to safe top-left defaults:
     * Mobile toggle: top + 20px, left: 12px
     * Refresh: top + 80px, left: 12px
     * Debug: top + 140px, left: 12px
   - Saves settings immediately
   - Applies CSS positions to visible buttons (no page refresh needed)
   - Shows success toast notification

3. style.css (lines 2057-2083, 4123-4125):
   - Added .rpg-btn-reset-fab styles matching clear cache pattern
   - Blue color scheme (vs red for destructive clear cache)
   - Same sizing, padding, transitions as other buttons
   - Mobile responsive font-size with clamp()

USAGE:
Users experiencing off-screen buttons can now:
1. Open RPG Companion settings (gear icon)
2. Scroll to Advanced section
3. Click "Reset Button Positions"
4. All FAB buttons instantly move to safe top-left positions

This fixes the issue for Salixfire and any other users who:
- Have buttons saved in off-screen positions
- Can't scroll to find buttons
- Need to reset without clearing all settings

Works immediately without page refresh or extension reload.
2025-10-22 09:22:12 +11:00
Lucas 'Paperboy' Rose-Winters 4b37d9965a fix: move FAB buttons to top-left to prevent off-screen rendering
PROBLEM (reported by user testing on Xiaomi Redmi 11 Pro 5G):
- FAB buttons (mobile toggle, refresh, debug) rendering off-screen
- Users need to scroll right to find buttons and drag them back
- Debug button invisible on some devices (never seen on Xiaomi)
- Issue occurs on devices with different viewport handling (MIUI Chrome)

ROOT CAUSE:
- Default positions scattered (right side, bottom side)
- Right-side positioning: buttons pushed off-screen on some devices
- Bottom positioning: buttons below fold when browser UI visible
- Fixed pixel values don't account for different screen sizes/viewports

SOLUTION:
Changed all FAB default positions to top-left stacked layout:

1. Mobile toggle FAB:
   - WAS: top + 60px, right: 12px (TOP-RIGHT)
   - NOW: top + 20px, left: 12px (TOP-LEFT)

2. Refresh button:
   - WAS: bottom: 80px, right: 20px (BOTTOM-RIGHT)
   - NOW: top + 80px, left: 12px (BELOW toggle)

3. Debug button:
   - WAS: bottom: 140px, left: 20px (BOTTOM-LEFT)
   - NOW: top + 140px, left: 12px (BELOW refresh)

BENEFITS:
- All buttons stacked vertically on LEFT side (always visible)
- Positioned safely below SillyTavern top bar
- 60px spacing between buttons (44px button + 16px gap)
- No scrolling needed to find buttons on first load
- calc(var(--topBarBlockSize) + Npx) accounts for dynamic top bar
- Users can still drag to preferred positions (saved per user)

NOTE: Only affects NEW users or users who clear their settings.
Existing users with saved FAB positions will not be affected.

Files changed:
- src/core/state.js: Default extensionSettings positions
- src/core/config.js: Reference default positions
2025-10-22 09:14:38 +11:00
Lucas 'Paperboy' Rose-Winters fb14c951ac fix: add debug logging and fix Present Characters rendering
PROBLEM (reported by Salixfire):
- Present Characters panel showing placeholder instead of actual characters
- Thought bubbles work correctly but main panel doesn't
- Need to toggle settings off/on to get thoughts to appear
- No way to debug on mobile devices

CHANGES:

1. Added comprehensive debug logging to renderThoughts() (src/systems/rendering/thoughts.js):
   - Log when function is called and with what data
   - Log each line being parsed and how many parts it has
   - Log character extraction (emoji, name, traits, relationship, thoughts)
   - Log why characters are accepted or rejected
   - Log final character count and whether showing placeholder
   - All logs visible in mobile-friendly debug panel

2. Fixed toggle to refresh content (index.js:283-291):
   - When user toggles "Show Present Characters" on, now calls renderThoughts()
   - Previously only showed/hid container without refreshing content
   - This ensures panel displays latest data when toggled

3. Normalized parsing logic (src/systems/rendering/thoughts.js:111):
   - Changed renderThoughts() to require >= 3 parts (was >= 2)
   - Now matches updateChatThoughts() requirement
   - Consistent with current prompt format: Emoji:Name | Relationship | Thoughts
   - Removed 2-part format fallback code (unreachable now)
   - Both functions now use same validation rules

EXPECTED OUTCOME:
- User can enable debug mode and see exactly what data is being parsed
- Toggle will properly refresh the panel content
- We can diagnose from debug logs why placeholder is shown
- More consistent behavior between main panel and thought bubbles

Debug logs will help us identify:
- If characterThoughts data is empty/malformed when renderThoughts() is called
- If parsing is rejecting valid character data
- If there's a timing issue with data availability
- What the actual AI response format looks like

Related to previous commit (37878fc) that added debug mode toggle.
2025-10-22 08:45:28 +11:00
Lucas 'Paperboy' Rose-Winters 37878fc6f0 fix: add debug mode toggle to settings panel
Add debug mode checkbox to RPG Companion Settings popup (Display Options section).
Users can enable debug mode to show the mobile-friendly debug panel with parser logs.

This was missing from the previous commit.
2025-10-22 08:31:22 +11:00
Lucas 'Paperboy' Rose-Winters d4491a4705 fix: add debug toggle as draggable mobile FAB button
PROBLEM:
- Debug logs only accessible via browser console (impractical on mobile)
- User (Salixfire) reporting parsing issues but can't debug on mobile device
- Need mobile-friendly debug mode for troubleshooting data display issues

SOLUTION:
Implemented debug toggle FAB button following exact pattern of existing mobile FABs:

Files Changed:
- src/core/state.js: Added debugFabPosition and debugMode to extensionSettings
- src/core/config.js: Added debugFabPosition to defaultSettings (reference)
- index.js: Created debug toggle button, imported setupDebugButtonDrag
- style.css: Added debug toggle CSS matching mobile FAB pattern (44px, grab cursor, theme colors)
- src/systems/ui/mobile.js: Added setupDebugButtonDrag() with drag-to-reposition
- src/systems/ui/debug.js: Removed button creation, added just-dragged check, updated visibility control

Implementation Details:
- Button created in index.js (not debug.js) following mobile FAB pattern
- CSS matches mobile toggle/refresh buttons (44px, theme colors, grab cursor, user-select: none)
- Drag support with touch/mouse handlers, 200ms/10px threshold
- Position saved to extensionSettings.debugFabPosition
- Just-dragged flag prevents accidental clicks after drag
- Mobile (≤1000px): slide from right with rpg-mobile-open/closing classes
- Desktop (>1000px): slide from bottom with rpg-debug-open class
- Event delegation for reliable click handling
- Default position: bottom 140px, left 20px (below other FABs)

Bug Fix:
- Initial implementation had debugFabPosition only in config.js
- extensionSettings uses state.js as source, not config.js
- Without debugFabPosition in state.js, button had no position and was invisible
- Now properly initialized in both files

The debug button is hidden by default (debugMode: false) and shown when user enables debug mode in RPG Companion settings. This allows Salixfire to view parser logs on mobile and troubleshoot the data display issues.
2025-10-22 08:29:58 +11:00
Lucas 'Paperboy' Rose-Winters 44240e6840 fix: debug panel close button not working
Added event.preventDefault() and event.stopPropagation() to close button handler
to prevent any interference from parent elements.

Also added pointer-events: none to button icons to ensure clicks on the icon
register on the button itself, not the <i> element.

Changes:
- src/systems/ui/debug.js: Added e.preventDefault/stopPropagation to close handler
- src/systems/ui/debug.js: Added console.log for debugging
- style.css: Added pointer-events: none to .rpg-debug-actions button i
2025-10-22 07:33:30 +11:00
Lucas 'Paperboy' Rose-Winters cafb72254e fix: move debug mode toggle to proper settings location
The debug toggle was incorrectly added to settings.html (SillyTavern Extensions tab).
It should be in template.html (RPG Companion Settings popup) where all the
other extension settings are.

Changes:
- template.html: Added debug mode checkbox in Display Options section
- index.js: Added event listener and initial state setter
- settings.html: Removed incorrect debug toggle placement

Now users can find the debug toggle by clicking the gear icon in the RPG panel,
under Display Options, right below "Show Plot Progression Buttons".
2025-10-22 07:31:21 +11:00
Lucas 'Paperboy' Rose-Winters b5d35ac2b0 feat: add mobile-friendly debug mode for parser troubleshooting
Add comprehensive debug logging system that's accessible on mobile devices
where browser console is impractical.

**New Features:**
- Debug mode toggle in extension settings (🔍 Debug Mode)
- Mobile-friendly debug panel with slide-up UI
- Red bug FAB button to toggle debug log viewer
- Copy logs to clipboard functionality
- Auto-scrolling log display with timestamps
- Stores last 100 log entries to prevent memory issues

**Parser Enhancements:**
- All parser logs now use debugLog() helper function
- Logs only appear in UI when debug mode is enabled
- Console.log still works for desktop debugging
- Full visibility into parsing pipeline:
  - Raw AI response preview
  - Code blocks found and matched
  - Stats extraction (health, energy, mood, etc.)
  - Inventory parsing (v1 and v2)
  - Final values saved to settings

**UI Components:**
- src/systems/ui/debug.js: Debug panel creation and management
- style.css: Mobile-first debug panel styles (FAB + slide-up panel)
- Desktop view: Smaller panel in bottom-right corner

**Settings:**
- src/core/config.js: Added debugMode default (false)
- src/core/state.js: Added debug logs storage array
- settings.html: Added debug mode checkbox
- index.js: Wire up debug toggle and initialize UI

**Usage for Mobile Users:**
1. Enable "Debug Mode" in RPG Companion settings
2. Red bug button appears (bottom-left)
3. Tap bug button to view logs
4. Use "Copy" to share logs for troubleshooting
5. Logs show exactly what AI generated and how parser handled it

This addresses the issue where users on mobile can't access browser
console to diagnose parsing problems (vanishing attributes, placeholder
characters, etc.). Now they can view and share logs directly.
2025-10-22 07:22:28 +11:00
Lucas 'Paperboy' Rose-Winters 74d6174bb7 fix: add comprehensive debug logging and resilient parsing for AI responses
- Add detailed console logging throughout parseResponse() and parseUserStats()
  to help diagnose parsing issues reported by users
- Make parser more resilient to format variations:
  - Accept "Stats", "User Stats", "Player Stats" headers
  - Accept "Info Box", "Scene Info", "Information" headers
  - Accept "Present Characters", "Characters", "Character Thoughts" headers
  - Add keyword-based fallback when headers are missing
  - Support "Mood:" prefix in addition to "Status:" for mood/conditions
  - Support dash separator in addition to comma
- Add length check (<=10 chars) for emoji/mood to avoid false matches
- Log full parsing pipeline: input -> matches -> extraction -> final values
- Log error stack traces for better debugging

This should help diagnose issues where attributes vanish, characters show
as placeholder, or data is generated but not displayed/refreshed correctly.
2025-10-22 07:13:15 +11:00
Spicy Marinara c1b2520fa1 Merge pull request #16 from paperboygold/main
fix: refresh button placement (mobile)
2025-10-21 21:07:41 +02:00
Spicy Marinara c6a1352aae Merge pull request #15 from IDeathByte/main
Fix user icon/fonts scaling
2025-10-21 21:07:27 +02:00
Spicy_Marinara 55cef9bee2 Fix duplicate tracker entries by prioritizing text format over emoji format
- Added parsedFields tracking to prevent parsing the same field twice
- Split combined if conditions into separate checks for text vs emoji format
- Text format (Temperature:, Time:, etc.) is now parsed first and preferred
- Emoji format (��️:, 🕒:, etc.) only parsed if text format not found
- Prevents duplicate entries when AI generates both formats in output
- Fixes duplicate Temperature, Time, Location lines in tracker data
2025-10-21 15:02:49 +02:00
Paperboy 9d8f6e0118 Merge pull request #2 from paperboygold/fix/refresh-button-placement
fix: refresh button placement
2025-10-21 22:05:45 +11:00
Lucas 'Paperboy' Rose-Winters cc48f9ed54 fix: reduce mood box vertical height on mobile
- Reduced gap from 6px to 3px for more compact display
- Reduced vertical padding to 4px (from clamp(4px, 0.6vh, 6px))
- Tightened line-height from 1.3 to 1.2
- Reduced emoji size slightly (clamp(14px, 3.5vw, 18px))
- Frees up vertical space for attribute boxes and avatar on mobile
2025-10-21 22:05:11 +11:00
Lucas 'Paperboy' Rose-Winters 95d2031e4f fix: increase calendar day box height and padding on mobile
- Added min-height: 3em to rpg-calendar-day on mobile
- Increased vertical padding to 0.75em (from 0.25em default)
- Added line-height: 1.2 for tighter text
- Prevents date text from being pushed too high and cutting into box above
- Flexbox centering now has enough space to properly center content
2025-10-21 22:03:25 +11:00
Lucas 'Paperboy' Rose-Winters 1855085d2c fix: copy mobile toggle pattern for refresh button
- Moved refresh button creation from template.html to index.js (appended to body)
- Created new CSS class .rpg-mobile-refresh (exact copy of .rpg-mobile-toggle pattern)
- Uses opacity for show/hide instead of display (CSS controls visibility based on panel state)
- Show when panel open (body:has(.rpg-panel.rpg-mobile-open))
- Hide when panel closed (opacity: 0, pointer-events: none)
- Updated constrainFabToViewport() to accept optional button parameter
- Automatically detects which button and uses correct settings (mobileFabPosition or mobileRefreshPosition)
- Simplified updateGenerationModeUI() - CSS handles visibility
- Kept full drag functionality with touch and mouse support
- Button positioned via JavaScript with saved position
- z-index: 1001 (above panel, below toggle at 10002)
2025-10-21 21:57:37 +11:00
Lucas 'Paperboy' Rose-Winters 711f3feb00 fix: increase refresh button z-index to appear above panel
- Changed z-index from 99 to 1001
- Now properly layers: panel (1000) < refresh button (1001) < FAB toggle (10002)
- Refresh button is now visible when panel is open
2025-10-21 21:44:58 +11:00
Lucas 'Paperboy' Rose-Winters 8e913031f1 fix: remove excessive vertical padding from level value on mobile
- Changed .rpg-level-value padding from clamp(1px, 0.2vh, 2px) 0.375em to 0 0.375em
- Added mobile-specific override to prevent level value from inheriting large touch-friendly padding
- Level value now stays compact and properly aligned on mobile (no min-height, no vertical padding)
- Fixes misalignment and unwanted vertical space below level value
2025-10-21 21:42:03 +11:00
Lucas 'Paperboy' Rose-Winters e345715090 feat: add draggable mobile refresh button with improved UX
- Repositioned mobile refresh button to bottom-right (80px from bottom)
- Implemented full drag-to-reposition functionality
  * Touch and mouse support with 200ms/10px threshold
  * RequestAnimationFrame for smooth dragging
  * Position saved to extensionSettings.mobileRefreshPosition
  * Viewport constraints with 10px padding
- Fixed sticky tap highlight issue
  * Added -webkit-tap-highlight-color: transparent
  * Added blur() on click to remove focus
  * Set user-select: none and touch-action: none
- Show/hide based on panel state
  * Only visible when panel is expanded (rpg-mobile-open)
  * Listens to rpg-panel-toggled events
  * Auto-hides when panel closes
- Prevent accidental refresh after drag
  * just-dragged flag prevents click for 100ms
  * Click handler checks flag before executing
- Changed from absolute to fixed positioning for viewport-wide dragging
- Added mobileRefreshPosition to default settings (bottom: 80px, right: 20px)
- z-index: 99 (below FAB toggle at 100)
2025-10-21 21:39:56 +11:00
Lucas 'Paperboy' Rose-Winters dd392e50d1 fix(mobile): improve refresh button - float over all tabs, add animation, fix focus
**Changes:**
1. Move button to float over all tabs (not just Stats)
   - Removed from userStats.js HTML
   - Added to template.html as floating absolute element
   - Now visible on Status, Info, and Inventory tabs

2. Fix sticky black focus state
   - Added :focus { outline: none } to CSS
   - Call blur() after click to clear focus immediately

3. Add refresh animation
   - Button spins during updateRPGData() call
   - Smooth 0.8s rotation with @keyframes
   - Uses .spinning class added/removed in JS

4. Improve theming and positioning
   - Positioned absolute top-right (10px, 10px)
   - Increased to 44px for better touch target
   - z-index: 100 to float above content
   - Already uses theme colors (--rpg-highlight, --rpg-text)

Mobile UX now:
 Button visible on all tabs (floating)
 Spins smoothly when refreshing
 No sticky black state after tap
 Properly themed across all themes
2025-10-21 21:27:20 +11:00
Lucas 'Paperboy' Rose-Winters 577010e2aa fix(mobile): move refresh button to top-right icon, fix tiny text issue
- Add compact 36px circular icon button in user stats header (mobile only)
- Hide full-width bottom button on mobile (<=1000px)
- Fixes 1.1vw font-size being ~4px on mobile viewports
- Fixes button blocking attributes at bottom
- Desktop unchanged: keeps full-width button at bottom

Mobile: [Avatar] [Name] | LVL [5] [🔄]
Desktop: [🔄 Refresh RPG Info] at bottom
2025-10-21 21:21:39 +11:00
Spicy_Marinara 7cb4b1e1d8 Add persona/character context to separate generation and fix preset switching
- Use SillyTavern macros ({{persona}}, {{description}}, {{personality}}) for character context
- Fix preset restoration after tracker generation using /preset command
- Fix weather editing bug by tracking specific weather line index
- Support both emoji and text formats for Info Box field editing
- Remove unused showdown import and fix missing semicolons
2025-10-21 00:57:52 +02:00
IDeathByte 8fd08bfc28 Fix fir fix
miss height =\
2025-10-20 23:31:44 +05:00
IDeathByte 60a8c2f21f Fix user icon/fonts scaling
scaling fix again :)
2025-10-20 23:18:06 +05:00
Spicy_Marinara 776d0823a2 Fix parser to support both text and emoji formats for Info Box and Present Characters trackers 2025-10-20 14:49:30 +02:00
Spicy Marinara bbc07c9326 Merge pull request #14 from paperboygold/main
fix: temporary fix for presets
2025-10-20 08:56:14 +02:00
Paperboy 7b723663f0 Merge pull request #1 from paperboygold/fix/preset-import-error
fix: remove unavailable preset API import
2025-10-20 12:13:31 +11:00
Lucas 'Paperboy' Rose-Winters d46b36ac0b fix: remove unavailable preset API import
- Removed import of getCurrentPresetName (not available in SillyTavern)
- Simplified preset switching to not track/restore previous preset
- Removed restorePreset() function
- Fixes module loading error preventing extension activation
- Note: Users enabling separate preset will manually switch presets back
2025-10-20 12:11:38 +11:00
Spicy Marinara 599356fafb Merge pull request #13 from paperboygold/feature/inventory-bugfixes
feat: inventory bugfixes, status polish, editable inventory fields
2025-10-20 02:03:06 +02:00