diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index d760654..1ec087d 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -2,7 +2,8 @@ import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom' import { QueryClient, QueryClientProvider } from '@tanstack/react-query' import { AppShell } from './components/layout/AppShell' import { RepoListSkeleton } from './ui/Skeleton' -import { Suspense, lazy } from 'react' +import { Suspense, lazy, useEffect } from 'react' +import { bootstrapCSRF } from './api/client' import './index.css' const queryClient = new QueryClient({ @@ -15,36 +16,50 @@ const queryClient = new QueryClient({ }, }) -const DashboardPage = lazy(() => import('./pages/DashboardPage')) -const ReposPage = lazy(() => import('./pages/ReposPage')) -const PRsPage = lazy(() => import('./pages/PRsPage')) -const PipelinesPage = lazy(() => import('./pages/PipelinesPage')) -const ProfilePage = lazy(() => import('./pages/ProfilePage')) -const ExplorePage = lazy(() => import('./pages/ExplorePage')) -const SettingsPage = lazy(() => import('./pages/SettingsPage')) +// Pages — code-split per route +const DashboardPage = lazy(() => import('./pages/DashboardPage')) +const ReposPage = lazy(() => import('./pages/ReposPage')) +const RepoPage = lazy(() => import('./pages/RepoPage')) +const RepoPRsPage = lazy(() => import('./pages/RepoPRsPage')) +const PRDetailPage = lazy(() => import('./pages/PRDetailPage')) +const PRsPage = lazy(() => import('./pages/PRsPage')) +const PipelinesPage = lazy(() => import('./pages/PipelinesPage')) +const ProfilePage = lazy(() => import('./pages/ProfilePage')) +const ExplorePage = lazy(() => import('./pages/ExplorePage')) +const SettingsPage = lazy(() => import('./pages/SettingsPage')) function PageLoader() { - return ( -
{filePath}
+Line {lineNumber}
+{repo.description}
+ )} ++ Updated {ago} · {repo.defaultBranch} +
+Failed to load file tree.
+ if (!entries?.length) returnEmpty repository.
+ + const dirs = entries.filter(e => e.type === 'tree').sort((a, b) => a.name.localeCompare(b.name)) + const files = entries.filter(e => e.type === 'blob').sort((a, b) => a.name.localeCompare(b.name)) + + return ( +Coming soon — Phase 2 implementation.
+Your repositories and recent activity.
+No repositories yet
+Create your first repository to get started.
++ #{pr.id} · {pr.sourceBranch} + {' → '} + {pr.targetBranch} +
+Coming soon — Phase 2 implementation.
++ Navigate to a repository to view its pull requests. +
Coming soon — Phase 2 implementation.
+CI/CD pipeline integration — preview below.
+Failed to load pull requests.
+ ) : !filtered.length ? ( +No {status} pull requests.
+ ) : ( +{pr.title}
++ #{pr.id} · {pr.sourceBranch} → {pr.targetBranch} +
+{repo.description}
+ )} + + {/* Branch + nav tabs */} +Coming soon — Phase 2 implementation.
+{repos.length} repositor{repos.length === 1 ? 'y' : 'ies'}
+ )} +Failed to load repositories.
+ ) : !repos?.length ? ( +No repositories yet.
+ ) : ( +