From edfcffb7d936814949091f2223f14b3358b96178 Mon Sep 17 00:00:00 2001 From: 4gray Date: Tue, 24 Feb 2026 19:18:27 +0100 Subject: [PATCH] feat(routes): implement workspace layout for routing and enhance navigation structure --- apps/web/src/app/app.routes.ts | 86 +++++++++++++++++++++++++++------- 1 file changed, 70 insertions(+), 16 deletions(-) diff --git a/apps/web/src/app/app.routes.ts b/apps/web/src/app/app.routes.ts index 3b9de8871..0df0fe084 100644 --- a/apps/web/src/app/app.routes.ts +++ b/apps/web/src/app/app.routes.ts @@ -1,10 +1,76 @@ -import { Routes } from '@angular/router'; +import { Route, Routes } from '@angular/router'; import { stalkerRoutes } from './stalker/stalker.routes'; import { xtreamRoutes } from './xtream-electron/xtream.routes'; +function withWorkspaceLayout(routes: Route[]): Route[] { + return routes.map((route) => ({ + ...route, + data: { + ...(route.data || {}), + layout: 'workspace', + }, + children: route.children + ? withWorkspaceLayout(route.children) + : undefined, + })); +} + export const routes: Routes = [ { path: '', + pathMatch: 'full', + redirectTo: 'workspace', + }, + { + path: 'workspace', + loadComponent: () => + import('./workspace/workspace-shell.component').then( + (c) => c.WorkspaceShellComponent + ), + children: [ + { + path: '', + pathMatch: 'full', + redirectTo: 'dashboard', + }, + { + path: 'dashboard', + loadComponent: () => + import('workspace-dashboard-feature').then( + (c) => c.WorkspaceDashboardComponent + ), + }, + { + path: 'sources', + loadComponent: () => + import('./workspace/workspace-sources.component').then( + (c) => c.WorkspaceSourcesComponent + ), + }, + { + path: 'playlists/:id', + data: { + layout: 'workspace', + }, + loadComponent: () => + import('./home/video-player/video-player.component').then( + (c) => c.VideoPlayerComponent + ), + }, + ...withWorkspaceLayout(xtreamRoutes), + ...withWorkspaceLayout(stalkerRoutes), + { + path: 'settings', + data: { layout: 'workspace' }, + loadComponent: () => + import('./settings/settings.component').then( + (c) => c.SettingsComponent + ), + }, + ], + }, + { + path: 'home', loadComponent: () => import('./home/home.component').then((c) => c.HomeComponent), }, @@ -31,22 +97,10 @@ export const routes: Routes = [ }, { path: 'settings', - loadComponent: () => - import('./settings/settings.component').then( - (c) => c.SettingsComponent - ), + redirectTo: '/workspace/settings', + pathMatch: 'full', }, - ...(window.electron - ? xtreamRoutes - : [ - { - path: 'xtreams/:id', - loadComponent: () => - import('./xtream/xtream-main-container.component').then( - (c) => c.XtreamMainContainerComponent - ), - }, - ]), + ...xtreamRoutes, { path: 'portals/:id', loadComponent: () =>