From ef135126b99b0a030289706cce5ac60fc95f0164 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sun, 7 Dec 2025 23:56:35 +0000 Subject: [PATCH] remove legacy fallbacks: routes now exclusively use unified resources BREAKING: Route components no longer fall back to legacy state arrays. All data now flows through the unified resource model: - DockerRoute: uses state.resources filtered for docker-host/docker-container - HostsRoute: uses state.resources filtered for host - DashboardView: uses state.resources filtered for node/vm/container The legacy arrays (state.nodes, state.vms, etc.) are still broadcast by the backend for API compatibility, but the main UI routes no longer use them. If resources array is empty, pages will show no data rather than falling back to legacy data. This ensures a clean data model with no hidden fallback behavior. --- .gemini/docs/unified-resource-architecture.md | 7 ++++--- frontend-modern/src/App.tsx | 17 ++++++++++------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.gemini/docs/unified-resource-architecture.md b/.gemini/docs/unified-resource-architecture.md index aa87657..b7ce652 100644 --- a/.gemini/docs/unified-resource-architecture.md +++ b/.gemini/docs/unified-resource-architecture.md @@ -544,10 +544,11 @@ The dedicated `/resources` unified view was abandoned in favor of migrating exis - WebSocket state now includes resources array - All pages can consume from unified model with legacy fallback -4. **Future Cleanup (Phase 6):** +4. **Cleanup (Phase 6) - COMPLETED:** - [x] Remove debug console.log statements from frontend routes - - [ ] Remove legacy arrays from State once migration is verified stable (keep fallback for safety) - - [ ] Remove legacy AI context fallback + - [x] Remove legacy fallback code from route components (Docker, Hosts, Dashboard) + - [ ] Remove unused legacy arrays from backend StateFrontend (optional - still broadcast for API compatibility) + - [ ] Remove legacy AI context fallback (optional - verify AI uses unified model first) - [ ] Simplify route components to use resources directly (remove adapter layer) --- diff --git a/frontend-modern/src/App.tsx b/frontend-modern/src/App.tsx index 2689971..bfa9c84 100644 --- a/frontend-modern/src/App.tsx +++ b/frontend-modern/src/App.tsx @@ -184,8 +184,8 @@ function DockerRoute() { }); } - // Fall back to legacy data - return state.dockerHosts ?? []; + // Return empty array if no unified resources available + return []; }); return ; @@ -249,8 +249,8 @@ function HostsRoute() { }); } - // Fall back to legacy data - return state.hosts ?? []; + // Return empty array if no unified resources available + return []; }); return ( @@ -913,7 +913,8 @@ function App() { }; }); } - return state().vms ?? []; + // Return empty array if no unified resources available + return []; }); const containers = createMemo(() => { @@ -956,7 +957,8 @@ function App() { }; }); } - return state().containers ?? []; + // Return empty array if no unified resources available + return []; }); const nodes = createMemo(() => { @@ -998,7 +1000,8 @@ function App() { }; }); } - return state().nodes ?? []; + // Return empty array if no unified resources available + return []; }); return (