fix(webui): keep sandbox state counts across filters#961
Conversation
d5b3f0f to
851cddb
Compare
Review: PR #961 – fix(web): keep sandbox state counts across filtersFiles changed: 1 · SummaryThe PR correctly fixes the reported bug (#960). By always fetching the full sandbox list and applying the state filter client-side, badge counts now accurately reflect the full dataset regardless of which tab is active. The implementation is clean and introduces no correctness issues or security concerns. Positive aspects
Issues found1. Redundant
|
Fetch the full sandbox list for the page and derive Running and Paused badge counts from that full response. Apply the selected state tab and text search locally to the displayed table rows, while preserving the immediate refetch behavior on tab changes. This keeps badge counts visible when switching tabs without backend changes or API contract changes. Signed-off-by: zhengyilei <zheng_yilei@qq.com>
851cddb to
b2565f6
Compare
Background
On the WebUI sandbox page, selecting the
Runningtab could make thePausedbadge count disappear even when paused sandboxes still existed.The page requested a state-filtered sandbox list and then calculated all status badge counts from that already-filtered response. As a result, switching tabs could make the badge counts reflect only the current tab instead of the full sandbox list.
What Changed
RunningandPausedbadge counts from the full list.The state filter is now local because badge counts need the full list. The explicit tab-change refetch is intentional, it preserves the previous immediate-refresh behavior, while the five-second polling interval remains the background refresh mechanism.
Validation
npm ci --no-audit --no-fundnpm run buildgit diff --checkManual validation:
npm run dev/cubeapiVite proxy to CubeAPIAll,Running, andPausedkeeps the paused badge count visible whenRunningis selectedRelated
Fixes #960.