merge: integrate upstream RPG attributes customization system

Merged commits from upstream/main (d870731):
- Add customizable RPG attributes (STR/DEX/etc) with add/remove/rename
- Fix character stats editing (0% display bug, missing Stats line creation)
- Add mobile font-size overrides for better readability
- Fix together mode rendering order (render panels before cleaning DOM)
- Fix temperature unit toggle (C/F) and thermometer thresholds
- Add buildAttributesString() for custom attribute names in AI prompts

Upstream Features:
- trackerConfig.rpgAttributes array replaces showRPGAttributes boolean
- Per-attribute enable/disable, custom names, reordering
- Tracker editor UI for managing attributes
- Custom attribute names appear in AI prompts and dice rolls
- Backward compatible migration from old boolean toggle

Merge Conflict Resolution:
- src/systems/integration/sillytavern.js:
  * Kept both: upstream's "render before DOM cleaning" + our refreshDashboard()
  * Result: render panels → refresh dashboard → update DOM
- style.css:
  * Kept both: our Widget Integration CSS + upstream's Mobile Font Overrides
  * Our Recent Events width fix (width: 100%) preserved

Related upstream commits:
- d870731: Add customizable RPG attributes and fix character stats editing
- f20710f: Make RPG attributes customizable and editable
- 883212b: Add comprehensive mobile font-size overrides
- 718696e: Fix multiple UI and functionality issues

No functional changes to v2 dashboard yet - integration in next commit.
This commit is contained in:
Lucas 'Paperboy' Rose-Winters
2025-11-04 09:58:07 +11:00
9 changed files with 408 additions and 87 deletions
+17 -8
View File
@@ -103,11 +103,11 @@ export async function onMessageReceived(data) {
// console.log('[RPG Companion] Parsing together mode response:', responseText);
const parsedData = parseResponse(responseText);
console.log('[RPG Companion] Parsed data results:', {
hasUserStats: !!parsedData.userStats,
hasInfoBox: !!parsedData.infoBox,
hasCharacterThoughts: !!parsedData.characterThoughts
});
// console.log('[RPG Companion] Parsed data results:', {
// hasUserStats: !!parsedData.userStats,
// hasInfoBox: !!parsedData.infoBox,
// hasCharacterThoughts: !!parsedData.characterThoughts
// });
// Update stored data (both lastGeneratedData for old UI and extensionSettings for dashboard widgets)
if (parsedData.userStats) {
@@ -171,9 +171,7 @@ export async function onMessageReceived(data) {
lastMessage.swipes[currentSwipeId] = cleanedMessage.trim();
}
// console.log('[RPG Companion] Cleaned message, removed tracker code blocks');
// Render the updated data (old panel UI)
// Render the updated data FIRST (before cleaning DOM)
renderUserStats();
renderInfoBox();
renderThoughts();
@@ -183,6 +181,17 @@ export async function onMessageReceived(data) {
// Refresh dashboard widgets (v2 dashboard)
refreshDashboard();
// Then update the DOM to reflect the cleaned message
const lastMessageElement = $('#chat').children('.mes').last();
if (lastMessageElement.length) {
const messageText = lastMessageElement.find('.mes_text');
if (messageText.length) {
messageText.html(substituteParams(cleanedMessage.trim()));
}
}
// console.log('[RPG Companion] Cleaned message, removed tracker code blocks from DOM');
// Save to chat metadata
saveChatData();
}