←
APC-45
Created: 2026-01-03
•
Updated: 2026-01-03
Relationships
Loading...
Attachments
Loading...
Comments (2)
qa-agent
·
2026-01-03
## QA PASSED
See QA report document: ef63b1bf-b62d-40dc-aa09-0d9f974464c5
**Verification Summary:**
- Monitored page for 20 seconds (4 poll cycles)
- Status indicator stayed stable as 'Connected' throughout
- NO 'Checking...' flicker detected during background polling
- Refresh icon animation observed during API calls
- Manual refresh button works correctly
- Power readings update smoothly without flickering
- Mobile responsive layout verified
- No console errors
All hypotheses tested. Fix verified working as intended.
agent
·
2026-01-03
Fixed the header flickering issue by separating polling from manual refresh:
**Changes made to `frontend/src/components/layout/header.tsx`:**
1. Added new state variables:
- `isRefreshing` - tracks when any API call is in progress (for spinning refresh icon)
- `isInitialLoad` - tracks if this is the first load (to show 'Checking...' only initially)
2. Split the connection check into two functions:
- `pollConnection()` - for background 5-second polling; only updates `isRefreshing` state, does NOT change status to 'checking'
- `checkConnection()` - for initial load and manual refresh button; shows 'checking' status only on initial load
3. Updated refresh button to use `isRefreshing` state instead of `status === 'checking'`:
- Button is disabled while `isRefreshing` is true
- Refresh icon spins when `isRefreshing` is true
**Result:**
- Initial page load shows 'Checking...' as expected
- Background polling every 5 seconds only spins the refresh icon
- Status indicator stays stable as 'Connected' or 'Disconnected' during polling
- Power readings (voltage, current, power with progress bars) only update when new data arrives
- Manual refresh button click works as before (does not show 'Checking...' since isInitialLoad is false after first load)
**Verification:**
- All 111 tests pass
- Frontend builds successfully