Commit Graph

143 Commits

Author SHA1 Message Date
Lucas 'Paperboy' Rose-Winters 3d32a04d57 feat: add smooth slide-out animation for mobile panel closing
Added matching slide-out animation when closing the mobile panel to
match the smooth slide-in animation on opening:

CSS changes (style.css):
- Add .rpg-mobile-closing class with rpgSlideOutToRight animation
- Create @keyframes rpgSlideOutToRight (0.3s ease-in-out)
- Panel slides smoothly off-screen to right before hiding

JavaScript changes (index.js):
- Add closeMobilePanelWithAnimation() helper function
- Use animationend event to wait for animation before hiding
- Replace all instant removeClass() calls with helper function
- Maintains smooth 0.3s animation timing matching slide-in

Implementation details:
- Helper function adds .rpg-mobile-closing class
- Waits for CSS animation to complete via animationend event
- Then removes closing class and overlay
- All close operations now use this helper for consistency

Result: Panel now smoothly slides in AND out with matching 0.3s
animations. No more jarring instant disappearance on close.
2025-10-16 12:33:07 +11:00
Lucas 'Paperboy' Rose-Winters c756704abc chore: simplify mobile tab label from 'Info & Characters' to 'Info' 2025-10-16 12:17:43 +11:00
Lucas 'Paperboy' Rose-Winters aef9cf812d feat: add smooth animation to thought icon scroll tracking
Improved thought icon behavior on mobile with smooth 60fps animations
matching the FAB button drag experience:

CSS changes:
- Add transition properties for top/left position changes
- Use 0.2s ease-out timing for smooth, natural movement
- Add will-change: top, left for browser rendering optimization
- Applied in mobile media query (@media max-width: 1000px)

JavaScript changes:
- Wrap position updates in requestAnimationFrame()
- Cancel pending RAF before scheduling new update (debouncing)
- Sync position updates with display refresh rate
- Same pattern as FAB button smooth drag implementation

Technical details:
- RAF throttling prevents layout thrashing
- CSS transitions handle the actual animation
- Combined approach gives 60fps smooth tracking
- Icon follows avatar smoothly during scroll on mobile

Result: Thought icon smoothly tracks avatar position during scroll
instead of jumping around, with buttery smooth 60fps animation.
2025-10-16 12:16:43 +11:00
Lucas 'Paperboy' Rose-Winters 9219fe3f19 feat: add smooth animation to mobile FAB drag behavior
Improved the mobile floating action button (FAB) drag experience with
smooth, performant animations:

- Use requestAnimationFrame to throttle position updates during drag
- Add will-change CSS property to optimize rendering performance
- Add dragging class to disable transitions during active drag
- Change cursor to grab/grabbing for better visual feedback
- Remove janky direct CSS updates in favor of RAF-based updates

Technical improvements:
- Position updates now synced to display refresh rate (~60fps)
- Prevents layout thrashing from excessive DOM manipulation
- Smooth transition animations when drag ends

Result: Dragging the FAB button now feels fluid and responsive on
mobile devices instead of laggy and jumpy.
2025-10-16 11:39:15 +11:00
Lucas 'Paperboy' Rose-Winters e342f4d100 fix: improve mobile UX for relationship badge and thought panel
Fixed two mobile UI issues:

1. Relationship badge sizing on mobile:
   - Badge was stretching vertically due to .rpg-editable mobile styles
   - Override padding, min-height, and line-height for badge on mobile
   - Keep badge at compact 18px × 18px to prevent covering avatar

2. Thought panel initial state:
   - Panel was showing by default instead of the icon
   - Fixed initialization: hide panel, show icon
   - Users now click the 💭 icon to open the dialogue as intended

Changes ensure proper mobile experience with appropriately sized UI
elements and correct initial visibility states.
2025-10-16 11:33:59 +11:00
Lucas 'Paperboy' Rose-Winters 60e371c726 fix: reposition 'Show thoughts' button above avatar on mobile
Previously, the thought icon button was positioned to the left of the
character avatar on mobile, causing it to appear partially off-screen
due to lack of left padding around avatars.

Changes:
- Add mobile-specific positioning logic in index.js to detect viewport
  width <= 1000px and calculate centered horizontal position
- Add CSS transform in mobile media query to shift icon 50px right
  and 45px upward from calculated position
- Center thought panel horizontally on mobile when opened
- Add debug logging to verify mobile detection

Result: On mobile, the thought icon now appears above and to the right
of the avatar, fully visible and accessible.
2025-10-16 11:25:38 +11:00
Lucas 'Paperboy' Rose-Winters f4f0ab1484 feat: add smart viewport constraint for mobile FAB button
- Add constrainFabToViewport() function with top-bar awareness
- Only constrains when mobileFabPosition exists (user has dragged button)
- Respects SillyTavern's top bar height via CSS variable
- Prevents button from being hidden behind UI elements
- Applies constraint after drag operations and window resize
- Remove verbose debug logging from drag/touch event handlers

This implements a state-driven approach where the constraint only activates
for user-positioned buttons, allowing CSS defaults to work naturally while
protecting custom positions from viewport changes.
2025-10-16 10:52:09 +11:00
Lucas 'Paperboy' Rose-Winters b73f6d31bc fix: correct mobile FAB chevron direction and reposition to left side
- Fix inverted chevron logic: show left arrow when panel open, right arrow when closed
- Move FAB button from right to left side of screen (12px from left edge)
- Adjust vertical position down by 30px for better placement
- Update console logging to reflect correct icon states
2025-10-16 10:27:17 +11:00
Lucas 'Paperboy' Rose-Winters 9a653a9c7a feat: implement draggable mobile FAB with comprehensive event handling
Add full mouse and touch support for mobile toggle button with drag-to-reposition
functionality and persistent position saving.

Changes:
- Add mobile FAB button with draggable positioning (both mouse and touch)
- Implement time-based drag detection (200ms or 10px threshold)
- Add position persistence in extension settings
- Fix click handler to work on both mobile and desktop viewports
- Add comprehensive diagnostic logging for event debugging
- Update mobile panel to slide from right (matching desktop UX)
- Implement dual-button pattern (FAB + internal collapse toggle)
- Add viewport-constrained dragging with 10px padding
- Prevent click events from firing after drag completion

Mobile UX:
- FAB visible when panel closed, hidden when open
- Internal collapse toggle visible only when panel open
- Touch and mouse drag support with real-time positioning
- Click/tap toggles panel, drag repositions button
- Position saved across sessions

Technical:
- Add mousedown/mousemove/mouseup handlers for desktop drag
- Add touchstart/touchmove/touchend handlers for mobile drag
- Remove broken viewport check that prevented mobile clicks
- Add 'just-dragged' flag to prevent click after drag
- Update .gitignore to exclude CLAUDE.md and .env files
2025-10-16 09:43:23 +11:00
Spicy_Marinara 4145817a93 Fix CSS scaling and layout issues
- Reorganized User Stats: moved portrait and inventory side-by-side, removed header
- Fixed Info Box widgets: made them square-shaped with proper scaling at all zoom levels
- Fixed stat bars: added overflow scrolling to prevent overlapping with mood box
- Added responsive compact layout: text moves inside bars at 120%+ zoom
- Improved spacing: bars now fill available space naturally at 100% zoom
- All elements now scale properly from 100% to 150%+ zoom
2025-10-15 23:17:02 +02:00
Lucas 'Paperboy' Rose-Winters 9ed76a4381 feat: implement comprehensive mobile UX for RPG Companion panel
- Add bottom-sliding drawer system for mobile (≤1000px viewport)
- Implement tabbed navigation with Stats and Info & Characters tabs
- Combine Info Box and Present Characters into single tab with 50/50 split
- Add smooth transitions between desktop and mobile layouts
- Reposition collapse button as close button on mobile
- Implement FAB toggle button for opening mobile drawer

Mobile Stats Tab:
- Use CSS Grid layout for efficient space utilization
- Portrait centered at top, stat bars below
- Inventory and mood on left, attributes list on right
- Convert attributes from 3x2 grid to vertical list

Mobile Info Box:
- Scale dashboard widgets to fill allocated space
- Proportional row heights (60% top row, 40% location)
- Widgets expand to fill available vertical space

Technical improvements:
- Bottom-based drawer positioning instead of transform
- CSS-only transitions, JavaScript only toggles classes
- Instant tab setup on desktop→mobile for smooth transition
- Temporary transition disabling for mobile→desktop snap
- Proper flex hierarchy for space filling
2025-10-16 01:35:15 +11:00
Spicy_Marinara 4f0c366f04 Fix dice roll saving: only save when 'Save Roll' is clicked
- Add pendingDiceRoll variable to store temporary roll result
- Clicking X or overlay now discards the roll without saving
- Only save to settings when user explicitly clicks 'Save Roll' button
- Prevents unwanted rolls from being saved to the sidebar display
2025-10-15 13:17:25 +02:00
Spicy_Marinara a5d39f4245 Convert CSS to responsive units and fix button scaling
- Convert font-size from px to rem for better accessibility
- Convert padding/margin/gap from px to em for responsive scaling
- Convert width/height/position values to rem
- Convert letter-spacing and transforms to responsive units
- Keep shadows, small borders (1-3px), and media queries as px
- Fix buttons (Manual Update & Settings) to use 100% width and 2.5rem height
- Fix TypeScript error: add missing id property to regexScript object
2025-10-15 13:05:24 +02:00
Spicy_Marinara f21d6030aa Fix plot progression: use quiet_prompt instead of quietPrompt
- Changed property name from quietPrompt to quiet_prompt (underscore notation)
- Removed unnecessary context manipulation code
- Pass prompt via Generate() options with correct property naming
- This fixes custom prompts not appearing in continuation generation
2025-10-15 12:39:59 +02:00
Spicy_Marinara 0ad30f2489 Add delay before Continue click and console logs to debug quietPrompt 2025-10-15 09:50:41 +02:00
Spicy_Marinara 3f44a0116a Fix plot progression to use context.quietPrompt and click Continue button 2025-10-15 09:37:47 +02:00
Spicy_Marinara 63d180c0c9 Merge PR from GitHub - resolved conflicts 2025-10-15 09:21:59 +02:00
Spicy_Marinara 21e7ff85f9 Fix plot progression buttons to trigger continuation without RPG tracker prompts 2025-10-15 09:17:47 +02:00
Spicy Marinara 63039f0000 Merge pull request #4 from paperboygold/fix/panel-animation-and-imports
fix: resolve panel collapse animation and import errors
2025-10-15 09:13:04 +02:00
Spicy_Marinara 8e624a807d Fix Refresh RPG Info to treat placeholder data as first-time generation and remove cache clear popups 2025-10-15 08:44:24 +02:00
Lucas 'Paperboy' Rose-Winters aca7478bcc fix: resolve panel collapse animation and import errors
- Fix chevron button positioning to move with collapsed panel edge
- Replace broken dynamic imports with static imports in ensureHtmlCleaningRegex
- Add smooth bidirectional expand/collapse animations
- Implement positioning-based layout for smooth transitions
- Add content opacity fade synchronized with panel width changes

This fixes the chevron button remaining stationary during collapse,
eliminates "Failed to fetch dynamically imported module" errors,
and provides smooth animations in both expand and collapse directions.
2025-10-15 15:47:13 +11:00
Spicy_Marinara 8f67decea3 Make User Stats and Present Characters always editable even when not generated - show placeholder cards with editable fields 2025-10-15 02:06:23 +02:00
Spicy_Marinara 09d2d62999 Make all Info Box fields editable even when not generated - always show widgets with placeholder values 2025-10-15 02:03:54 +02:00
Spicy_Marinara 94fa0f820c Fix date editing in Info Box - allow editing empty fields and properly handle all date components (weekday, month, year) 2025-10-15 02:02:08 +02:00
Spicy_Marinara fe346c09d5 Fix HTML prompt duplication on swipes in together mode - inject separately instead of including in instructions 2025-10-15 00:16:22 +02:00
Spicy_Marinara 6f810f05a0 Fix time editing in Info Box - set both start and end time to edited value 2025-10-14 22:54:09 +02:00
Spicy_Marinara a4bdfd8f4c Fix regex module import paths - remove duplicate /scripts/ in path 2025-10-14 21:10:51 +02:00
Spicy_Marinara 737b580be8 Support both global and user-specific extension installation paths
- Dynamically detect extension location using import.meta.url
- Support installation in public/extensions (install for all users)
- Support installation in data/default-user/extensions (install just for me)
- Automatically sets correct extensionFolderPath based on detected location
2025-10-14 19:24:25 +02:00
Spicy_Marinara ea10d1eaac Add collapsible panel, fix inventory scrolling, adjust toggle margins
- Add collapse/expand toggle button to side panels (left/right positions)
- Button shows on the outside edge of the panel with chevron icon
- Panel collapses to 40px vertical bar, button icon direction updates based on position
- Fix inventory box stretching issue by adding max/min height constraints
- Inventory items now scroll internally with flex layout
- Remove bottom margin from Enable Immersive HTML toggle
- Add top margin to Manual Update button to maintain spacing
2025-10-14 19:18:17 +02:00
Spicy Marinara b3a2e8c771 Remove active characters list from system message
Removed the introduction of the active characters list from the system message.
2025-10-14 18:12:11 +02:00
Spicy_Marinara 158517c600 feat: auto-import HTML cleaning regex for prompts
- Adds ensureHtmlCleaningRegex() function that automatically imports a regex script
- Regex removes HTML tags from outgoing prompts to prevent formatting issues
- Only imports if not already present (checks existing scripts by name)
- Based on the regex-clean_html_(from_outgoing_prompt).json specification
- Runs on extension initialization
- Non-blocking: won't fail extension load if regex import fails
2025-10-14 15:00:19 +02:00
Spicy_Marinara 7440860402 feat: Add mobile-optimized FAB toggle button for panel
- Added floating action button (FAB) that appears only on mobile (≤768px)
- Panel becomes a bottom sheet modal on mobile instead of fixed sidebar
- Smooth slide-up animation with backdrop overlay
- Panel hidden by default on mobile, opens when FAB clicked
- Touch-friendly button sizes (44px minimum per Apple HIG)
- 70vh height on tablets, 80vh on phones for better usability
- Rounded top corners for modern mobile UI
- Desktop behavior unchanged
2025-10-14 14:39:45 +02:00
Spicy_Marinara 9609eef6ff fix: Update placeholder hints to clarify generation mode options 2025-10-14 14:31:16 +02:00
Spicy_Marinara 609a4b9e47 feat: Enable 'Show Thoughts in Chat' by default for new installs 2025-10-14 14:24:37 +02:00
Spicy_Marinara d98ecce5c3 fix: Append panel directly to body for proper flexbox layout
- Changed from $('#sheld').after/before() to $('body').append()
- Panel is now a direct child of body element
- Works better with SillyTavern's main flexbox layout
- CSS handles all positioning (no more DOM position logic)
2025-10-14 14:10:02 +02:00
Spicy_Marinara d1e4d2d7df fix: Add third-party prefix to extensionName for template loading
- Changed to 'third-party/rpg-companion-sillytavern'
- User-installed extensions need the third-party prefix
- Template loader looks for scripts/extensions/third-party/[name]
2025-10-14 13:01:54 +02:00
Spicy_Marinara 5af6186c32 fix: Update extensionName to match repository folder name
- Changed from 'rpg-companion' to 'rpg-companion-sillytavern'
- Fixes 'Error rendering template' issue
- Template loader uses extensionName to find template files
2025-10-14 12:58:15 +02:00
Spicy_Marinara 73b76fee2f fix: Correct import paths for user-installed extensions
- Changed import paths from ../../ to ../../../
- User-installed extensions are in data/default-user/extensions/
- Paths need one more level up to reach script.js and other core files
2025-10-14 12:42:58 +02:00
Spicy_Marinara 2dd17eda84 fix: Remove Generate from imports for release branch compatibility
- Generate function may not exist in older SillyTavern versions
- Added fallback check for window.Generate before using it
- Should fix '[object Event]' loading error on release branch
2025-10-14 12:40:33 +02:00
Spicy_Marinara aede293116 fix: Add error handling to initialization for better debugging 2025-10-14 12:33:46 +02:00
Spicy_Marinara e53f6675ea fix: Use more compatible emoji parsing without Unicode property escapes
- Replaced \p{Emoji} regex with line-by-line parsing
- Avoids compatibility issues with older JavaScript engines
- Skips percentage and inventory lines to find mood emoji
- Supports all emoji types including compound emojis
2025-10-14 12:17:57 +02:00
Spicy_Marinara d5e4010d4d fix: Support compound emojis in mood parsing
- Updated regex to handle compound emojis with zero-width joiners (ZWJ)
- Fixes mood display for emojis like 😶‍🌫️ (face in clouds)
- Now captures full emoji sequences including variation selectors
2025-10-14 11:39:32 +02:00
Spicy_Marinara 518f2763aa Initial commit 2025-10-14 00:01:23 +02:00