Skip to content

Commit 8b21ca0

Browse files
committed
chore: downgrade version from 7.4.3 to 7.3.10 and update development guidelines for manual version management
1 parent c409ed7 commit 8b21ca0

File tree

4 files changed

+149
-12
lines changed

4 files changed

+149
-12
lines changed

.github/MEMORY.md

Lines changed: 75 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
# Huntarr Development Memory
22

3-
## Bug Fix: Low Usage Mode Stats Display Issue (v7.4.0 - v7.4.1)
3+
## Version 7.3.10 - Comprehensive UI Improvements
4+
5+
**Date:** 2025-05-25
6+
**Summary:** Major release addressing multiple UI/UX issues related to low usage mode, countdown timers, and user feedback accuracy.
7+
8+
**Key Improvements:**
9+
1. **Low Usage Mode Stats Fix** - Fixed incorrect stats display when low usage mode is enabled
10+
2. **Countdown Timer Startup** - Changed "Error Loading" to "Waiting for Cycle" during startup
11+
3. **Reset Button Behavior** - Improved "Refreshing" feedback to stay until genuinely new data is available
12+
4. **Development Guidelines** - Added version number management guidelines
13+
14+
**Files Modified:**
15+
- `frontend/static/js/new-main.js` - Low usage mode detection and stats display fixes
16+
- `frontend/static/js/cycle-countdown.js` - Startup messaging and reset behavior improvements
17+
- `.github/listen.MD` - Added version number management guidelines
18+
19+
**Tags:** ["major_release", "ui_improvements", "low_usage_mode", "countdown_timers", "user_experience"]
20+
21+
---
22+
23+
## Bug Fix: Low Usage Mode Stats Display Issue (v7.3.10)
424

525
**Date:** 2025-05-25
626
**Issue:** When low usage mode is enabled, stats on the home page sometimes display incorrect numbers (showing old/cached values instead of current stats).
@@ -12,7 +32,6 @@
1232

1333
**Files Modified:**
1434
- `frontend/static/js/new-main.js` - Added low usage mode detection, fixed initialization order, and improved state detection
15-
- `version.txt` - Incremented to 7.4.1
1635

1736
**Code Changes:**
1837
```javascript
@@ -40,7 +59,7 @@ this.checkLowUsageMode().then(() => {
4059

4160
**Tags:** ["bug_fix", "frontend", "low_usage_mode", "stats", "animations", "race_condition"]
4261

43-
## UI Improvement: Countdown Timer Startup Messaging (v7.4.2)
62+
## UI Improvement: Countdown Timer Startup Messaging (v7.3.10)
4463

4564
**Date:** 2025-05-25
4665
**Issue:** When Docker container starts/restarts, countdown timers show "Error Loading" initially, which is confusing to users since it's not actually an error - the timer is just waiting for the first app cycle to complete so it can calculate the next cycle time.
@@ -55,7 +74,6 @@ this.checkLowUsageMode().then(() => {
5574

5675
**Files Modified:**
5776
- `frontend/static/js/cycle-countdown.js` - Improved startup messaging and error handling
58-
- `version.txt` - Incremented to 7.4.3
5977

6078
**Code Changes:**
6179
```javascript
@@ -73,4 +91,57 @@ timerValue.style.color = '#00c2ce'; // Light blue like refreshing state
7391

7492
**Tags:** ["ui_improvement", "frontend", "countdown_timer", "startup", "user_experience"]
7593

94+
## UI Improvement: Countdown Timer Reset Behavior (v7.3.10)
95+
96+
**Date:** 2025-05-25
97+
**Issue:** When pressing the reset button on countdown timers, "Refreshing" message only stays for about 1 second then disappears, which is misleading because the actual reset process takes much longer (the app needs to complete a full cycle before new timer data is available).
98+
**Root Cause:** The reset button logic was using a simple 2-second timeout before fetching new data, but the actual reset process can take several minutes depending on the app's cycle duration.
99+
100+
**Solution:**
101+
1. Implemented intelligent polling system that keeps "Refreshing" displayed until actual new timer data is available
102+
2. Added `data-waiting-for-reset` attribute to track timers waiting for reset data
103+
3. Modified `updateTimerDisplay()` to respect the waiting state and not override "Refreshing" message
104+
4. Added `startResetPolling()` function that polls every 5 seconds for up to 5 minutes
105+
5. **CRITICAL FIX**: Store original cycle time before reset and only consider reset complete when receiving a *different* cycle time
106+
6. Only removes "Refreshing" when genuinely new countdown data is received (not just the same old data)
107+
108+
**Files Modified:**
109+
- `frontend/static/js/cycle-countdown.js` - Improved reset button behavior and polling logic
110+
- `.github/listen.MD` - Added guidance to not update version numbers automatically
111+
112+
**Code Changes:**
113+
```javascript
114+
// Before: Simple timeout that was misleading
115+
setTimeout(() => {
116+
fetchFromSleepJson();
117+
}, 2000);
118+
119+
// After: Intelligent polling that waits for genuinely new data
120+
function startResetPolling(app) {
121+
const pollInterval = setInterval(() => {
122+
fetchFromSleepJson().then(() => {
123+
if (nextCycleTimes[app]) {
124+
const currentCycleTime = nextCycleTimes[app].getTime();
125+
const originalCycleTime = parseInt(timerElement.getAttribute('data-original-cycle-time'));
126+
127+
// Only consider reset complete if we have a DIFFERENT cycle time
128+
if (originalCycleTime === null || currentCycleTime !== originalCycleTime) {
129+
// Genuinely new data received, stop polling and update display
130+
timerElement.removeAttribute('data-waiting-for-reset');
131+
clearInterval(pollInterval);
132+
updateTimerDisplay(app);
133+
} else {
134+
// Same old data, keep polling
135+
console.log('Same cycle time, continuing to poll for new data');
136+
}
137+
}
138+
});
139+
}, 5000); // Poll every 5 seconds
140+
}
141+
```
142+
143+
**User Experience:** Users now see "Refreshing" for the appropriate duration until the reset process actually completes and new countdown data is available, providing accurate feedback about the system state.
144+
145+
**Tags:** ["ui_improvement", "frontend", "countdown_timer", "reset_behavior", "polling", "user_feedback"]
146+
76147
---

.github/listen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ docker logs -f huntarr
357357
14. **Check for undefined variables** in JavaScript before deploying
358358
15. **Use environment detection** instead of hard-coded paths
359359
16. **Create memories** for significant fixes and features
360-
17. **Update version.txt** when making changes
360+
17. **DO NOT update version.txt automatically** - Version numbers are manually managed by the user during publishing
361361
18. **Test API endpoints** after backend changes
362362
19. **Verify UI responsiveness** across different screen sizes
363363
20. **Check logs after every rebuild** - `docker logs huntarr`

frontend/static/js/cycle-countdown.js

Lines changed: 72 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,27 +202,88 @@ window.CycleCountdown = (function() {
202202
button.addEventListener('click', function() {
203203
const app = this.getAttribute('data-app');
204204
if (app) {
205-
console.log(`[CycleCountdown] Reset button clicked for ${app}, will update timer in 2 seconds`);
205+
console.log(`[CycleCountdown] Reset button clicked for ${app}, will keep refreshing until new timer data is available`);
206206

207-
// Add a loading state to the timer
207+
// Add a loading state to the timer and mark it as waiting for reset
208208
const timerElement = document.getElementById(`${app}CycleTimer`);
209209
if (timerElement) {
210210
const timerValue = timerElement.querySelector('.timer-value');
211211
if (timerValue) {
212+
// Store the original next cycle time before reset
213+
const originalNextCycle = nextCycleTimes[app] ? nextCycleTimes[app].getTime() : null;
214+
timerElement.setAttribute('data-original-cycle-time', originalNextCycle);
215+
212216
timerValue.textContent = 'Refreshing';
213217
timerValue.classList.add('refreshing-state');
218+
timerValue.style.color = '#00c2ce';
219+
// Mark this timer as waiting for reset data
220+
timerElement.setAttribute('data-waiting-for-reset', 'true');
214221
}
215222
}
216223

217-
// Wait a moment for the backend to process the reset
218-
setTimeout(() => {
219-
fetchFromSleepJson();
220-
}, 2000);
224+
// Start polling for new data more frequently after reset
225+
startResetPolling(app);
221226
}
222227
});
223228
});
224229
}
225230

231+
// Poll more frequently after a reset until new data is available
232+
function startResetPolling(app) {
233+
let pollAttempts = 0;
234+
const maxPollAttempts = 60; // Poll for up to 5 minutes (60 * 5 seconds)
235+
236+
const pollInterval = setInterval(() => {
237+
pollAttempts++;
238+
console.log(`[CycleCountdown] Polling attempt ${pollAttempts} for ${app} reset data`);
239+
240+
fetchFromSleepJson()
241+
.then(() => {
242+
// Check if we got new data for this specific app
243+
const timerElement = document.getElementById(`${app}CycleTimer`);
244+
if (timerElement && timerElement.getAttribute('data-waiting-for-reset') === 'true') {
245+
// Check if we have valid next cycle time for this app
246+
if (nextCycleTimes[app]) {
247+
const currentCycleTime = nextCycleTimes[app].getTime();
248+
const originalCycleTime = parseInt(timerElement.getAttribute('data-original-cycle-time'));
249+
250+
// Only consider reset complete if we have a DIFFERENT cycle time
251+
// or if the original was null (no previous timer)
252+
if (originalCycleTime === null || currentCycleTime !== originalCycleTime) {
253+
console.log(`[CycleCountdown] New reset data received for ${app} (original: ${originalCycleTime}, new: ${currentCycleTime}), stopping polling`);
254+
timerElement.removeAttribute('data-waiting-for-reset');
255+
timerElement.removeAttribute('data-original-cycle-time');
256+
clearInterval(pollInterval);
257+
updateTimerDisplay(app);
258+
} else {
259+
console.log(`[CycleCountdown] Same cycle time for ${app} (${currentCycleTime}), continuing to poll for new data`);
260+
}
261+
}
262+
}
263+
})
264+
.catch(() => {
265+
// Continue polling on error
266+
});
267+
268+
// Stop polling after max attempts
269+
if (pollAttempts >= maxPollAttempts) {
270+
console.log(`[CycleCountdown] Max polling attempts reached for ${app}, stopping`);
271+
const timerElement = document.getElementById(`${app}CycleTimer`);
272+
if (timerElement) {
273+
timerElement.removeAttribute('data-waiting-for-reset');
274+
timerElement.removeAttribute('data-original-cycle-time');
275+
const timerValue = timerElement.querySelector('.timer-value');
276+
if (timerValue) {
277+
timerValue.textContent = '--:--:--';
278+
timerValue.classList.remove('refreshing-state');
279+
timerValue.style.removeProperty('color');
280+
}
281+
}
282+
clearInterval(pollInterval);
283+
}
284+
}, 5000); // Poll every 5 seconds
285+
}
286+
226287
// Display initial loading message in the UI when sleep data isn't available yet
227288
function displayWaitingForCycle() {
228289
// For each app, display waiting message in timer elements
@@ -440,6 +501,11 @@ window.CycleCountdown = (function() {
440501
const timerValue = timerElement.querySelector('.timer-value');
441502
if (!timerValue) return;
442503

504+
// If this timer is waiting for reset data, don't update it
505+
if (timerElement.getAttribute('data-waiting-for-reset') === 'true') {
506+
return; // Keep showing "Refreshing" until reset data is available
507+
}
508+
443509
const nextCycleTime = nextCycleTimes[app];
444510
if (!nextCycleTime) {
445511
timerValue.textContent = '--:--:--';

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.4.3
1+
7.3.10

0 commit comments

Comments
 (0)