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

+13 -8
View File
@@ -1,25 +1,30 @@
import { Link } from 'react-router-dom'
import { scopedPath } from '../utils/routes.js'
const AREAS = [
{
to: 'plan',
to: '/plan/gates',
title: 'Plan',
description: 'Roadmap, Gates und Plan-Ist — methodenneutral pflegen.',
countKey: 'roadmapItems',
},
{
to: 'execution',
to: '/work/today',
title: 'Ausführung',
description: 'Arbeitspakete, Zuweisungen, Blocker am Objekt.',
countKey: 'actionsOpen',
},
{
to: 'inbox',
to: '/plan/inbox',
title: 'Eingang',
description: 'Backlog triagieren und in Arbeitspakete überführen.',
countKey: 'backlog',
},
{
to: 'journey',
to: '/control/journey',
title: 'Nachvollziehbarkeit',
description: 'Entscheidungen, Reviews, Nachweise über die Zeit.',
countKey: null,
},
]
@@ -30,17 +35,17 @@ export function InitiativeNavCards({ initiativeId, counts = {} }) {
<div className="initiative-nav-cards-grid">
{AREAS.map((area) => {
const hint =
area.to === 'inbox' && counts.backlog
area.countKey === 'backlog' && counts.backlog
? `${counts.backlog} Backlog`
: area.to === 'execution' && counts.actionsOpen
: area.countKey === 'actionsOpen' && counts.actionsOpen
? `${counts.actionsOpen} offen`
: area.to === 'plan' && counts.roadmapItems
: area.countKey === 'roadmapItems' && counts.roadmapItems
? `${counts.roadmapItems} Plan-Elemente`
: null
return (
<Link
key={area.to}
to={`/initiatives/${initiativeId}/${area.to}`}
to={scopedPath(area.to, { initiativeId })}
className="initiative-nav-card card"
>
<h3>{area.title}</h3>
+16
View File
@@ -0,0 +1,16 @@
import { MODE_META } from '../utils/routes.js'
export function ModeShell({ modeKey, actions }) {
const meta = MODE_META[modeKey]
if (!meta) return null
return (
<header className="page-header mode-shell">
<div>
<h1>{meta.title}</h1>
<p className="page-lead">{meta.lead}</p>
</div>
{actions ? <div className="page-header__actions">{actions}</div> : null}
</header>
)
}
+26
View File
@@ -0,0 +1,26 @@
import { NavLink } from 'react-router-dom'
import { useProgramScope } from '../context/ProgramScopeContext.jsx'
/**
* @param {{ items: { to: string, label: string, end?: boolean }[] }} props
*/
export function ModeSubNav({ items }) {
const { hrefWithScope } = useProgramScope()
return (
<nav className="mode-subnav" aria-label="Modus-Unternavigation">
{items.map((item) => (
<NavLink
key={item.to}
to={hrefWithScope(item.to)}
end={item.end !== false}
className={({ isActive }) =>
'mode-subnav__link' + (isActive ? ' mode-subnav__link--active' : '')
}
>
{item.label}
</NavLink>
))}
</nav>
)
}
@@ -0,0 +1,62 @@
import { Link } from 'react-router-dom'
import { useProgramScope } from '../context/ProgramScopeContext.jsx'
import { initiativeCatalogPath, scopedPath } from '../utils/routes.js'
export function ProgramScopeBar() {
const {
initiativeId,
projectId,
initiativeTitle,
projectTitle,
clearScope,
setScope,
} = useProgramScope()
return (
<div className="program-scope-bar" aria-label="Programm-Scope">
<span className="program-scope-bar__label">Scope</span>
<nav className="program-scope-bar__trail">
<Link
to={scopedPath('/cockpit')}
className={
'program-scope-bar__crumb' +
(!initiativeId ? ' program-scope-bar__crumb--active' : '')
}
onClick={() => clearScope()}
>
Portfolio
</Link>
{initiativeId && (
<>
<span className="program-scope-bar__sep" aria-hidden="true">
›
</span>
<Link
to={scopedPath('/control/status', { initiativeId })}
className={
'program-scope-bar__crumb' +
(!projectId ? ' program-scope-bar__crumb--active' : '')
}
onClick={() => setScope({ projectId: '', clearProject: true })}
>
{initiativeTitle || 'Vorhaben'}
</Link>
</>
)}
{projectId && (
<>
<span className="program-scope-bar__sep" aria-hidden="true">
›
</span>
<span className="program-scope-bar__crumb program-scope-bar__crumb--active">
{projectTitle || 'Projekt'}
</span>
</>
)}
</nav>
<Link to={initiativeCatalogPath()} className="program-scope-bar__catalog link-inline">
Vorhaben-Katalog
</Link>
</div>
)
}
+2 -2
View File
@@ -33,7 +33,7 @@ function ProjectTreeNodes({
>
<div className="list-item-main project-tree-item-main">
<Link
to={`/initiatives/${initiativeId}/execution/projects/${project.id}`}
to={projectPath(project.id)}
className="project-tree-title-link"
>
<strong>{project.title}</strong>
@@ -117,7 +117,7 @@ export function ProjectsSection({
{canManage && (
<Link
className="btn btn-primary btn-block-mobile"
to={`/initiatives/${initiativeId}/execution/projects/new`}
to={`${projectPath('new')}?initiative=${initiativeId}`}
>
Neues Projekt
</Link>
+179
View File
@@ -0,0 +1,179 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { listInitiatives } from '../api/initiatives.js'
import { listWorkspaceOpenActions } from '../api/workspace.js'
import { useProgramScope } from '../context/ProgramScopeContext.jsx'
import { loadRecentObjects } from '../utils/recentObjects.js'
import {
actionPath,
gatePath,
initiativeCatalogPath,
projectPath,
scopedPath,
} from '../utils/routes.js'
const TYPE_LABELS = {
action: 'Arbeitspaket',
project: 'Projekt',
gate: 'Gate',
initiative: 'Vorhaben',
}
function matchQuery(text, query) {
return (text || '').toLowerCase().includes(query.toLowerCase())
}
export function QuickJump() {
const navigate = useNavigate()
const { applyFromInitiative } = useProgramScope()
const [open, setOpen] = useState(false)
const [query, setQuery] = useState('')
const [initiatives, setInitiatives] = useState([])
const [actions, setActions] = useState([])
const [recent, setRecent] = useState([])
const rootRef = useRef(null)
useEffect(() => {
let cancelled = false
Promise.all([
listInitiatives().catch(() => []),
listWorkspaceOpenActions().catch(() => []),
]).then(([initData, actionData]) => {
if (cancelled) return
setInitiatives(initData)
setActions(actionData)
})
return () => {
cancelled = true
}
}, [])
useEffect(() => {
setRecent(loadRecentObjects())
}, [open])
useEffect(() => {
function onDocClick(e) {
if (rootRef.current && !rootRef.current.contains(e.target)) {
setOpen(false)
}
}
document.addEventListener('mousedown', onDocClick)
return () => document.removeEventListener('mousedown', onDocClick)
}, [])
const results = useMemo(() => {
const q = query.trim()
if (!q) return []
const hits = []
for (const item of initiatives) {
if (matchQuery(item.title, q)) {
hits.push({
key: `initiative-${item.id}`,
label: item.title,
meta: 'Vorhaben',
href: scopedPath('/control/status', { initiativeId: item.id }),
onSelect: () => applyFromInitiative(item.id),
})
}
}
for (const action of actions) {
if (matchQuery(action.title, q)) {
hits.push({
key: `action-${action.id}`,
label: action.title,
meta: 'Arbeitspaket',
href: actionPath(action.id),
})
}
}
return hits.slice(0, 8)
}, [query, initiatives, actions, applyFromInitiative])
const go = useCallback(
(href, onSelect) => {
if (onSelect) onSelect()
navigate(href)
setOpen(false)
setQuery('')
},
[navigate],
)
return (
<div className="quick-jump" ref={rootRef}>
<button
type="button"
className="quick-jump__trigger"
onClick={() => setOpen((v) => !v)}
aria-expanded={open}
aria-haspopup="listbox"
>
Springen zu…
</button>
{open && (
<div className="quick-jump__panel">
<input
type="search"
className="quick-jump__input"
placeholder="Vorhaben, Arbeitspaket …"
value={query}
onChange={(e) => setQuery(e.target.value)}
autoFocus
/>
<ul className="quick-jump__list" role="listbox">
{query.trim() === '' &&
recent.map((item) => (
<li key={`recent-${item.type}-${item.id}`}>
<button
type="button"
className="quick-jump__item"
onClick={() => go(item.href)}
>
<span className="quick-jump__item-label">{item.title}</span>
<span className="quick-jump__item-meta">
{TYPE_LABELS[item.type] || item.type} · zuletzt
</span>
</button>
</li>
))}
{query.trim() !== '' &&
results.map((item) => (
<li key={item.key}>
<button
type="button"
className="quick-jump__item"
onClick={() => go(item.href, item.onSelect)}
>
<span className="quick-jump__item-label">{item.label}</span>
<span className="quick-jump__item-meta">{item.meta}</span>
</button>
</li>
))}
{query.trim() !== '' && results.length === 0 && (
<li className="quick-jump__empty">Keine Treffer</li>
)}
{query.trim() === '' && recent.length === 0 && (
<li className="quick-jump__empty">Tippe zum Suchen — oder öffne ein Objekt.</li>
)}
</ul>
<div className="quick-jump__footer">
<button
type="button"
className="link-inline"
onClick={() => go(initiativeCatalogPath())}
>
Vorhaben-Katalog
</button>
</div>
</div>
)}
</div>
)
}
export { actionPath, projectPath, gatePath }
@@ -0,0 +1,33 @@
import { Link } from 'react-router-dom'
import { loadRecentObjects } from '../utils/recentObjects.js'
const TYPE_LABELS = {
action: 'AP',
project: 'Projekt',
gate: 'Gate',
initiative: 'Vorhaben',
}
export function RecentlyOpened() {
const items = loadRecentObjects().slice(0, 5)
if (items.length === 0) return null
return (
<div className="recently-opened" aria-label="Zuletzt geöffnet">
<span className="recently-opened__label">Zuletzt</span>
<div className="recently-opened__items">
{items.map((item) => (
<Link
key={`${item.type}-${item.id}`}
to={item.href}
className="recently-opened__chip"
title={item.title}
>
<span className="recently-opened__type">{TYPE_LABELS[item.type] || item.type}</span>
<span className="recently-opened__title">{item.title}</span>
</Link>
))}
</div>
</div>
)
}
@@ -0,0 +1,62 @@
import { Link, useLocation } from 'react-router-dom'
import { useEffect, useState } from 'react'
import { listInitiatives } from '../api/initiatives.js'
import { useProgramScope } from '../context/ProgramScopeContext.jsx'
import { LoadingState } from './LoadingState.jsx'
import { scopedPath } from '../utils/routes.js'
export function RequireInitiativeScope({ children, lead }) {
const location = useLocation()
const { initiativeId, applyFromInitiative } = useProgramScope()
const [initiatives, setInitiatives] = useState(null)
const basePath = location.pathname.replace(/\/$/, '') || location.pathname
useEffect(() => {
if (initiativeId) return
let cancelled = false
listInitiatives()
.then((data) => {
if (!cancelled) setInitiatives(data)
})
.catch(() => {
if (!cancelled) setInitiatives([])
})
return () => {
cancelled = true
}
}, [initiativeId])
if (initiativeId) {
return children
}
if (initiatives === null) {
return <LoadingState message="Lade Vorhaben …" />
}
return (
<section className="card scope-picker">
<h2 className="card-title">Vorhaben wählen</h2>
<p className="page-lead">
{lead || 'Dieser Modus braucht ein Vorhaben als Scope-Filter.'}
</p>
{initiatives.length === 0 ? (
<p className="muted">Noch keine Vorhaben angelegt.</p>
) : (
<ul className="scope-picker__list">
{initiatives.map((item) => (
<li key={item.id}>
<Link
to={scopedPath(basePath, { initiativeId: item.id })}
className="scope-picker__link"
onClick={() => applyFromInitiative(item.id)}
>
{item.title}
</Link>
</li>
))}
</ul>
)}
</section>
)
}
@@ -1,5 +1,6 @@
import { useState } from 'react'
import { Link } from 'react-router-dom'
import { gatePath } from '../utils/routes.js'
import {
MILESTONE_STATUSES,
MILESTONE_STATUS_LABELS,
@@ -152,7 +153,7 @@ export function RoadmapPlanSection({
<div className="list-item-main">
<strong>
{initiativeId ? (
<Link to={`/initiatives/${initiativeId}/plan/items/${item.id}`}>
<Link to={gatePath(item.id)}>
{item.title}
</Link>
) : (