Commit Graph
86 Commits
Author SHA1 Message Date
Claude 1a3bb99696 v0.9.5-7: CRITICAL fix for inactivity lockout ignoring time extensions
CRITICAL FIX: Inactivity lockout now respects time extensions
- Lockout timer was completely ignoring pause button extensions
- Lockout timer was ignoring manual site timeout extensions
- Added inactivityExtensionUntil check to checkLockoutTimer() function
- Time extensions now properly prevent BOTH site timeout AND lockout
- When extension expires, lockout timer resets (doesn't trigger immediately)

FIXED: Manual sites (duration: 0) now fully support time extensions
- Pause button extensions now work on manual sites
- Manual site timeout extensions now prevent lockout
- Extensions apply to both rotation blocking AND lockout prevention

ROOT CAUSE:
The checkLockoutTimer() function (line 4061) only checked:
- lockoutActivityTime vs lockoutTimeout
- Did NOT check inactivityExtensionUntil

This meant when a user clicked "15 minutes" on pause button:
✓ Site rotation/timeout was blocked (lines 4317, 4375 checked extension)
✗ Inactivity lockout still triggered after configured time

EXAMPLE SCENARIO THAT WAS BROKEN:
- Manual site with 2 min inactivity timeout to return home
- Lockout after 5 minutes of inactivity
- User idle for 1m 50s, clicks "15 minutes" extension
- Expected: Can stay for 15 more minutes
- Actual v0.9.5-6:
  * Home return prompt blocked ✓
  * Lockout happens at 5 min idle ✗
- Fixed v0.9.5-7:
  * Home return prompt blocked ✓
  * Lockout also blocked for 15 min ✓

FIX (lines 4083-4100):
Now checkLockoutTimer() checks inactivityExtensionUntil FIRST:
1. If within extension period: return early (skip lockout check)
2. If extension just expired: reset lockoutActivityTime (prevent immediate trigger)
3. Then check normal lockout timeout

This matches the pattern used in rotation (line 4317) and home return (line 4375).

Includes all fixes from v0.9.5-6 (boot password sequence, limited power menu)
2025-11-22 03:16:40 +00:00
Claude bdc5a9c196 v0.9.5-6: CRITICAL fix for boot password sequence and power menu
CRITICAL SECURITY FIX #1: Boot password now required BEFORE showing websites
- Password screen now appears IMMEDIATELY on boot (no website flash)
- Websites and rotation timer only start AFTER successful password entry
- Root cause: attachView() was called before checking boot flag
- Fix: Reordered code to check boot flag FIRST, only call attachView() if no boot
- unlockScreen() now starts master timer when unlocking from boot password

CRITICAL SECURITY FIX #2: Limited power menu when locked out
- Ctrl+Alt+Del when locked now shows LIMITED menu: Shutdown/Restart/Cancel
- NO Reload option available when locked (prevents bypass)
- Full menu (with Reload) only available when unlocked
- Still allows emergency shutdown/restart without password
- Message clearly indicates "System is locked. Limited options available."

ROOT CAUSE OF BOOT PASSWORD BYPASS:
In v0.9.5-5, the code sequence was:
1. attachView(startIndex) - shows website
2. Check boot flag - if exists, show password screen

This meant users saw the website for ~1 second, then password screen appeared.
Pressing Ctrl+Alt+Del at that moment would reload and bypass the password.

NEW SEQUENCE in v0.9.5-6:
1. Check boot flag FIRST
2. If boot flag exists: show password screen, DON'T load websites
3. If no boot flag: load websites normally
4. When password entered: attachView() and startMasterTimer()

Includes all fixes from v0.9.5-5 and v0.9.5-4
2025-11-21 22:56:58 +00:00
Claude a43e802810 v0.9.5-5: CRITICAL fix for boot password bypass via Ctrl+Alt+Del
CRITICAL SECURITY FIX:
- Fixed Ctrl+Alt+Del bypassing boot password requirement
  * Added isLockedOut check to showPowerMenu() function
  * Power menu (Shutdown/Restart/Reload) now blocked when system is locked out
  * Prevents bypassing boot password via Reload option
  * Also prevents bypassing inactivity lockout and time-based lockout

ROOT CAUSE:
The showPowerMenu() function was missing the isLockedOut check that other
navigation functions (nextTab, prevTab) already had. This allowed users to
press Ctrl+Alt+Del during boot password screen, select "Reload", and bypass
the password requirement entirely.

NAVIGATION TROUBLESHOOTING:
Added troubleshooting notes for users experiencing navigation issues:
- Check config.json for hidden sites (duration: -1)
- Hidden sites don't count toward navigation
- Need at least 2 visible sites for Ctrl+Tab/swipe to work

Includes all fixes from v0.9.5-4 (polkit restrictions, X server hardening,
autostart compatibility, xbindkeys fixes)
2025-11-21 22:31:48 +00:00
Claude 6201b2cc4d v0.9.5-4: CRITICAL security and compatibility fixes
This release addresses critical security vulnerabilities and compatibility issues:

CRITICAL SECURITY FIXES:
- Fix Ctrl+Alt+Del bypass vulnerability
  * Restricted polkit permissions from org.freedesktop.login1.* (ALL actions)
    to only specific power operations (power-off, reboot, suspend)
  * Prevents session switching and VT access that bypassed kiosk security
- Add X server ServerFlags to block dangerous key combinations
  * DontVTSwitch: Disable VT switching (Ctrl+Alt+F1-F12)
  * DontZap: Disable X server kill (Ctrl+Alt+Backspace)
  * AllowClosedownGrabs: Prevent client disconnection exploits
- Enhanced LightDM greeter security
  * Hide user list, disable manual login, disable guest account

COMPATIBILITY FIXES:
- Fix autostart script errors ([[: not found)
  * Converted bash-specific [[ ]] to POSIX-compliant [ ] syntax
  * Fixed display schedule and quiet hours conditional logic
- Fix xbindkeys startup errors
  * Now creates empty .xbindkeysrc file to prevent errors

Includes all fixes from v0.9.5-3 (time extensions, manual navigation)
2025-11-21 22:05:55 +00:00
Claude e8ad3bbf0d v0.9.5-3: CRITICAL security and compatibility fixes
CRITICAL SECURITY FIXES:
- Fix Ctrl+Alt+Del bypass vulnerability by restricting polkit permissions
  * Changed org.freedesktop.login1.* to specific power operations only
  * Prevents session/VT switching that bypassed kiosk security
- Add X server ServerFlags to block dangerous key combinations
  * Disable VT switching (Ctrl+Alt+F1-F12) with DontVTSwitch
  * Disable X server kill (Ctrl+Alt+Backspace) with DontZap
  * Add AllowClosedownGrabs protection
- Enhance LightDM greeter security settings

COMPATIBILITY FIXES:
- Fix autostart script errors ([[: not found) by converting bash-specific
  [[ ]] syntax to POSIX-compliant [ ] syntax
- Fix xbindkeys errors by creating empty .xbindkeysrc file

These fixes address:
1. Security vulnerability where Ctrl+Alt+Del could bypass password login
2. /home/kiosk/.config/openbox/autostart: 125: [[: not found errors
3. xbindkeys_autostart: line 24: CONF: unbound variable errors
2025-11-21 22:00:20 +00:00
outis1one 7228cbb6bb Merge pull request #30 from outis1one/claude/start-with-zero-01JzSswmEkEYSsVFuUf88YPQ
CRITICAL FIX: Remove inactivityExtensionUntil=0 from markActivity()
2025-11-20 22:53:03 -05:00
Claude 3884f06959 CRITICAL FIX: Remove inactivityExtensionUntil=0 from markActivity()
This was the root cause of extensions not working. When user clicked
extension buttons (15 min, 30 min, etc.), that click triggered markActivity()
which immediately cleared the extension that was just set.

Now extensions work correctly - they only expire when:
- Time runs out naturally
- User explicitly goes home
- User cancels the extension

This fixes:
- Pause button extensions not working (rotating after 1 min)
- Manual site timeout extensions not working (prompt after 1 min)
- Both rotation and inactivity timer extensions
2025-11-21 02:54:47 +00:00
outis1one d5377d1e22 Merge pull request #29 from outis1one/claude/start-with-zero-01JzSswmEkEYSsVFuUf88YPQ
Claude/start with zero 01 jz sswm ek ey ss v fu uf88 ypq
2025-11-20 20:56:17 -05:00
Claude f8ddfa954c Update script header to v0.9.5-2 with complete release notes 2025-11-21 01:55:30 +00:00
Claude 42f8d1486e Release v0.9.5-2: Fix critical bugs with settings persistence and timing
This release fixes multiple critical bugs reported in v0.9.5-1:

## Configuration Persistence Fixes
- **CRITICAL**: Fixed sites being wiped when editing password/pause/OSK settings
  - Added load_existing_config() function to load all settings before any menu
  - Now called before configure_optional_features and configure_password_protection
  - Prevents empty URLS/DURS arrays from overwriting existing sites in save_config

- **Fixed password protection not being saved on reboot**
  - Settings now properly persist through load_existing_config function
  - All password protection variables properly loaded from config.json

- **Fixed sites not being saved on reboot**
  - Configuration persistence issue resolved with load_existing_config

## Timing & Extension Fixes (main.js)
- **Fixed time extension rotating to wrong site**
  - Added checks to prevent rotation while pause dialog is open
  - Added checks to prevent rotation while inactivity prompt is open
  - Extension is now applied to the current site, not the next one

- **Fixed pause not working correctly**
  - Pause dialog no longer allows rotation during user selection
  - Extension properly blocks rotation until time expires

- **Fixed manual site timeout popup appearing after 1 minute**
  - Fixed extension expiration to reset lastUserInteraction
  - Prevents prompt from showing immediately after extension expires
  - Added proper checks to prevent duplicate prompts

## User Experience Improvements
- **Added cancel/exit option to menus**
  - configure_optional_features now asks "Save these changes?"
  - configure_password_protection now asks "Save these changes?"
  - Users can discard changes by answering "no"

- **Added comprehensive settings display**
  - show_current_config now displays all sites with [HOME] marker
  - Shows home URL and inactivity timeout
  - Shows optional features status (pause/keyboard buttons)
  - Shows complete password protection configuration
  - Shows lockout timeout, lock time, active hours, and boot password

## Version Updates
- Bumped SCRIPT_VERSION to 0.9.5-2
- Bumped main.js VERSION to 0.9.5-2

All reported issues from 0.9.5-1 have been addressed.
2025-11-21 00:14:11 +00:00
outis1one 54b16e5e9a Merge pull request #28 from outis1one/claude/add-timeout-password-features-01JuZJAbR4B4mRWfvGNAGtur
Add advanced timeout and password features to kiosk
2025-11-20 15:39:59 -05:00
Claude 1fafc50169 Add advanced timeout and password features to kiosk
New Features:
- Time-based session lockout: Automatically lock at a specific time daily
- Active hours for lockout: Only enforce timeout during configured hours
- Password on boot: Require password when system powers on/reboots
- Enhanced lockout timeout: Now respects active hours configuration

Configuration Options:
- lockoutAtTime: Time to auto-lock (e.g., "17:00")
- lockoutActiveStart/End: Time range for lockout enforcement
- requirePasswordOnBoot: Boolean to require password on system boot

Technical Changes:
- Updated configure_password_protection() with new prompts
- Added lockout time validation (HH:MM format)
- Enhanced main.js with isWithinActiveHours() and checkScheduledLockTime()
- Added boot flag creation in openbox autostart
- Updated config.json schema with new fields

The session timeout (inactivityTimeout) continues to work as before,
returning to home page after inactivity. The lockout timeout provides
an additional security layer with password protection.
2025-11-20 20:30:05 +00:00
outis1one 684d384c00 Merge pull request #27 from outis1one/claude/bump-kiosk-optional-buttons-01YYwBKLAD3xtfc5trWLCiwC
Claude/bump kiosk optional buttons 01 y yw bklad3xtfc5tr wl ciw c
2025-11-20 13:20:28 -05:00
Claude 26421930ab Fix JavaScript syntax errors in main.js
- Fixed missing closing brace in keyboard auto-close section
- Removed duplicate line in showKeyboardIcon function
- Corrects SyntaxError: missing ) after argument list at line 441
2025-11-20 17:43:57 +00:00
Claude 90c22fa1b1 Add UBK v0.9.4 with optional features and password protection
Based on v0.9.2-6 (includes enhanced Electron update tool)

Version 0.9.4 introduces configurable optional features and security:

New Features:
- Optional pause button: Can be disabled during install/rerun
  * Disables functionality entirely, not just hides the UI
  * Configured in Core Settings menu (option 7)

- Optional keyboard button: Can be disabled during install/rerun
  * Disables on-screen keyboard functionality completely
  * Configured in Core Settings menu (option 7)

- Password protection with session lockout:
  * Customizable lockout timeout (in minutes of inactivity)
  * Blank screen during lockout with no interaction allowed
  * Password required to unlock after timeout
  * Password required after display schedule wake-up
  * SHA-256 password hashing for security
  * Option to only require password after display wake (0 minute timeout)

Configuration:
- New configure_optional_features() function for pause/keyboard buttons
- New configure_password_protection() function for security setup
- Added to Core Settings menu (options 7 & 8)
- All settings saved to config.json and loaded on startup

Implementation:
- Main.js: Password lockout window with blank screen
- Main.js: Lockout timer check in master timer loop
- Main.js: Display wake flag detection (.display-wake file)
- Main.js: Conditional pause button visibility based on config
- Preload.js: Conditional keyboard button based on config
- Display-on script: Creates flag file to trigger password requirement

All features are configurable on first install or by rerunning the script.
2025-11-20 17:28:13 +00:00
outis1one 9ebb04208d Merge pull request #26 from outis1one/claude/fix-electron-update-script-01QPE5RtAF7bnHevbFM8vZaW
Claude/fix electron update script 01 qpe5 rt af7bn hevb fm8v za w
2025-11-20 12:14:19 -05:00
Claude 5790bae9a0 Fix cd permission issue and use correct service name (lightdm)
Fixed two critical issues preventing Electron update from completing:

1. cd permission denied error
   Problem: Script tried to `cd /home/kiosk/kiosk-app` which failed with
   "Permission denied" because the directory has restricted permissions (drwxr-x---)
   and the regular user can't enter it.

   Fix: Use `sudo -u kiosk bash -c "cd '/home/kiosk/kiosk-app' && npm install ..."`
   instead of separate cd + npm commands. This runs both commands as the kiosk
   user in a single bash session, avoiding the permission issue.

2. Wrong service name (kiosk vs lightdm)
   Problem: Scripts tried to stop/start "kiosk" service which doesn't exist on
   the user's system. Their kiosk runs under lightdm service.

   Fix: Changed all references from:
   - `systemctl stop/start kiosk` → `systemctl stop/start lightdm`
   - "Restart kiosk service" → "Restart kiosk display"
   - `journalctl -u kiosk` → `journalctl -u lightdm`

Additional fixes:
- Updated file checks: `[ -d ]` → `sudo test -d` for restricted directories
- Applied fixes to both update paths: successful install and failure/restore
- Updated both update_electron.sh and install_kiosk_0.9.2-6.sh

Changes in both scripts:
- update_electron() function: removed cd, added bash -c wrapper, changed service name
- Backup restore paths: same fixes applied
- Success path: updated restart prompts and service checks
- Failure path: fixed restore process with proper directory access

The update should now complete successfully without permission errors.
2025-11-20 16:39:26 +00:00
Claude a58c69fb5a Fix version display and backup permission issues
Fixed two issues preventing the Electron update from working properly:

1. Log messages appearing in version output
   - get_latest_electron_version() was outputting log messages to stdout
   - These messages were being captured along with the version number
   - Result: "Target version: [INFO] Fetching...39.2.3" in output
   - Fix: Redirect log_info and log_error to stderr with >&2
   - Now only the version number is captured in the variable

2. Backup function permission errors
   - stat command needed sudo to read owner of restricted directories
   - File checks [ -f ] couldn't access files in drwxr-x--- directories
   - mkdir failed with "cannot create directory '/home/kiosk': Permission denied"
   - Fix: Use sudo for all file operations in create_backup():
     * sudo stat -c '%U' to get directory owner
     * sudo test -f/d for file/directory checks
     * sudo -u owner for mkdir, cp, and file writes

Changes in both update_electron.sh and install_kiosk_0.9.2-6.sh:
- get_latest_electron_version functions: Added >&2 to log statements
- create_backup functions: Added sudo to stat and all file checks
- Ensures backup works with restricted /home/kiosk permissions

The update process should now complete successfully without permission errors
or garbled version output.
2025-11-20 16:32:17 +00:00
Claude 4f2435ca35 Fix kiosk detection to handle restricted directory permissions
The scripts were failing to find the kiosk installation at /home/kiosk/kiosk-app
because the /home/kiosk directory has restricted permissions (drwxr-x---),
preventing regular users from reading it.

Changes in both update_electron.sh and install_kiosk_0.9.2-6.sh:

1. Updated find_kiosk_dir() to use sudo for all file checks
   - sudo test -f for checking if main.js exists
   - Prevents "permission denied" errors on restricted directories

2. Added Method 4: Detect from running electron process
   - Parses ps output to find electron executable path
   - Extracts app directory from the path
   - Provides fallback when directory searches fail

3. Updated get_current_electron_version functions
   - Use sudo test -f to check if package.json exists
   - Use sudo grep to read package.json and get version
   - Ensures version detection works with restricted permissions

4. Fixed directory existence checks
   - Use sudo test -d for checking kiosk directory

These changes allow the scripts to:
- Find kiosk installations in directories with restricted permissions
- Detect installations even when run as a regular user
- Work correctly with the standard /home/kiosk setup (drwxr-x---)
- Provide better fallback detection using running processes

The scripts will now prompt for sudo password when needed to check
for files in restricted directories, then continue normally.
2025-11-20 16:24:31 +00:00
Claude 2d05767193 Fix update_electron.sh to run without sudo
Changed the script to run as a regular user instead of requiring sudo.
The script now:
- Checks that it's NOT being run as root (prevents sudo usage)
- Uses sudo for individual commands that need elevated privileges
- Prompts for sudo password only when needed

Changes:
- Removed EUID check that required running with sudo
- Added check to prevent running as root
- Added sudo to backup operations (mkdir, cp, file writes)
- All systemctl and npm install commands already use sudo appropriately

This matches the behavior of install_kiosk scripts which should be run
as a regular user, not with sudo.

Usage: ./update_electron.sh (not sudo ./update_electron.sh)
2025-11-20 15:57:40 +00:00
Claude f0ded0618e Add install_kiosk_0.9.2-6.sh with enhanced Electron update functionality
This new version of the install script includes a completely rewritten
manual Electron update tool that fixes all the issues with the previous version:

NEW FEATURES:
- Smart installation detection across multiple locations
- Verifies Electron is actually running (not just installed)
- Gets current version from both package.json and node_modules
- Fetches latest stable version from npm with multiple fallback methods
- Clear version comparison display (current vs latest)
- Breaking changes warning with direct links to Electron documentation
- Automatic backup creation before any changes
- Provides clear restore instructions
- Multiple user confirmation prompts before making changes
- Automatic rollback if update fails
- Fixes chrome-sandbox permissions after installation
- Manages kiosk service stop/start automatically

FIXES:
- No more "no electron app found" errors
- No more "script just bails" - proper error handling throughout
- Proper detection of running Electron instances
- Network failure handling with multiple fallback methods
- Clear feedback at every step of the process

The enhanced update tool is accessible from:
Advanced Menu → Manual Electron Update

Version updated from 0.9.2 to 0.9.2-6 to reflect the enhancement.
2025-11-20 15:51:42 +00:00
outis1one 8da75aad9e Merge pull request #25 from outis1one/claude/fix-electron-update-script-01QPE5RtAF7bnHevbFM8vZaW
Add comprehensive Electron update script with safety checks
2025-11-20 10:45:58 -05:00
Claude ecbfd19bb5 Add comprehensive Electron update script with safety checks
This script addresses issues with the manual Electron update process by:

- Detecting kiosk installation across multiple methods (user home, systemd service)
- Checking if Electron is actually running (not just installed)
- Getting current Electron version from both package.json and node_modules
- Fetching latest stable Electron version from npm registry with fallbacks
- Displaying clear version comparison (current vs latest)
- Warning users to check for breaking changes with links to documentation
- Creating automatic backups of package.json, package-lock.json, and version info
- Providing clear restore instructions if something goes wrong
- Requiring user confirmation at multiple steps before making changes
- Automatically attempting rollback if the update fails
- Fixing chrome-sandbox permissions after installation
- Managing kiosk service stop/start around the update

The script handles edge cases like:
- Missing or moved installations
- Network failures when fetching versions
- Failed npm installations with automatic recovery
- Permission issues with proper sudo user handling

Users can now safely update Electron with confidence that they can restore
if needed, and with clear visibility into what versions are being used.
2025-11-20 15:10:29 +00:00
outis1one f3274b2263 Merge pull request #23 from outis1one/claude/fix-home-popup-all-sites-01UucXN54dG7YwCgWjaUN6pM
Claude/fix home popup all sites 01 uuc xn54d g7 yw cg wja un6p m
2025-11-19 17:37:37 -05:00
Claude cd0bedf9d4 Fix pause button: resend visibility on page load
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.
2025-11-19 22:30:35 +00:00
Claude efeae325cd Fix VERSION constant to 0.9.2 in main.js 2025-11-19 20:54:20 +00:00
Claude 0af83fd8bb Add diagnostic script for pause button troubleshooting 2025-11-19 20:49:12 +00:00
outis1one b4e5658a2b Merge pull request #22 from outis1one/claude/fix-home-popup-all-sites-01UucXN54dG7YwCgWjaUN6pM
Add pause button for timed rotation sites (v0.9.2)
2025-11-19 15:36:19 -05:00
Claude 1378d5d92b Add pause button for timed rotation sites (v0.9.2)
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.
2025-11-19 20:33:14 +00:00
outis1one 8d904405ae Merge pull request #21 from outis1one/claude/fix-home-popup-all-sites-01UucXN54dG7YwCgWjaUN6pM
Fix home return popup for timed rotation sites (v0.9.1-1)
2025-11-19 10:29:00 -05:00
Claude abda91d477 Fix home return popup for timed rotation sites (v0.9.1-1)
The home return inactivity popup was only working on manual sites (duration=0)
and hidden sites, but not on timed rotation sites (duration>0). This was because
the site rotation logic had an early return statement that prevented the home
return check from ever executing.

Changes:
- Removed early return after rotateToNextSite() call (line 3605)
- Now both auto-rotation AND home return checking work together
- Home popup will appear on ALL site types after inactivity period
- Updated version to 0.9.1-1 with changelog

Technical details:
The master timer had two sections - section 6 for site rotation and section 7
for home return checking. When a timed site rotated, section 6 would return
early, preventing section 7 from executing. Removing the return allows both
features to work in harmony.
2025-11-19 15:25:45 +00:00
outis1one 0e7be83bc1 Merge pull request #20 from outis1one/claude/fix-pause-button-rotation-01EAoiabjaWEeEbZ1WxWfp7j
Claude/fix pause button rotation 01 e aoiabja w ee eb z1 wx wfp7j
2025-11-18 22:01:34 -05:00
Claude 169264f02e CRITICAL FIX: Move pause button variables outside DOMContentLoaded
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.
2025-11-19 02:45:22 +00:00
Claude b13d5c2f6f Add diagnostic script and manual fix guide for pause button issues
- diagnose_pause_button.sh: Checks actual kiosk installation for correct fixes
- MANUAL_FIX_pause_button.txt: Step-by-step manual patching guide

Helps troubleshoot when pause button doesn't appear on rotation sites
2025-11-18 21:59:52 +00:00
Claude 792b6a89c2 Add standalone update script for 0.9.2 critical fixes
Creates update_0.9.2_fixes.sh to apply fixes to existing installations:
- Return-to-home logic (manual sites only)
- Pause button auto-hide (5 second timeout)
- Display schedule overnight/same-day logic

Features:
- Auto-detects kiosk installation location
- Creates timestamped backups before applying fixes
- Uses sed to surgically patch existing files
- Prompts to restart kiosk service after update
- Smaller and faster than full reinstall
2025-11-18 20:13:35 +00:00
Claude 561f7e0574 Fix return-to-home logic, pause button auto-hide, Electron update detection, and display schedule
**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
2025-11-18 20:07:11 +00:00
Claude ae6aede112 Add pause button debug logging and fix inactivity prompt on manual sites
- 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
2025-11-18 19:54:30 +00:00
outis1one 6c99cfa5d5 Merge pull request #19 from outis1one/claude/fix-pause-button-rotation-01EAoiabjaWEeEbZ1WxWfp7j
Fix pause button behavior and Electron update path detection
2025-11-18 14:33:52 -05:00
Claude 644bfbed7a Fix pause button behavior and Electron update path detection
- Change pause button icon from emoji to proper pause symbol (two vertical bars)
- Update pause button title to 'Pause rotation' for clarity
- Improve pause button logic comments for better code documentation
- Add additional search paths for manual Electron update (HOME, parent dir)
- Enhance manual Electron update error message with more search locations

Fixes pause button display issues and improves kiosk-app detection
2025-11-18 19:31:43 +00:00
outis1one 213f5fdb5f Merge pull request #18 from outis1one/claude/rename-kiosk-installer-01WBJikKwa8hWk7CGrYu9EVS
Add install_kiosk_0.9.2.sh installer script
2025-11-18 13:25:03 -05:00
Claude 746742ae44 Add install_kiosk_0.9.2.sh installer script
Created new version 0.9.2 installer based on 0.9.1 with updated version references throughout the script.
2025-11-18 18:15:52 +00:00
outis1one 030633d480 Merge pull request #17 from outis1one/claude/rename-kiosk-installer-01Be4mqFc9qyLQrmQZhAbLjc
Claude/rename kiosk installer 01 be4mq fc9qy l qrm q zh ab ljc
2025-11-18 12:30:38 -05:00
Claude 1521b7e54f Version 0.9.1-2: Critical fixes for pause button and Electron update
Major Fixes:
1. FIXED: Pause button visibility logic completely rewritten
   - Pause button now properly hidden on duration=0 sites
   - Shows ONLY on user interaction (mousedown/touchstart/keydown)
   - Main process sends pause-button-visibility on tab switch
   - Preload receives visibility state and enforces it
   - Button hidden immediately when switching to manual sites

2. FIXED: Pause dialog window conflict resolved
   - Created separate pauseWindow variable (was reusing promptWindow)
   - Pause dialog no longer disappears immediately
   - Prevents conflicts with inactivity prompt window
   - Each dialog has its own window lifecycle

3. FIXED: Mixed header characters now uniform
   - All =--- and =-- patterns replaced with ---
   - Consistent use of dashes throughout script
   - Better terminal display compatibility

4. FIXED: Manual Electron update detection improved
   - Three-method detection strategy:
     * Method 1: Check /home/kiosk/kiosk-app
     * Method 2: Search all /home/*/kiosk-app with main.js verification
     * Method 3: Check current directory for kiosk-app
   - Added debug output showing search paths and current context
   - More robust detection across different installation scenarios

Implementation Details:
- pauseButtonShouldShow tracks if button is allowed on current site
- pauseButtonShown tracks if button is currently displayed
- User interaction only shows button if pauseButtonShouldShow is true
- attachView() sends visibility message on every tab switch
- Throttled user interaction handling (100ms) prevents spam
2025-11-18 17:22:28 +00:00
Claude f65e99c8fb Version 0.9.1-2: Fix npm installation and pause button behavior
Critical Fixes:
- FIXED: npm installation verification added
  * Now explicitly checks if npm is installed after nodejs
  * Falls back to installing npm separately if missing
  * Displays npm version after installation
  * Prevents "npm: command not found" error during Electron install

- FIXED: Pause button now appears only on user interaction
  * Hidden by default (display:none)
  * Shows on mousedown/touchstart/keydown events
  * Similar behavior to keyboard icon
  * Throttled to check every 5 seconds
  * Better UX - less visual clutter

- FIXED: Pause button hidden on manual sites (duration=0)
  * Main process checks site duration when visibility requested
  * Sends pause-button-visibility message to views
  * attachView() function controls visibility on tab switch
  * Prevents confusion on sites where return-to-home popup appears

Implementation:
- Added 'request-pause-button-visibility' IPC message
- Main process responds with 'pause-button-visibility' based on duration
- Pause button automatically hidden/shown when switching tabs
- User interaction triggers visibility check
2025-11-18 16:29:35 +00:00
outis1one 98ea864ec5 Merge pull request #16 from outis1one/claude/rename-kiosk-installer-01Be4mqFc9qyLQrmQZhAbLjc
Version 0.9.1-2: Critical fixes and improvements
2025-11-18 11:06:45 -05:00
Claude 7e1809faa6 Version 0.9.1-2: Critical fixes and improvements
Key Changes:
- FIXED: All box drawing characters replaced with consistent standard chars
  * Changed === to --- for better terminal compatibility
  * Removed all special Unicode box drawing symbols

- FIXED: Pause button time options now match return-to-home dialog
  * Changed from 5/15/30/60 to 15/30/60/120 minutes
  * Consistent user experience across both dialogs
  * Icons match the inactivity prompt style

- FIXED: Site rotation now respects user interaction
  * Rotation pauses for 1 minute after last user activity
  * Prevents sites from rotating while user is actively using them
  * Similar to keyboard auto-close behavior (30 sec inactivity)
  * Provides better UX - no interruptions during use

- FIXED: Manual Electron update directory detection
  * Now dynamically searches for kiosk installation
  * Checks /home/kiosk/kiosk-app first
  * Falls back to searching all /home/*/kiosk-app directories
  * Displays detected user and directory path
  * Fixes "directory not found" error

Implementation Details:
- Pause button works on all pages including home URL
- Rotation logic: respects both pause extension AND user activity
- Electron update creates backup before updating
- Verifies update completion and offers rollback if needed
2025-11-18 16:00:06 +00:00
outis1one 206916a31b Delete install_kiosk_v09.9.1_4.sh 2025-11-18 10:11:23 -05:00
outis1one 4eb796f8d5 Merge pull request #15 from outis1one/claude/rename-kiosk-installer-01Be4mqFc9qyLQrmQZhAbLjc
Release v0.9.0 and v0.9.1: Major improvements and fixes
2025-11-18 10:10:37 -05:00
Claude 97143a7104 Release v0.9.0 and v0.9.1: Major improvements and fixes
Version 0.9.0:
- Renamed from v09.9.1_4 to use cleaner version numbering (0.9.0)
- Updated all internal version references

Version 0.9.1 - New Features and Fixes:
- NEW: Pause button feature (bottom-left, orange button)
  * Allows users to pause rotation and inactivity timers
  * Time extension options: 5, 15, 30, or 60 minutes
  * After extension expires, normal rotation/home logic resumes
  * Provides better user control without complex automation

- FIXED: Site rotation timing now more consistent
  * Rotation now happens on schedule regardless of user interaction
  * User activity only blocks return-to-home, not site rotation
  * Sites will display for their configured duration more reliably
  * Added logging to show rotation timing

- FIXED: Manual Electron update feature completely rewritten
  * Added comprehensive error checking at each step
  * Creates backup before updating
  * Verifies update after completion
  * Provides rollback instructions if update fails
  * Shows current and new versions
  * Logs update process to /tmp/electron-update.log

- IMPROVED: Removed all box drawing characters (╔╗╝╚) from output
  * Replaced with standard characters for better compatibility

- IMPROVED: Code cleanup and better comments throughout
2025-11-18 15:07:05 +00:00
outis1one 2a9f05144d Delete install_kiosk_v09.9.1_2.sh 2025-11-18 10:02:18 -05:00