Fix manual swipe behavior to resume rotation

CRITICAL FIX: Manual swipes now properly resume rotation instead of keeping it paused.

The issue:
- User interacts with page A → rotation pauses
- User swipes to page B → rotation should resume, but was staying paused
- This was because manualNavigationMode stayed true

The fix:
- nextTab() and prevTab() now set manualNavigationMode=false AFTER markActivity
- This overrides the manualNavigationMode=true set by markActivity
- Manual swipes are navigation, not content interaction
- Rotation will now resume on the new page (if it has duration > 0)

Complete flow now:
1. User touches page → manualNavigationMode=true → rotation pauses
2. After 2min idle → prompt appears with options:
   - "Return to Rotation" → manualNavigationMode=false → rotation resumes
   - "I'm still here" → manualNavigationMode stays true → rotation stays paused
   - Time extension → rotation paused during extension, prompt reappears when expires
   - No response (15sec) → auto-returns to rotation
3. User swipes to new page → manualNavigationMode=false → rotation resumes

Technical changes:
- Lines 4054-4072: Reordered nextTab() to set manualNavigationMode=false AFTER markActivity
- Lines 4074-4092: Reordered prevTab() to set manualNavigationMode=false AFTER markActivity
- Time extensions still cleared on manual swipe (correct behavior)
This commit is contained in:
Claude
2025-11-17 13:21:19 +00:00
parent a3bf3ec8d1
commit f1c560a566
+12 -6
View File
@@ -4053,36 +4053,42 @@ function attachView(i,isAutoRotation){
function nextTab(){
if(!views.length||showingHidden)return;
console.log('[MANUAL] User switched tab forward → manualNavigationMode=TRUE');
// CRITICAL FIX: Clear time extension when user manually switches tabs
// v0.9.10: Clear time extension when user manually switches tabs
// If user granted time on one page, then manually left, they're done with it
if(inactivityExtensionUntil>0){
console.log('[MANUAL] ⏰ Clearing time extension - user manually switched tabs');
inactivityExtensionUntil=0;
}
manualNavigationMode=true;
currentIndex=(currentIndex+1)%views.length;
attachView(currentIndex);
markActivity(true); // Actual user interaction - reset lockout timer
// v0.9.10: Manual swipe RESUMES rotation on new page
// This is navigation, not content interaction - set AFTER markActivity
manualNavigationMode=false;
console.log('[MANUAL] User switched tab forward → manualNavigationMode=FALSE (rotation will resume)');
}
function prevTab(){
if(!views.length||showingHidden)return;
console.log('[MANUAL] User switched tab backward → manualNavigationMode=TRUE');
// CRITICAL FIX: Clear time extension when user manually switches tabs
// v0.9.10: Clear time extension when user manually switches tabs
// If user granted time on one page, then manually left, they're done with it
if(inactivityExtensionUntil>0){
console.log('[MANUAL] ⏰ Clearing time extension - user manually switched tabs');
inactivityExtensionUntil=0;
}
manualNavigationMode=true;
currentIndex=(currentIndex-1+views.length)%views.length;
attachView(currentIndex);
markActivity(true); // Actual user interaction - reset lockout timer
// v0.9.10: Manual swipe RESUMES rotation on new page
// This is navigation, not content interaction - set AFTER markActivity
manualNavigationMode=false;
console.log('[MANUAL] User switched tab backward → manualNavigationMode=FALSE (rotation will resume)');
}
function getHomeViewIndex(){