// ========================================
// Router Configuration
// ========================================
// React Router v6 configuration with all dashboard routes
import { createBrowserRouter, RouteObject, Navigate } from 'react-router-dom';
import { AppShell } from '@/components/layout';
import {
HomePage,
SessionsPage,
FixSessionPage,
ProjectOverviewPage,
SessionDetailPage,
HistoryPage,
OrchestratorPage,
LoopMonitorPage,
IssueHubPage,
IssueManagerPage,
QueuePage,
DiscoveryPage,
SkillsManagerPage,
CommandsManagerPage,
MemoryPage,
SettingsPage,
HelpPage,
NotFoundPage,
LiteTasksPage,
// LiteTaskDetailPage removed - now using TaskDrawer instead
ReviewSessionPage,
McpManagerPage,
EndpointsPage,
InstallationsPage,
HookManagerPage,
RulesManagerPage,
PromptHistoryPage,
ExplorerPage,
GraphExplorerPage,
CodexLensManagerPage,
ApiSettingsPage,
CliViewerPage,
TeamPage,
} from '@/pages';
/**
* Route configuration for the dashboard
* All routes are wrapped in AppShell layout
*/
const routes: RouteObject[] = [
{
path: '/',
element: ,
children: [
{
index: true,
element: ,
},
{
path: 'sessions',
element: ,
},
{
path: 'sessions/:sessionId',
element: ,
},
{
path: 'sessions/:sessionId/fix',
element: ,
},
{
path: 'sessions/:sessionId/review',
element: ,
},
{
path: 'lite-tasks',
element: ,
},
// /lite-tasks/:sessionId route removed - now using TaskDrawer
{
path: 'project',
element: ,
},
{
path: 'history',
element: ,
},
{
path: 'orchestrator',
element: ,
},
{
path: 'loops',
element: ,
},
{
path: 'cli-viewer',
element: ,
},
{
path: 'issues',
element: ,
},
// Legacy routes - redirect to hub with tab parameter
{
path: 'issues/queue',
element: ,
},
{
path: 'issues/discovery',
element: ,
},
{
path: 'skills',
element: ,
},
{
path: 'commands',
element: ,
},
{
path: 'memory',
element: ,
},
{
path: 'prompts',
element: ,
},
{
path: 'settings',
element: ,
},
{
path: 'settings/mcp',
element: ,
},
{
path: 'settings/endpoints',
element: ,
},
{
path: 'settings/installations',
element: ,
},
{
path: 'settings/rules',
element: ,
},
{
path: 'settings/codexlens',
element: ,
},
{
path: 'api-settings',
element: ,
},
{
path: 'help',
element: ,
},
{
path: 'hooks',
element: ,
},
{
path: 'explorer',
element: ,
},
{
path: 'graph',
element: ,
},
{
path: 'teams',
element: ,
},
// Catch-all route for 404
{
path: '*',
element: ,
},
],
},
];
/**
* Create the browser router instance
* Uses basename from Vite's BASE_URL environment variable
*/
const basename = import.meta.env.BASE_URL?.replace(/\/$/, '') || '';
export const router = createBrowserRouter(routes, {
basename,
});
/**
* Export route paths for type-safe navigation
*/
export const ROUTES = {
HOME: '/',
SESSIONS: '/sessions',
SESSION_DETAIL: '/sessions/:sessionId',
FIX_SESSION: '/sessions/:sessionId/fix',
REVIEW_SESSION: '/sessions/:sessionId/review',
LITE_TASKS: '/lite-tasks',
// LITE_TASK_DETAIL removed - now using TaskDrawer
PROJECT: '/project',
HISTORY: '/history',
ORCHESTRATOR: '/orchestrator',
LOOPS: '/loops',
CLI_VIEWER: '/cli-viewer',
ISSUES: '/issues',
// Legacy issue routes - use ISSUES with ?tab parameter instead
ISSUE_QUEUE: '/issues?tab=queue',
ISSUE_DISCOVERY: '/issues?tab=discovery',
SKILLS: '/skills',
COMMANDS: '/commands',
MEMORY: '/memory',
PROMPT_HISTORY: '/prompts',
SETTINGS: '/settings',
HOOKS_MANAGER: '/hooks',
MCP_MANAGER: '/settings/mcp',
ENDPOINTS: '/settings/endpoints',
INSTALLATIONS: '/settings/installations',
SETTINGS_RULES: '/settings/rules',
CODEXLENS_MANAGER: '/settings/codexlens',
API_SETTINGS: '/api-settings',
HELP: '/help',
EXPLORER: '/explorer',
GRAPH: '/graph',
TEAMS: '/teams',
} as const;
export type RoutePath = (typeof ROUTES)[keyof typeof ROUTES];