Fixes critical bug identified by Zephyre_Review: event handlers used
global jQuery selectors instead of container-scoped selectors, causing
potential event handler leaks and scope mismatches.
- requestAnimationFrame batching: rerenderRpgState() now batches all
render calls into a single animation frame, reducing reflow/repaint costs
- Lightweight change detection: Render functions use updateIfChanged() to
skip DOM updates when content hasn't changed, and only re-bind event
handlers when the DOM was actually updated
- CSS content-visibility: Added content-visibility: auto with
contain-intrinsic-size to inventory and equipment containers, deferring
rendering of off-screen content
New file: src/systems/rendering/renderUtils.js (rendering utilities module)
Updated: All render modules + sillytavern.js integration + style.css
- setupPlotButtons requires handlePlotClick and handleEncounterClick callbacks
- Pass sendPlotProgression and openEncounterModal as arguments
- removeAlternatePresentCharactersPanel is already correctly imported
- Update HTML input max attribute from 20 to 99 in generateStatCheckboxes()
- Update JS clamping logic Math.min(20, val) to Math.min(99, val) in saveEquipmentItem()
Add a new Equipment tab to manage player gear and stat bonuses.
Features:
- 19 equipment slots across 8 categories (helmet, necklace, body armor, gloves, pants, shoes, rings, accessories)
- Type-to-slot validation: each type has max equipped limits (1 helmet, 10 rings, 3 accessories, etc.)
- Auto-slot assignment: equipping a ring fills the first available ring slot
- Stat bonuses from equipped items display on RPG attributes (e.g. STR 10 +2)
- Create/edit modal with stat checkboxes per RPG attribute
- Inventory list for unequipped items
Architecture:
- Shared constants in src/systems/equipment/constants.js
- Category-based types (Ring, Accessory) with auto-slot assignment
- v7 migration converts legacy slot-specific types to generic categories
- Full i18n support for all UI strings
Files:
- New: src/systems/equipment/constants.js
- New: src/systems/interaction/equipmentActions.js
- New: src/systems/rendering/equipment.js
- Modified: state.js, persistence.js, template.html, index.js
- Modified: userStats.js, desktop.js, mobile.js, layout.js, modals.js
- Modified: apiClient.js, sillytavern.js, style.css, en.json
This PR adds an optional alternate display mode for RPG Companion thoughts.
When enabled, thoughts are shown as compact expandable cards directly below the relevant latest character message. When disabled, RPG Companion keeps its original corner/overlay thought bubbles, so the existing behavior is preserved unless the user explicitly switches modes.
The new display mode is built on top of RPG Companion’s existing thoughts system rather than replacing it. Thought UI now updates more reliably across new generations, swipe changes, message deletion, chat reload/re-entry, and live mode toggling, so thoughts stay attached to the correct visible message instead of lingering on stale UI. It also improves restoration of RPG Companion state after reopening a chat, making thoughts and related tracker data more consistent with the current chat view.