The pause button wasn't appearing because preload.js variables were being
reset when pages reloaded/navigated, but the visibility message was only
sent once in attachView().
Now sends pause-button-visibility on EVERY page load (did-finish-load event)
to ensure the button state persists across page reloads and navigation.
Major UX improvement: Replaced problematic home return popup on timed sites
with an on-demand pause button that appears on user interaction.
Changes:
- NEW: Pause button appears in bottom-left corner on user interaction
- Shows only on timed rotation sites (duration > 0)
- Auto-hides after 5 seconds of inactivity
- Reuses existing inactivity prompt logic for pause dialog
- Pause durations: 15 min, 30 min, 1 hour, 2 hours
- Home return popup now ONLY appears on manual sites (duration = 0)
- Timed sites use pause button instead (cleaner UX)
Implementation details:
- Added pause button state/functions to preload.js (outside DOMContentLoaded)
- Added pause-dialog.html with time selection UI
- Added showPauseDialog() function and IPC handler in main.js
- Modified attachView() to send pause-button-visibility based on site duration
- Modified HOME RETURN CHECK to skip timed sites (line 3622-3625)
- Button creation reuses keyboard icon pattern for consistency
This fixes the issue where the home return popup would appear but sites
could rotate under it on timed rotation sites. Now users get a clean,
on-demand pause control that doesn't interfere with normal browsing.
Root cause: Pause button state variables and IPC listener were declared inside
DOMContentLoaded, causing them to reset every time a page loaded.
Symptoms:
- Main process sends shouldShow=true when switching to rotation site
- Preload receives it and sets pauseButtonShouldShow=true
- Page loads → DOMContentLoaded fires → variables reset to false
- User taps screen → sees shouldShow=false → no button appears
Fix:
- Moved pause button variables outside DOMContentLoaded (persist across page loads)
- Moved pause button functions outside DOMContentLoaded (called by IPC listener)
- Moved IPC listener outside DOMContentLoaded (registers once, not per page)
- Kept only user interaction handlers inside DOMContentLoaded
This ensures pause button state persists across page navigations within a tab.
**Return-to-Home Popup Logic (CORRECTED):**
- FIXED: Return-to-home inactivity prompt now appears ONLY on manual sites (duration=0)
- Rotation sites (duration>0) skip return-to-home logic and use auto-rotation instead
- Previous commit had this backwards - now corrected
**Pause Button Auto-Hide:**
- Pause button now auto-hides after 5 seconds of inactivity (like keyboard icon)
- Each user interaction resets the 5-second timer
- Debug logging shows when button auto-hides
- Prevents button from staying on screen permanently
**Manual Electron Update Detection:**
- Added main.js file check to Method 1 (default kiosk user)
- Added Method 6: Check /opt/kiosk-app and /usr/local/kiosk-app
- Added Method 7: Query systemd kiosk.service for working directory
- Improved parent directory detection with cleaner variable usage
- Enhanced error message with numbered search locations and kiosk user home path
- Better debug output to help diagnose installation issues
**Display Schedule Logic (CRITICAL FIX):**
- FIXED: Reversed display off/on time comparison logic
- Overnight case (22:00 off, 06:00 on): Now correctly checks off_mins > on_mins
- Same-day case (08:00 off, 17:00 on): Now correctly checks off_mins < on_mins
- Display will now properly stay OFF during scheduled times
- Fixes issue where "keep display on" watchdog was too aggressive
All changes improve UX and fix critical scheduling bugs
- Add comprehensive console logging for pause button lifecycle:
* Main process logs when sending visibility updates with duration info
* Renderer logs visibility changes and user interaction events
* Helps diagnose why pause button may not appear on rotation sites
- Fix return-to-home inactivity prompt appearing on manual sites:
* Skip inactivity timeout logic when on manual sites (duration=0)
* Manual sites should not trigger return-to-home prompts
* Only rotation sites should show inactivity prompts
These changes help diagnose pause button issues and improve UX for manual sites