From 27e1c30ea065bec46f620ac174a4774f45ef892e Mon Sep 17 00:00:00 2001 From: Lucas 'Paperboy' Rose-Winters Date: Wed, 22 Oct 2025 11:06:30 +1100 Subject: [PATCH] fix: only show mobile refresh FAB when panel open AND in Separate mode The mobile refresh button was always visible on mobile. It should only appear when BOTH conditions are met: - RPG panel is open - Generation mode is Separate (not Together) Changes: - Added opacity: 0 and pointer-events: none to base .rpg-mobile-refresh - CSS shows button when panel open AND not .rpg-hidden-mode class - Updated updateGenerationModeUI() to toggle .rpg-hidden-mode on mobile button - Together mode: adds .rpg-hidden-mode class (keeps button hidden) - Separate mode: removes .rpg-hidden-mode class (allows CSS to show it) Result: Mobile refresh FAB only appears when panel is open AND in Separate mode. Stays hidden when panel closed OR in Together mode. --- src/systems/ui/layout.js | 8 ++++++-- style.css | 13 +++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/systems/ui/layout.js b/src/systems/ui/layout.js index 9993154..597183c 100644 --- a/src/systems/ui/layout.js +++ b/src/systems/ui/layout.js @@ -266,11 +266,15 @@ 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, manual update button is hidden + // In "together" mode, hide both desktop and mobile refresh buttons $('#rpg-manual-update').hide(); + $mobileBtn.addClass('rpg-hidden-mode'); } else { - // In "separate" mode, manual update button is visible + // In "separate" mode, show both desktop and mobile refresh buttons $('#rpg-manual-update').show(); + $mobileBtn.removeClass('rpg-hidden-mode'); } } diff --git a/style.css b/style.css index 4499224..280f771 100644 --- a/style.css +++ b/style.css @@ -3328,6 +3328,9 @@ body:has(.rpg-panel.rpg-position-left) #sheld { user-select: none; -webkit-user-select: none; will-change: top, left; + /* Hidden by default - shown when panel open AND separate mode */ + opacity: 0; + pointer-events: none; } .rpg-mobile-refresh.dragging { @@ -3387,17 +3390,23 @@ body:has(.rpg-panel.rpg-position-left) #sheld { display: flex; } - /* Show the mobile FAB refresh button */ + /* Show the mobile FAB refresh button (but hidden by opacity) */ .rpg-mobile-refresh { display: flex; } + /* Show refresh button when panel is open AND not hidden by generation mode */ + body:has(.rpg-panel.rpg-mobile-open) .rpg-mobile-refresh:not(.rpg-hidden-mode) { + opacity: 1; + pointer-events: auto; + } + /* Hide desktop refresh button on mobile */ #rpg-manual-update { display: none !important; } - /* Hide FAB when panel is open */ + /* Hide toggle FAB when panel is open */ body:has(.rpg-panel.rpg-mobile-open) .rpg-mobile-toggle { opacity: 0; pointer-events: none;