feat(webui): standardize content loading states

Use consistent delayed placeholders across data-backed console surfaces.
Avoid flashing loading UI for fast local responses while keeping slower transitions stable.
Keep failures visible and prevent gated content from opening on incomplete checks.
This commit is contained in:
DrSmoothl committed 2026-07-31 16:56:44 +08:00
1 parent f159b2f41a
commit 3c13838867
22 files changed
+2493 -1527

No files matched your search

@@ -2,6 +2,19 @@ import { createContext, useContext, type ReactNode } from 'react';
import type { AccountConnections, HookProcessInfo, QQInfo, SystemInfo, UpdateInfo } from '@/types';
import type { HookProcessOps } from '@/hooks/use-hook-process-ops';
export interface ResourceLoadState {
ready: boolean;
error: string | null;
}
export interface AppResourceState {
qqList: ResourceLoadState;
processList: ResourceLoadState;
systemInfo: ResourceLoadState;
connections: ResourceLoadState;
updateInfo: ResourceLoadState;
}
/**
* Live mutable state owned by AppLayout and shared with the child route
* components rendered inside its `<Outlet />`. Pages used to receive these
@@ -15,9 +28,12 @@ export interface AppStateValue {
connections: AccountConnections[];
/** Advisory update-availability info; null until the first check resolves. */
updateInfo: UpdateInfo | null;
/** Distinguishes an empty result from an unresolved or failed initial read. */
resources: AppResourceState;
selectedUin: string | null;
setSelectedUin: (uin: string | null) => void;
processOps: HookProcessOps;
refreshQqList: () => void;
refreshProcesses: () => void;
refreshSystem: () => void;
refreshConnections: () => void;