AP2.3f: Restschuld ? uiFeatures, Route-Registry und slice-bewusste Mutationen.
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Failing after 3m9s
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 3s
Test Suite / compose-smoke (push) Has been skipped

Archetyp-Profile und Seitenlogik auf Operating Context migriert; methodUiDefaults nur noch Fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-07-25 10:52:12 +02:00
1 parent 44fda7beb9
commit c79bfa844f
16 files changed
+432 -300

No files matched your search

@@ -5,14 +5,6 @@ import { SteeringSnapshotPanel } from '../../components/SteeringSnapshotPanel.js
import { CriticalPathPanel } from '../../components/CriticalPathPanel.jsx'
import { NextActionWidget } from '../../widgets/NextActionWidget.jsx'
function usesCriticalPathControl(initiative, steeringSnapshot) {
const archetypeKey = initiative?.archetype_key
const methodKey = steeringSnapshot?.method_key
return (
archetypeKey === 'initiative.linear_project' || methodKey === 'sequential_dependency'
)
}
export function InitiativeOverviewPage() {
const {
initiativeId,
@@ -26,10 +18,11 @@ export function InitiativeOverviewPage() {
methodBusy,
capabilities,
handleMethodChange,
uiFeatures,
} = useInitiativeOperations()
const counts = steeringSnapshot?.counts || {}
const showCriticalPath = usesCriticalPathControl(initiative, steeringSnapshot)
const showCriticalPath = Boolean(uiFeatures.criticalPathControl)
return (
<>
+11 -1
View File
@@ -6,6 +6,8 @@ import {
CONTROL_NAV_ITEMS,
resolveControlNavActiveKey,
} from '../../config/controlNav.js'
import { useProgramScope } from '../../context/ProgramScopeContext.jsx'
import { useMethodUiContext } from '../../hooks/useMethodUiContext.js'
export function ControlLayout() {
return (
@@ -29,5 +31,13 @@ export function ControlLayout() {
}
export function ControlIndexRedirect() {
return <Navigate to="/control/status" replace />
const { initiativeId, hrefWithScope } = useProgramScope()
const { controlDefaultRoute, loading, operatingContext } = useMethodUiContext()
if (initiativeId && loading && !operatingContext) {
return null
}
const target = initiativeId ? hrefWithScope(controlDefaultRoute) : '/control/status'
return <Navigate to={target} replace />
}
+5 -34
View File
@@ -1,48 +1,19 @@
import { useEffect, useState } from 'react'
import { Navigate } from 'react-router-dom'
import { useProgramScope } from '../../context/ProgramScopeContext.jsx'
import { getInitiativeOperatingContext } from '../../api/initiatives.js'
import { getActiveWorkCycle } from '../../api/workCycles.js'
import { resolveOperatingProfileFromInput } from '../../registry/resolveOperatingProfile.js'
import { useMethodUiContext } from '../../hooks/useMethodUiContext.js'
/** Portfolio ohne Scope → Übersicht; mit Vorhaben → methoden-Default (AP1.9d). */
/** Portfolio ohne Scope → Übersicht; mit Vorhaben → methoden-Default aus Operating Context. */
export function PlanIndexRedirect() {
const { initiativeId, hrefWithScope } = useProgramScope()
const [target, setTarget] = useState(null)
useEffect(() => {
if (!initiativeId) {
setTarget('/plan/portfolio')
return undefined
}
let cancelled = false
Promise.all([
getInitiativeOperatingContext(initiativeId),
getActiveWorkCycle(initiativeId).catch(() => null),
])
.then(([context, activeCycle]) => {
if (cancelled) return
const defaults = resolveOperatingProfileFromInput({
operatingContext: context,
hasActiveSprint: Boolean(activeCycle?.id),
})
setTarget(hrefWithScope(defaults.planDefaultRoute))
})
.catch(() => {
if (!cancelled) setTarget(hrefWithScope('/plan/profile'))
})
return () => {
cancelled = true
}
}, [initiativeId, hrefWithScope])
const { planDefaultRoute, loading, operatingContext } = useMethodUiContext()
if (!initiativeId) {
return <Navigate to="/plan/portfolio" replace />
}
if (!target) {
if (loading && !operatingContext) {
return null
}
return <Navigate to={target} replace />
return <Navigate to={hrefWithScope(planDefaultRoute)} replace />
}
+18 -59
View File
@@ -1,45 +1,22 @@
import { Navigate, Outlet } from 'react-router-dom'
import { useEffect, useState } from 'react'
import { useMemo } from 'react'
import { ModeAreaShell } from '../../components/ModeAreaShell.jsx'
import { ModeAreaNav } from '../../components/ModeAreaNav.jsx'
import { ModeShell } from '../../components/ModeShell.jsx'
import { WORK_NAV_ITEMS, resolveWorkNavActiveKey } from '../../config/workNav.js'
import { resolveWorkNavItems } from '../../config/methodUiDefaults.js'
import { useProgramScope } from '../../context/ProgramScopeContext.jsx'
import { getInitiative } from '../../api/initiatives.js'
import { getActiveWorkCycle } from '../../api/workCycles.js'
import { resolveMethodUiDefaults } from '../../config/methodUiDefaults.js'
import { useMethodUiContext } from '../../hooks/useMethodUiContext.js'
import { resolveWorkNavItemsFromProfile } from '../../registry/resolveOperatingProfile.js'
function WorkAreaNav() {
const { initiativeId } = useProgramScope()
const [navItems, setNavItems] = useState(WORK_NAV_ITEMS)
const { operatingContext, hasActiveSprint, loading } = useMethodUiContext()
useEffect(() => {
if (!initiativeId) {
setNavItems(WORK_NAV_ITEMS)
return undefined
}
let cancelled = false
Promise.all([
getInitiative(initiativeId),
getActiveWorkCycle(initiativeId).catch(() => null),
])
.then(([initiative, activeCycle]) => {
if (cancelled) return
setNavItems(
resolveWorkNavItems({
archetypeKey: initiative?.archetype_key,
hasActiveSprint: Boolean(activeCycle?.id),
}),
)
})
.catch(() => {
if (!cancelled) setNavItems(WORK_NAV_ITEMS)
})
return () => {
cancelled = true
}
}, [initiativeId])
const navItems = useMemo(() => {
if (!initiativeId) return WORK_NAV_ITEMS
if (loading && !operatingContext) return WORK_NAV_ITEMS
return resolveWorkNavItemsFromProfile({ operatingContext, hasActiveSprint })
}, [initiativeId, loading, operatingContext, hasActiveSprint])
return (
<ModeAreaNav
@@ -63,33 +40,15 @@ export function WorkLayout() {
export function WorkIndexRedirect() {
const { initiativeId, hrefWithScope } = useProgramScope()
const [target, setTarget] = useState('/work/today')
const { workDefaultRoute, loading, operatingContext } = useMethodUiContext()
useEffect(() => {
if (!initiativeId) {
setTarget('/work/today')
return undefined
}
let cancelled = false
Promise.all([
getInitiative(initiativeId),
getActiveWorkCycle(initiativeId).catch(() => null),
])
.then(([initiative, activeCycle]) => {
if (cancelled) return
const defaults = resolveMethodUiDefaults({
archetypeKey: initiative?.archetype_key,
hasActiveSprint: Boolean(activeCycle?.id),
})
setTarget(hrefWithScope(defaults.workDefaultRoute))
})
.catch(() => {
if (!cancelled) setTarget(hrefWithScope('/work/today'))
})
return () => {
cancelled = true
}
}, [initiativeId, hrefWithScope])
if (!initiativeId) {
return <Navigate to="/work/today" replace />
}
return <Navigate to={target} replace />
if (loading && !operatingContext) {
return null
}
return <Navigate to={hrefWithScope(workDefaultRoute)} replace />
}
+15 -10
View File
@@ -1,7 +1,6 @@
import { useEffect, useMemo } from 'react'
import { Link } from 'react-router-dom'
import { RequireInitiativeScope } from '../../components/RequireInitiativeScope.jsx'
import { ScopedInitiativeProvider } from '../../layout/ScopedInitiativeProvider.jsx'
import { InitiativeActionsHub } from '../../components/InitiativeActionsHub.jsx'
import { NextActionWidget } from '../../widgets/NextActionWidget.jsx'
import { LoadingState } from '../../components/LoadingState.jsx'
@@ -43,6 +42,7 @@ function WorkSprintInner() {
initiative,
operatingContext,
dataSlices,
uiFeatures,
steeringSnapshot,
steeringSnapshotLoading,
visibleActions,
@@ -50,13 +50,20 @@ function WorkSprintInner() {
} = ops
const supportsWorkCycles = dataSlices.includes('work_cycles')
const isContinuousProduct = operatingContext?.method_key === 'continuous_product'
const isContinuousProductMode = uiFeatures.continuousProductWorkMode && supportsWorkCycles
const loadSteeringSnapshot = uiFeatures.steeringSnapshotOnWorkSprint
useEffect(() => {
if (initiativeId && !steeringSnapshot && !steeringSnapshotLoading) {
if (initiativeId && loadSteeringSnapshot && !steeringSnapshot && !steeringSnapshotLoading) {
reloadSlices(['steering_snapshot'])
}
}, [initiativeId, steeringSnapshot, steeringSnapshotLoading, reloadSlices])
}, [
initiativeId,
loadSteeringSnapshot,
steeringSnapshot,
steeringSnapshotLoading,
reloadSlices,
])
const defaultWorkCycleId = activeWorkCycle?.id || ''
@@ -74,7 +81,7 @@ function WorkSprintInner() {
return <LoadingState message="Lade Sprint-Backlog …" />
}
const isProductArchetype = isContinuousProduct && supportsWorkCycles
const isProductArchetype = isContinuousProductMode
return (
<>
@@ -86,7 +93,7 @@ function WorkSprintInner() {
<h2>Product-Ist (ohne aktiven Sprint)</h2>
<p className="section-lead muted">
Kein aktiver Sprint — Kairo steuert nach{' '}
<strong>continuous_product</strong> (wirkungsvollster Schritt). Sprint-Planung
<strong>{operatingContext?.method_key || 'continuous_product'}</strong> (wirkungsvollster Schritt). Sprint-Planung
unter{' '}
<Link to={hrefWithScope('/plan/sprint')} className="link-inline">
Plan → Sprint
@@ -208,10 +215,8 @@ function WorkSprintInner() {
export function WorkSprintPage() {
return (
<RequireInitiativeScope lead="Sprint-Backlog ist vorhabenspezifisch — wähle ein Product-Vorhaben im Scope.">
<ScopedInitiativeProvider>
<WorkSprintInner />
</ScopedInitiativeProvider>
<RequireInitiativeScope lead="Sprint-Backlog ist vorhabenspezifisch — wähle ein passendes Vorhaben im Scope.">
<WorkSprintInner />
</RequireInitiativeScope>
)
}