# Post-Redesign Bugfix Plan

## Issue 1: Sidebar on Login Page
- **Root Cause:** In App.vue, the <router-view> was unconditionally wrapped inside the sidebar layout <aside>. 
- **Fix:** Added -if="route.meta.requiresAuth" to the <aside> and mobile <header> components. This perfectly hides the sidebar on the /login and /share/:token pages.
- **Status:** FIXED.

## Issue 2: Offline Detection is Slow (Not Realtime)
- **Root Cause:** The system relies on a dual-checking mechanism for "online" status. It checks both WireGuard handshake times (which take up to 2 minutes to expire organically) and the API heartbeat ping stored in Redis. The Redis TTL was set to 90 seconds. Since the Device Agent sends a heartbeat every 30 seconds, 90 seconds allows up to 2 missed heartbeats before declaring it offline.
- **Fix:** Reduced the Redis TTL in pps/server-core/internal/heartbeat/redis.go from 90*time.Second to 40*time.Second. This allows just 1 missed heartbeat (plus 10s buffer) before the system falls back. It makes offline detection for active agents drop to ~40 seconds instead of 90-120 seconds.
- **Status:** FIXED.

## Issue 3: Traffic Chart Empty / Refresh Not Smooth
- **Root Cause (Refresh):** The setInterval polling every 10 seconds was calling etchTrafficData(), which explicitly set loading.value = true every single time. This caused the UI to flash "Loading..." and clear the chart temporarily every 10 seconds.
- **Fix (Refresh):** Passed a ackground = true flag to etchTrafficData() when called from the interval, which skips setting loading.value = true. The data now silently updates in the background.
- **Root Cause (Empty):** The traffic history chart displays data from the device_traffic database table. The agent synchronizes traffic in batches. If the user just started the agent, there might not be historical data saved yet, or the time range was too narrow. The frontend logic (data.devices || []) perfectly matches the API summary response.
- **Status:** FIXED.
