merge: resolve conflicts with upstream/main

Merged upstream/main into feat/v2-widget-dashboard-system branch.

Key conflict resolutions:
- index.js: Added renderQuests() to Dashboard v2 fallback rendering
- state.js: Combined memoryMessagesToProcess with Dashboard v2 config
- apiClient.js: Combined refreshDashboard() and renderQuests() calls
- style.css: Kept Dashboard v2 mobile refresh button styles

New features from upstream:
- Quest tracking system (renderQuests, quests.js)
- Memory recollection system
- Lorebook limiter feature
- Various parser and prompt builder improvements
This commit is contained in:
Lucas 'Paperboy' Rose-Winters
2025-10-30 08:26:19 +11:00
21 changed files with 3050 additions and 483 deletions
+16 -2
View File
@@ -22,9 +22,10 @@ export function setupDesktopTabs() {
const $infoBox = $('#rpg-info-box');
const $thoughts = $('#rpg-thoughts');
const $inventory = $('#rpg-inventory');
const $quests = $('#rpg-quests');
// If no sections exist, nothing to organize
if ($userStats.length === 0 && $infoBox.length === 0 && $thoughts.length === 0 && $inventory.length === 0) {
if ($userStats.length === 0 && $infoBox.length === 0 && $thoughts.length === 0 && $inventory.length === 0 && $quests.length === 0) {
return;
}
@@ -39,12 +40,17 @@ export function setupDesktopTabs() {
<i class="fa-solid fa-box"></i>
<span>Inventory</span>
</button>
<button class="rpg-tab-btn" data-tab="quests">
<i class="fa-solid fa-scroll"></i>
<span>Quests</span>
</button>
</div>
`);
// Create tab content containers
const $statusTab = $('<div class="rpg-tab-content active" data-tab-content="status"></div>');
const $inventoryTab = $('<div class="rpg-tab-content" data-tab-content="inventory"></div>');
const $questsTab = $('<div class="rpg-tab-content" data-tab-content="quests"></div>');
// Move sections into their respective tabs (detach to preserve event handlers)
if ($userStats.length > 0) {
@@ -63,6 +69,10 @@ export function setupDesktopTabs() {
$inventoryTab.append($inventory.detach());
$inventory.show();
}
if ($quests.length > 0) {
$questsTab.append($quests.detach());
$quests.show();
}
// Hide dividers on desktop tabs (tabs separate content naturally)
$('.rpg-divider').hide();
@@ -72,6 +82,7 @@ export function setupDesktopTabs() {
$tabsContainer.append($tabNav);
$tabsContainer.append($statusTab);
$tabsContainer.append($inventoryTab);
$tabsContainer.append($questsTab);
// Replace content box with tabs container
$contentBox.html('').append($tabsContainer);
@@ -102,6 +113,7 @@ export function removeDesktopTabs() {
const $infoBox = $('#rpg-info-box').detach();
const $thoughts = $('#rpg-thoughts').detach();
const $inventory = $('#rpg-inventory').detach();
const $quests = $('#rpg-quests').detach();
// Remove tabs container
$('.rpg-tabs-container').remove();
@@ -114,18 +126,20 @@ export function removeDesktopTabs() {
// Restore original sections to content box in correct order
const $contentBox = $('.rpg-content-box');
// Re-insert sections in original order: User Stats, Info Box, Thoughts, Inventory
// Re-insert sections in original order: User Stats, Info Box, Thoughts, Inventory, Quests
if ($dividerStats.length) {
$dividerStats.before($userStats);
$dividerInfo.before($infoBox);
$dividerThoughts.before($thoughts);
$contentBox.append($inventory);
$contentBox.append($quests);
} else {
// Fallback if dividers don't exist
$contentBox.append($userStats);
$contentBox.append($infoBox);
$contentBox.append($thoughts);
$contentBox.append($inventory);
$contentBox.append($quests);
}
// Show sections and dividers
+2 -6
View File
@@ -266,15 +266,11 @@ export function applyPanelPosition() {
* Updates the UI based on generation mode selection.
*/
export function updateGenerationModeUI() {
const $mobileBtn = $('#rpg-manual-update-mobile');
if (extensionSettings.generationMode === 'together') {
// In "together" mode, hide both desktop and mobile refresh buttons
// In "together" mode, manual update button is hidden
$('#rpg-manual-update').hide();
$mobileBtn.addClass('rpg-hidden-mode');
} else {
// In "separate" mode, show both desktop and mobile refresh buttons
// In "separate" mode, manual update button is visible
$('#rpg-manual-update').show();
$mobileBtn.removeClass('rpg-hidden-mode');
}
}
+21 -2
View File
@@ -527,9 +527,10 @@ export function setupMobileTabs() {
const $infoBox = $('#rpg-info-box');
const $thoughts = $('#rpg-thoughts');
const $inventory = $('#rpg-inventory');
const $quests = $('#rpg-quests');
// If no sections exist, nothing to organize
if ($userStats.length === 0 && $infoBox.length === 0 && $thoughts.length === 0 && $inventory.length === 0) {
if ($userStats.length === 0 && $infoBox.length === 0 && $thoughts.length === 0 && $inventory.length === 0 && $quests.length === 0) {
return;
}
@@ -538,6 +539,7 @@ export function setupMobileTabs() {
const hasStats = $userStats.length > 0;
const hasInfo = $infoBox.length > 0 || $thoughts.length > 0;
const hasInventory = $inventory.length > 0;
const hasQuests = $quests.length > 0;
// Tab 1: Stats (User Stats only)
if (hasStats) {
@@ -551,6 +553,10 @@ export function setupMobileTabs() {
if (hasInventory) {
tabs.push('<button class="rpg-mobile-tab ' + (tabs.length === 0 ? 'active' : '') + '" data-tab="inventory"><i class="fa-solid fa-box"></i><span>Inventory</span></button>');
}
// Tab 4: Quests
if (hasQuests) {
tabs.push('<button class="rpg-mobile-tab ' + (tabs.length === 0 ? 'active' : '') + '" data-tab="quests"><i class="fa-solid fa-scroll"></i><span>Quests</span></button>');
}
const $tabNav = $('<div class="rpg-mobile-tabs">' + tabs.join('') + '</div>');
@@ -559,11 +565,13 @@ export function setupMobileTabs() {
if (hasStats) firstTab = 'stats';
else if (hasInfo) firstTab = 'info';
else if (hasInventory) firstTab = 'inventory';
else if (hasQuests) firstTab = 'quests';
// Create tab content wrappers
const $statsTab = $('<div class="rpg-mobile-tab-content ' + (firstTab === 'stats' ? 'active' : '') + '" data-tab-content="stats"></div>');
const $infoTab = $('<div class="rpg-mobile-tab-content ' + (firstTab === 'info' ? 'active' : '') + '" data-tab-content="info"></div>');
const $inventoryTab = $('<div class="rpg-mobile-tab-content ' + (firstTab === 'inventory' ? 'active' : '') + '" data-tab-content="inventory"></div>');
const $questsTab = $('<div class="rpg-mobile-tab-content ' + (firstTab === 'quests' ? 'active' : '') + '" data-tab-content="quests"></div>');
// Move sections into their respective tabs (detach to preserve event handlers)
// Stats tab: User Stats only
@@ -588,6 +596,12 @@ export function setupMobileTabs() {
$inventory.show();
}
// Quests tab: Quests only
if ($quests.length > 0) {
$questsTab.append($quests.detach());
$quests.show();
}
// Hide dividers on mobile
$('.rpg-divider').hide();
@@ -599,6 +613,8 @@ export function setupMobileTabs() {
if (hasStats) $mobileContainer.append($statsTab);
if (hasInfo) $mobileContainer.append($infoTab);
if (hasInventory) $mobileContainer.append($inventoryTab);
if (hasQuests) $mobileContainer.append($questsTab);
if (hasInventory) $mobileContainer.append($inventoryTab);
// Insert mobile tab structure at the beginning of content box
$contentBox.prepend($mobileContainer);
@@ -626,6 +642,7 @@ export function removeMobileTabs() {
const $infoBox = $('#rpg-info-box').detach();
const $thoughts = $('#rpg-thoughts').detach();
const $inventory = $('#rpg-inventory').detach();
const $quests = $('#rpg-quests').detach();
// Remove mobile tab container
$('.rpg-mobile-container').remove();
@@ -638,14 +655,16 @@ export function removeMobileTabs() {
// Restore original sections to content box in correct order
const $contentBox = $('.rpg-content-box');
// Re-insert sections in original order: User Stats, Info Box, Thoughts, Inventory
// Re-insert sections in original order: User Stats, Info Box, Thoughts, Inventory, Quests
if ($dividerStats.length) {
$dividerStats.before($userStats);
$dividerInfo.before($infoBox);
$dividerThoughts.before($thoughts);
$contentBox.append($inventory);
$contentBox.append($quests);
} else {
// Fallback if dividers don't exist
$contentBox.prepend($quests);
$contentBox.prepend($inventory);
$contentBox.prepend($thoughts);
$contentBox.prepend($infoBox);
+8
View File
@@ -16,6 +16,7 @@ import {
import { saveSettings, saveChatData } from '../../core/persistence.js';
import { renderUserStats } from '../rendering/userStats.js';
import { updateChatThoughts } from '../rendering/thoughts.js';
import { renderQuests } from '../rendering/quests.js';
import {
rollDice as rollDiceCore,
clearDiceRoll as clearDiceRollCore,
@@ -409,6 +410,12 @@ export function setupSettingsPopup() {
// Clear dice roll
extensionSettings.lastDiceRoll = null;
// Clear quests
extensionSettings.quests = {
main: "None",
optional: []
};
// Save everything
saveChatData();
saveSettings();
@@ -417,6 +424,7 @@ export function setupSettingsPopup() {
renderUserStats();
updateDiceDisplayCore();
updateChatThoughts(); // Clear the thought bubble in chat
renderQuests(); // Clear and re-render quests UI
// console.log('[RPG Companion] Chat cache cleared');
});