Skip to content

Commit 6712d97

Browse files
committed
🐛 fix: resolve UI flicker patterns in AlertsContext
Combine two separate useEffect hooks monitoring mcpData.isLoading into a single effect that handles both the timeout-set (when loading starts) and the timeout-clear (when loading stops). This eliminates the intermediate render cycle that caused UI flicker. Signed-off-by: KubeStellar Scanner <scanner@kubestellar.io>
1 parent 9c99cb1 commit 6712d97

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

web/src/contexts/AlertsContext.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,10 @@ import { createStateContext } from './createStateContext'
4141
import { applyMutations, createAlertRulesEngine, generateId, shallowEqualRecords } from './alertRulesEngine'
4242

4343
const AlertsDataFetcher = safeLazy(() => import('./AlertsDataFetcher'), 'default')
44-
45-
/** Fallback frame time (ms) for MCP update batching when requestAnimationFrame is unavailable (~60fps). */
4644
const MCP_UPDATE_BATCH_FRAME_FALLBACK_MS = 16
47-
48-
/** Storage key for persisted alert rules */
4945
const ALERT_RULES_KEY = 'kc_alert_rules'
50-
51-
/** Maximum time (ms) to wait for initial MCP data before timing out. */
5246
const LOADING_TIMEOUT_MS = 30_000
53-
54-
/** Delay (ms) before first alert evaluation after mount to allow data fetching to settle. */
5547
const INITIAL_EVALUATION_DELAY_MS = 1000
56-
57-
/** Interval (ms) between periodic alert rule evaluations. */
5848
const EVALUATION_INTERVAL_MS = 30000
5949

6050
const {

0 commit comments

Comments
 (0)