Merge remote-tracking branch 'tomt610/feature/fab-widgets' into test-pr90-pr91-combined

This commit is contained in:
Spicy_Marinara
2026-01-10 16:47:15 +01:00
11 changed files with 936 additions and 5 deletions
+18
View File
@@ -43,6 +43,9 @@ import { renderMusicPlayer } from '../rendering/musicPlayer.js';
// Utils
import { getSafeThumbnailUrl } from '../../utils/avatars.js';
// UI
import { setFabLoadingState, updateFabWidgets } from '../ui/mobile.js';
// Chapter checkpoint
import { updateAllCheckpointIndicators } from '../ui/checkpointUI.js';
import { restoreCheckpointOnLoad } from '../features/chapterCheckpoint.js';
@@ -111,6 +114,11 @@ export function onMessageSent() {
// This allows auto-update to distinguish between new generations and loading chat history
setIsAwaitingNewMessage(true);
// Show FAB loading state for together mode (starts spinning)
if (extensionSettings.generationMode === 'together') {
setFabLoadingState(true);
}
// For separate mode with auto-update disabled, commit displayed tracker
if (extensionSettings.generationMode === 'separate' && !extensionSettings.autoUpdate) {
if (lastGeneratedData.userStats || lastGeneratedData.infoBox || lastGeneratedData.characterThoughts) {
@@ -260,6 +268,9 @@ export async function onMessageReceived(data) {
if (extensionSettings.autoUpdate && isAwaitingNewMessage) {
setTimeout(async () => {
await updateRPGData(renderUserStats, renderInfoBox, renderThoughts, renderInventory);
// Update FAB widgets after separate/external mode update completes
setFabLoadingState(false);
updateFabWidgets();
}, 500);
}
}
@@ -282,6 +293,10 @@ export async function onMessageReceived(data) {
// console.log('[RPG Companion] Plot progression generation completed');
}
// Stop FAB loading state and update widgets
setFabLoadingState(false);
updateFabWidgets();
// Re-apply checkpoint in case SillyTavern unhid messages during generation
await restoreCheckpointOnLoad();
}
@@ -319,6 +334,9 @@ export function onCharacterChanged() {
renderQuests();
renderMusicPlayer($musicPlayerContainer[0]);
// Update FAB widgets with loaded data
updateFabWidgets();
// Update chat thought overlays
updateChatThoughts();