AP1.9a: Arbeitsmodi-Shell mit Scope, Objekt-Routen und Legacy-Redirects.
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Failing after 1m46s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped

Ersetzt die Vorhaben-Tab-Navigation durch Cockpit/Ausführen/Planen/Kontrolle/Team, Deep Links für APs/Projekte/Gates und Programm-Scope im Header.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-07-08 12:55:37 +02:00
1 parent 33831a8c2c
commit e42edd86fa
54 files changed
+2489 -150

No files matched your search

+24 -7
View File
@@ -1,12 +1,22 @@
import { LayoutDashboard, FolderKanban, ListChecks } from 'lucide-react'
import {
Gauge,
LayoutDashboard,
Map,
Play,
Users,
FolderKanban,
} from 'lucide-react'
import { getNavViews } from '../registry/viewRegistry.js'
/** @typedef {{ key: string, to: string, label: string, shortLabel: string, end?: boolean, Icon: import('react').ForwardRefExoticComponent, matchPrefix?: string }} AppNavItem */
/** @typedef {{ key: string, to: string, label: string, shortLabel: string, end?: boolean, Icon: import('react').ForwardRefExoticComponent, matchPrefix?: string, objectPrefixes?: string[] }} AppNavItem */
const ICON_BY_KEY = {
'kairo.workspace': LayoutDashboard,
'kairo.cockpit': LayoutDashboard,
'kairo.work': Play,
'kairo.plan': Map,
'kairo.control': Gauge,
'kairo.team': Users,
'kairo.initiatives': FolderKanban,
'kairo.my_actions': ListChecks,
}
/**
@@ -19,9 +29,10 @@ export function getAppNavItems(capabilities) {
to: view.path,
label: view.navLabel || view.title,
shortLabel: view.shortLabel || view.title,
end: view.path !== '/initiatives',
end: view.path === '/cockpit' || view.path === '/team',
Icon: ICON_BY_KEY[view.key] || LayoutDashboard,
matchPrefix: view.matchPrefix,
objectPrefixes: view.objectPrefixes,
}))
}
@@ -31,8 +42,14 @@ export function getAppNavItems(capabilities) {
* @param {boolean} routerIsActive
*/
export function isNavItemActive(pathname, item, routerIsActive) {
if (item.matchPrefix) {
return pathname.startsWith(item.matchPrefix)
if (item.matchPrefix && pathname.startsWith(item.matchPrefix)) {
return true
}
if (item.objectPrefixes?.some((prefix) => pathname.startsWith(prefix))) {
return true
}
if (item.key === 'kairo.initiatives' && pathname.startsWith('/initiatives')) {
return true
}
return routerIsActive
}