From 9fa7eb129de2918daddc72230ed39cf3ce335c01 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Thu, 2 Apr 2026 18:09:16 +0200 Subject: [PATCH] refactor: strip AppShell+Sidebar wrappers from all page components Co-Authored-By: Claude Opus 4.6 (1M context) --- src/pages/Admin/Admin.tsx | 7 +- src/pages/AgentHealth/AgentHealth.tsx | 29 ++- src/pages/AgentInstance/AgentInstance.tsx | 11 +- src/pages/ApiDocs/ApiDocs.tsx | 7 +- src/pages/AppDetail/AppDetail.tsx | 7 +- src/pages/Dashboard/Dashboard.tsx | 200 ++++++++++---------- src/pages/ExchangeDetail/ExchangeDetail.tsx | 20 +- src/pages/Routes/Routes.tsx | 12 +- 8 files changed, 129 insertions(+), 164 deletions(-) diff --git a/src/pages/Admin/Admin.tsx b/src/pages/Admin/Admin.tsx index b048a43..99c6414 100644 --- a/src/pages/Admin/Admin.tsx +++ b/src/pages/Admin/Admin.tsx @@ -1,9 +1,6 @@ import { useNavigate, useLocation } from 'react-router-dom' -import { AppShell } from '../../design-system/layout/AppShell/AppShell' -import { Sidebar } from '../../design-system/layout/Sidebar/Sidebar' import { TopBar } from '../../design-system/layout/TopBar/TopBar' import { Tabs } from '../../design-system/composites/Tabs/Tabs' -import { SIDEBAR_APPS } from '../../mocks/sidebar' import styles from './Admin.module.css' import type { ReactNode } from 'react' @@ -23,7 +20,7 @@ export function AdminLayout({ title, children }: AdminLayoutProps) { const location = useLocation() return ( - }> + <> {children} - + ) } diff --git a/src/pages/AgentHealth/AgentHealth.tsx b/src/pages/AgentHealth/AgentHealth.tsx index 1e0bf81..abcfc02 100644 --- a/src/pages/AgentHealth/AgentHealth.tsx +++ b/src/pages/AgentHealth/AgentHealth.tsx @@ -4,8 +4,6 @@ import { ChevronRight } from 'lucide-react' import styles from './AgentHealth.module.css' // Layout -import { AppShell } from '../../design-system/layout/AppShell/AppShell' -import { Sidebar } from '../../design-system/layout/Sidebar/Sidebar' import { TopBar } from '../../design-system/layout/TopBar/TopBar' // Composites @@ -28,7 +26,6 @@ import { useGlobalFilters } from '../../design-system/providers/GlobalFilterProv // Mock data import { agents, type AgentHealth as AgentHealthData } from '../../mocks/agents' -import { SIDEBAR_APPS } from '../../mocks/sidebar' import { agentEvents } from '../../mocks/agentEvents' // ── URL scope parsing ──────────────────────────────────────────────────────── @@ -317,19 +314,7 @@ export function AgentHealth() { const isFullWidth = scope.level !== 'all' return ( - } - detail={ - selectedInstance ? ( - setPanelOpen(false)} - title={selectedInstance.name} - tabs={detailTabs} - /> - ) : undefined - } - > + <> )} - + + {/* Detail panel (portals itself) */} + {selectedInstance && ( + setPanelOpen(false)} + title={selectedInstance.name} + tabs={detailTabs} + /> + )} + ) } diff --git a/src/pages/AgentInstance/AgentInstance.tsx b/src/pages/AgentInstance/AgentInstance.tsx index 002557e..2633fcd 100644 --- a/src/pages/AgentInstance/AgentInstance.tsx +++ b/src/pages/AgentInstance/AgentInstance.tsx @@ -4,8 +4,6 @@ import { ChevronRight } from 'lucide-react' import styles from './AgentInstance.module.css' // Layout -import { AppShell } from '../../design-system/layout/AppShell/AppShell' -import { Sidebar } from '../../design-system/layout/Sidebar/Sidebar' import { TopBar } from '../../design-system/layout/TopBar/TopBar' // Composites @@ -28,7 +26,6 @@ import { useGlobalFilters } from '../../design-system/providers/GlobalFilterProv // Data import { agents } from '../../mocks/agents' -import { SIDEBAR_APPS } from '../../mocks/sidebar' import { agentEvents } from '../../mocks/agentEvents' import { useState } from 'react' @@ -127,12 +124,12 @@ export function AgentInstance() { if (!agent) { return ( - }> + <>
Agent instance not found.
-
+ ) } @@ -153,7 +150,7 @@ export function AgentInstance() { const statusColor = agent.status === 'live' ? 'success' : agent.status === 'stale' ? 'warning' : 'error' return ( - }> + <> - + ) } diff --git a/src/pages/ApiDocs/ApiDocs.tsx b/src/pages/ApiDocs/ApiDocs.tsx index 9cbd739..71b54f0 100644 --- a/src/pages/ApiDocs/ApiDocs.tsx +++ b/src/pages/ApiDocs/ApiDocs.tsx @@ -1,12 +1,9 @@ -import { AppShell } from '../../design-system/layout/AppShell/AppShell' -import { Sidebar } from '../../design-system/layout/Sidebar/Sidebar' import { TopBar } from '../../design-system/layout/TopBar/TopBar' import { EmptyState } from '../../design-system/primitives/EmptyState/EmptyState' -import { SIDEBAR_APPS } from '../../mocks/sidebar' export function ApiDocs() { return ( - }> + <> - + ) } diff --git a/src/pages/AppDetail/AppDetail.tsx b/src/pages/AppDetail/AppDetail.tsx index 223394b..ebc6946 100644 --- a/src/pages/AppDetail/AppDetail.tsx +++ b/src/pages/AppDetail/AppDetail.tsx @@ -1,15 +1,12 @@ import { useParams } from 'react-router-dom' -import { AppShell } from '../../design-system/layout/AppShell/AppShell' -import { Sidebar } from '../../design-system/layout/Sidebar/Sidebar' import { TopBar } from '../../design-system/layout/TopBar/TopBar' import { EmptyState } from '../../design-system/primitives/EmptyState/EmptyState' -import { SIDEBAR_APPS } from '../../mocks/sidebar' export function AppDetail() { const { id } = useParams<{ id: string }>() return ( - }> + <> - + ) } diff --git a/src/pages/Dashboard/Dashboard.tsx b/src/pages/Dashboard/Dashboard.tsx index ed63d96..4e45016 100644 --- a/src/pages/Dashboard/Dashboard.tsx +++ b/src/pages/Dashboard/Dashboard.tsx @@ -4,8 +4,6 @@ import { TrendingUp, TrendingDown, ArrowRight, ExternalLink, AlertTriangle } fro import styles from './Dashboard.module.css' // Layout -import { AppShell } from '../../design-system/layout/AppShell/AppShell' -import { Sidebar } from '../../design-system/layout/Sidebar/Sidebar' import { TopBar } from '../../design-system/layout/TopBar/TopBar' // Composites @@ -287,106 +285,7 @@ export function Dashboard() { const totalErrors = processorErrors.length + (hasExchangeError && processorErrors.length === 0 ? 1 : 0) return ( - - } - detail={ - selectedExchange ? ( - setPanelOpen(false)} - title={`${selectedExchange.orderId} — ${selectedExchange.route}`} - > - {/* Link to full detail page */} -
- -
- - {/* Overview */} -
-
Overview
-
-
- Status - - - {statusLabel(selectedExchange.status)} - -
-
- Duration - {formatDuration(selectedExchange.durationMs)} -
-
- Route - {selectedExchange.route} -
-
- Customer - {selectedExchange.customer} -
-
- Agent - {selectedExchange.agent} -
-
- Correlation - {selectedExchange.correlationId} -
-
- Timestamp - {selectedExchange.timestamp.toISOString()} -
-
-
- - {/* Errors */} - {totalErrors > 0 && ( -
-
- Errors - {totalErrors > 1 && ( - - )} -
-
-
- {selectedExchange.errorClass ?? processorErrors[0]?.name} -
-
- {selectedExchange.errorMessage ?? `Failed at processor: ${processorErrors[0]?.name}`} -
-
-
- )} - - {/* Route Flow */} -
-
Route Flow
- -
- - {/* Processor Timeline */} -
-
- Processor Timeline - {formatDuration(selectedExchange.durationMs)} -
- -
-
- ) : undefined - } - > + <> {/* Top bar */} -
+ + {/* Detail panel (portals itself) */} + {selectedExchange && ( + setPanelOpen(false)} + title={`${selectedExchange.orderId} — ${selectedExchange.route}`} + > + {/* Link to full detail page */} +
+ +
+ + {/* Overview */} +
+
Overview
+
+
+ Status + + + {statusLabel(selectedExchange.status)} + +
+
+ Duration + {formatDuration(selectedExchange.durationMs)} +
+
+ Route + {selectedExchange.route} +
+
+ Customer + {selectedExchange.customer} +
+
+ Agent + {selectedExchange.agent} +
+
+ Correlation + {selectedExchange.correlationId} +
+
+ Timestamp + {selectedExchange.timestamp.toISOString()} +
+
+
+ + {/* Errors */} + {totalErrors > 0 && ( +
+
+ Errors + {totalErrors > 1 && ( + + )} +
+
+
+ {selectedExchange.errorClass ?? processorErrors[0]?.name} +
+
+ {selectedExchange.errorMessage ?? `Failed at processor: ${processorErrors[0]?.name}`} +
+
+
+ )} + + {/* Route Flow */} +
+
Route Flow
+ +
+ + {/* Processor Timeline */} +
+
+ Processor Timeline + {formatDuration(selectedExchange.durationMs)} +
+ +
+
+ )} + ) } diff --git a/src/pages/ExchangeDetail/ExchangeDetail.tsx b/src/pages/ExchangeDetail/ExchangeDetail.tsx index 7f687e2..48be210 100644 --- a/src/pages/ExchangeDetail/ExchangeDetail.tsx +++ b/src/pages/ExchangeDetail/ExchangeDetail.tsx @@ -3,8 +3,6 @@ import { useParams, useNavigate } from 'react-router-dom' import styles from './ExchangeDetail.module.css' // Layout -import { AppShell } from '../../design-system/layout/AppShell/AppShell' -import { Sidebar } from '../../design-system/layout/Sidebar/Sidebar' import { TopBar } from '../../design-system/layout/TopBar/TopBar' // Composites @@ -22,7 +20,7 @@ import { InfoCallout } from '../../design-system/primitives/InfoCallout/InfoCall // Mock data import { exchanges } from '../../mocks/exchanges' -import { SIDEBAR_APPS, buildRouteToAppMap } from '../../mocks/sidebar' +import { buildRouteToAppMap } from '../../mocks/sidebar' const ROUTE_TO_APP = buildRouteToAppMap() @@ -196,11 +194,7 @@ export function ExchangeDetail() { // Not found state if (!exchange) { return ( - - } - > + <> Exchange "{id}" not found in mock data. - + ) } @@ -229,11 +223,7 @@ export function ExchangeDetail() { const isSelectedFailed = selectedProc?.status === 'fail' return ( - - } - > + <> {/* Top bar */} - + ) } diff --git a/src/pages/Routes/Routes.tsx b/src/pages/Routes/Routes.tsx index b49165b..9a31588 100644 --- a/src/pages/Routes/Routes.tsx +++ b/src/pages/Routes/Routes.tsx @@ -3,8 +3,6 @@ import { useNavigate, useParams } from 'react-router-dom' import styles from './Routes.module.css' // Layout -import { AppShell } from '../../design-system/layout/AppShell/AppShell' -import { Sidebar } from '../../design-system/layout/Sidebar/Sidebar' import { TopBar } from '../../design-system/layout/TopBar/TopBar' // Composites @@ -33,7 +31,7 @@ import { type RouteMetricRow, } from '../../mocks/metrics' import { routes } from '../../mocks/routes' -import { SIDEBAR_APPS, buildRouteToAppMap } from '../../mocks/sidebar' +import { buildRouteToAppMap } from '../../mocks/sidebar' const ROUTE_TO_APP = buildRouteToAppMap() @@ -410,7 +408,7 @@ export function Routes() { // ── Route detail view ─────────────────────────────────────────────────────── if (routeId && appId && routeDef) { return ( - }> + <> - + ) } // ── Top level / Application level view ────────────────────────────────────── return ( - }> + <> - + ) }