feat(mobile): Add FAB widgets with info display around toggle button

- Add 8-position widget system around mobile FAB button (N, NE, E, SE, S, SW, W, NW)
- Display weather icon, weather description, time, date, location around FAB
- Show stats and RPG attributes in larger West/Northwest positions
- Add animated clock face matching main panel design
- Implement expandable text on hover/tap for truncated content
- Add FAB spinner animation during API requests
- Respect tracker preset settings for filtering displayed stats/attributes
- Sync FAB data with lastGeneratedData for real-time updates
- Hide FAB widgets on desktop viewport (>1000px) and when panel is open
- Add settings UI for enabling/disabling individual widget types
- Update FAB widgets on manual edits in tracker editor and stats panels
This commit is contained in:
tomt610
2026-01-10 13:18:34 +00:00
parent f5641ec1f0
commit 73cbb27713
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();