22 * @file src/renderer/App.tsx
33 *
44 * @created 07.03.2026
5- * @modified 10 .03.2026
5+ * @modified 17 .03.2026
66 *
77 * @author Christian Blank <aidrelay@proton.me>
88 * @copyright 2026
99 *
1010 * @description Root React component. Sets up the TanStack Router with a
1111 * root route that renders the Shell layout and child routes for each page.
12- * Placeholder routes are used for pages not yet implemented so navigation
13- * links work end-to-end from the start. Rules page wired in Step 22;
14- * Profiles page wired in Step 30; Registry + Stacks pages wired in Step 43/45;
15- * Settings + History pages wired in Phase 6.
12+ * Navigation was simplified in the UI/UX redesign: Activity Log merged into
13+ * History, Sync Center merged into Dashboard/Settings, Skills merged into Rules.
14+ * Stacks remains navigable but is no longer in the sidebar.
1615 */
1716
1817import { useEffect } from 'react'
19- import { RouterProvider , createRouter , createRootRoute , createRoute } from '@tanstack/react-router'
18+ import {
19+ RouterProvider ,
20+ createRouter ,
21+ createRootRoute ,
22+ createRoute ,
23+ createMemoryHistory ,
24+ redirect ,
25+ } from '@tanstack/react-router'
2026import { Toaster , toast } from 'sonner'
2127import { useTranslation } from 'react-i18next'
2228import { TooltipProvider } from '@/components/ui/tooltip'
2329import { Shell } from '@/components/layout/Shell'
2430import { DashboardPage } from '@/pages/DashboardPage'
2531import { ServersPage } from '@/pages/ServersPage'
2632import { RulesPage } from '@/pages/RulesPage'
27- import { ActivityLogPage } from '@/pages/ActivityLogPage'
2833import { ProfilesPage } from '@/pages/ProfilesPage'
2934import { RegistryPage } from '@/pages/RegistryPage'
3035import { StacksPage } from '@/pages/StacksPage'
3136import { SettingsPage } from '@/pages/SettingsPage'
3237import { HistoryPage } from '@/pages/HistoryPage'
3338import { ClientsPage } from '@/pages/ClientsPage'
34- import { SyncCenterPage } from '@/pages/SyncCenterPage'
35- import { SkillsPage } from '@/pages/SkillsPage'
3639import { StartupSplash } from '@/components/layout/StartupSplash'
3740import { useStartupSplash } from '@/hooks/useStartupSplash'
3841import { clientsService } from '@/services/clients.service'
@@ -72,12 +75,6 @@ const profilesRoute = createRoute({
7275 component : ProfilesPage ,
7376} )
7477
75- const activityRoute = createRoute ( {
76- getParentRoute : ( ) => rootRoute ,
77- path : '/activity' ,
78- component : ActivityLogPage ,
79- } )
80-
8178const registryRoute = createRoute ( {
8279 getParentRoute : ( ) => rootRoute ,
8380 path : '/registry' ,
@@ -102,16 +99,14 @@ const historyRoute = createRoute({
10299 component : HistoryPage ,
103100} )
104101
105- const syncCenterRoute = createRoute ( {
102+ // Redirect legacy activity routes to the unified history page
103+ const activityRedirectRoute = createRoute ( {
106104 getParentRoute : ( ) => rootRoute ,
107- path : '/sync-center' ,
108- component : SyncCenterPage ,
109- } )
110-
111- const skillsRoute = createRoute ( {
112- getParentRoute : ( ) => rootRoute ,
113- path : '/skills' ,
114- component : SkillsPage ,
105+ path : '/activity' ,
106+ beforeLoad : ( ) => {
107+ // eslint-disable-next-line @typescript-eslint/only-throw-error -- TanStack Router expects redirect to be thrown
108+ throw redirect ( { to : '/history' } )
109+ } ,
115110} )
116111
117112const routeTree = rootRoute . addChildren ( [
@@ -120,18 +115,22 @@ const routeTree = rootRoute.addChildren([
120115 rulesRoute ,
121116 clientsRoute ,
122117 profilesRoute ,
123- activityRoute ,
124118 registryRoute ,
125119 stacksRoute ,
126120 settingsRoute ,
127121 historyRoute ,
128- syncCenterRoute ,
129- skillsRoute ,
122+ activityRedirectRoute ,
130123] )
131124
132125// ─── Router ───────────────────────────────────────────────────────────────────
133126
134- const router = createRouter ( { routeTree } )
127+ // Use in-memory history so routing works correctly under Electron's file:// protocol.
128+ // The default browser history breaks in production because the URL path is the
129+ // path to the asar bundle, not "/", so no route ever matches.
130+ const router = createRouter ( {
131+ routeTree,
132+ history : createMemoryHistory ( { initialEntries : [ '/' ] } ) ,
133+ } )
135134
136135// Register the router's type for TypeScript inference across the app
137136declare module '@tanstack/react-router' {
0 commit comments