Files
shopdb/shopfloor-dashboard/index.html
cproudlock 0d6bef5c41 Fix carousel reset on data refresh - preserve index
The carousel was resetting to index 0 every 10 seconds when the dashboard
refreshed data from the API. This caused the carousel to show:
- 0s: test 2 (index 0)
- 5s: test again (index 1)
- 10s: DATA REFRESH → reset to test 2 (index 0) 

Fixed by:
- Preserving currentUpcomingIndex across renderEvents() calls
- Only reset index if it's out of range for new data
- Render the currently active event instead of always starting at 0
- Added logging to show index preservation

Now the carousel cycles continuously through all 4 events without
resetting when the page refreshes data every 10 seconds.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 09:13:56 -05:00

37 KiB