AP1.4e: Methodenprofile am Gate-Graph.
Deploy Development / deploy (push) Successful in 43s
Test Suite / pytest-backend (push) Failing after 2m18s
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

generic_operating ohne harte Blockade, Reifegrad-Methoden mit Erfuellungsgrad; Attention gate_graph_blocked fuer gate-orientierte Methoden.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-07-11 08:06:42 +02:00
1 parent 4f8725e234
commit 1fa61b2dac
14 files changed
+426 -36

No files matched your search

@@ -0,0 +1,19 @@
export function GateFulfillmentBadge({ graphState, itemId }) {
const ratio = graphState?.items?.[itemId]?.fulfillment_ratio
if (ratio == null) return null
const pct = Math.round(ratio * 100)
const emphasize = graphState?.graph_profile?.emphasize_fulfillment
return (
<span
className={
'status-pill status-pill--fulfillment' +
(emphasize ? ' status-pill--fulfillment-primary' : '')
}
title="Kriterien erfüllt / gesamt"
>
{pct}% Kriterien
</span>
)
}
@@ -3,6 +3,10 @@ import { gateTitleById } from './GateSelect.jsx'
export function GateGraphStateBadge({ graphState, itemId, siblingItems = [] }) {
if (!graphState?.items?.[itemId]) return null
if (graphState.graph_profile?.enforce_gate_blocking === false) {
return null
}
const { blocked, ready, blocked_by: blockedBy = [] } = graphState.items[itemId]
if (ready) {
+16 -13
View File
@@ -18,27 +18,29 @@ function truncateTitle(title, max = 28) {
return `${title.slice(0, max - 1)}…`
}
export function GateMapView({ initiativeId, items }) {
export function GateMapView({ initiativeId, items, graphState: graphStateProp }) {
const navigate = useNavigate()
const [dependencies, setDependencies] = useState([])
const [graphState, setGraphState] = useState(null)
const [graphStateLocal, setGraphStateLocal] = useState(null)
const graphState = graphStateProp ?? graphStateLocal
const [loading, setLoading] = useState(true)
const [error, setError] = useState(null)
useEffect(() => {
if (!initiativeId) {
setDependencies([])
setGraphState(null)
if (!graphStateProp) setGraphStateLocal(null)
setLoading(false)
return undefined
}
let cancelled = false
setLoading(true)
setError(null)
Promise.allSettled([
listInitiativeRoadmapDependencies(initiativeId),
listInitiativeRoadmapGraphState(initiativeId),
]).then(([depsResult, graphResult]) => {
const loaders = [listInitiativeRoadmapDependencies(initiativeId)]
if (!graphStateProp) {
loaders.push(listInitiativeRoadmapGraphState(initiativeId))
}
Promise.allSettled(loaders).then(([depsResult, graphResult]) => {
if (cancelled) return
if (depsResult.status === 'fulfilled') {
setDependencies(Array.isArray(depsResult.value) ? depsResult.value : [])
@@ -47,17 +49,17 @@ export function GateMapView({ initiativeId, items }) {
depsResult.reason?.message || 'Abhängigkeiten konnten nicht geladen werden.',
)
}
if (graphResult.status === 'fulfilled') {
setGraphState(graphResult.value || null)
} else {
setGraphState(null)
if (!graphStateProp && graphResult?.status === 'fulfilled') {
setGraphStateLocal(graphResult.value || null)
} else if (!graphStateProp) {
setGraphStateLocal(null)
}
setLoading(false)
})
return () => {
cancelled = true
}
}, [initiativeId])
}, [initiativeId, graphStateProp])
const layout = useMemo(
() => computeGateGraphLayout(items, dependencies),
@@ -152,10 +154,11 @@ export function GateMapView({ initiativeId, items }) {
{layout.nodes.map((node) => {
const item = node.item
const nodeGraph = graphState?.items?.[node.id]
const enforceBlocking = graphState?.graph_profile?.enforce_gate_blocking !== false
const nodeClass =
'gate-map-view__node gate-map-view__node--' +
(item.status || 'planned') +
(nodeGraph?.blocked ? ' gate-map-view__node--blocked' : '') +
(enforceBlocking && nodeGraph?.blocked ? ' gate-map-view__node--blocked' : '') +
(nodeGraph?.ready ? ' gate-map-view__node--ready' : '')
return (
<g
+41 -1
View File
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'
import { RoadmapPlanSection } from './RoadmapPlanSection.jsx'
import { GateMapView } from './GateMapView.jsx'
import { resolveGatesViewMode, storeGatesViewMode } from '../plan/gateGraphLayout.js'
import { listInitiativeRoadmapGraphState } from '../api/roadmap.js'
export function GatesPlanPanel({
initiativeId,
@@ -13,18 +14,56 @@ export function GatesPlanPanel({
busy,
}) {
const [viewMode, setViewMode] = useState(() => resolveGatesViewMode(initiativeId, items.length))
const [graphState, setGraphState] = useState(null)
useEffect(() => {
setViewMode(resolveGatesViewMode(initiativeId, items.length))
}, [initiativeId, items.length])
useEffect(() => {
if (!initiativeId) {
setGraphState(null)
return undefined
}
let cancelled = false
listInitiativeRoadmapGraphState(initiativeId)
.then((data) => {
if (!cancelled) setGraphState(data || null)
})
.catch(() => {
if (!cancelled) setGraphState(null)
})
return () => {
cancelled = true
}
}, [initiativeId, items])
function handleViewChange(mode) {
setViewMode(mode)
storeGatesViewMode(initiativeId, mode)
}
const fulfillmentPct =
graphState?.initiative_fulfillment_ratio != null
? Math.round(graphState.initiative_fulfillment_ratio * 100)
: null
return (
<div className="gates-plan-panel">
{graphState?.graph_profile?.emphasize_fulfillment && fulfillmentPct != null && (
<p className="gates-plan-panel__fulfillment muted">
Erfüllungsgrad (Plan): <strong>{fulfillmentPct}%</strong> — Reifegrad zählt, kein
Gate-Zwang.
</p>
)}
{graphState?.graph_profile?.enforce_gate_blocking === false &&
!graphState?.graph_profile?.emphasize_fulfillment && (
<p className="gates-plan-panel__method-hint muted">
Gates sind optional — der Graph blockiert nicht hart; Reihenfolge über Kanten oder
Liste.
</p>
)}
<div className="gates-plan-panel__toolbar" role="tablist" aria-label="Zielzustände Ansicht">
<button
type="button"
@@ -59,9 +98,10 @@ export function GatesPlanPanel({
onReorder={onReorder}
onDelete={onDelete}
busy={busy}
graphState={graphState}
/>
) : (
<GateMapView initiativeId={initiativeId} items={items} />
<GateMapView initiativeId={initiativeId} items={items} graphState={graphState} />
)}
</div>
)
+19 -15
View File
@@ -2,11 +2,10 @@ import { useEffect, useMemo, useState } from 'react'
import { Link } from 'react-router-dom'
import { gatePath } from '../utils/routes.js'
import { listInitiativeRoadmapCriteriaProgress, listInitiativeRoadmapGraphState } from '../api/roadmap.js'
import {
ROADMAP_ITEM_TYPE_LABELS,
} from '../constants/status.js'
import { ROADMAP_ITEM_TYPE_LABELS } from '../constants/status.js'
import { StatusBadge } from './StatusBadge.jsx'
import { GateGraphStateBadge } from './GateGraphStateBadge.jsx'
import { GateFulfillmentBadge } from './GateFulfillmentBadge.jsx'
import { EmptyState } from './EmptyState.jsx'
import { Modal } from './Modal.jsx'
import { RoadmapItemForm } from './RoadmapItemForm.jsx'
@@ -33,42 +32,46 @@ export function RoadmapPlanSection({
onReorder,
onDelete,
busy,
graphState: graphStateProp,
}) {
const [showCreate, setShowCreate] = useState(false)
const [dragItemId, setDragItemId] = useState('')
const [dropTargetId, setDropTargetId] = useState('')
const [criteriaProgress, setCriteriaProgress] = useState({})
const [graphState, setGraphState] = useState(null)
const [graphStateLocal, setGraphStateLocal] = useState(null)
const graphState = graphStateProp ?? graphStateLocal
const isDesktop = useMinWidth(1024)
const canReorder = canManage && typeof onReorder === 'function'
useEffect(() => {
if (!initiativeId) {
setCriteriaProgress({})
setGraphState(null)
if (!graphStateProp) setGraphStateLocal(null)
return undefined
}
let cancelled = false
Promise.all([
listInitiativeRoadmapCriteriaProgress(initiativeId),
listInitiativeRoadmapGraphState(initiativeId),
])
.then(([progressData, graphData]) => {
if (!cancelled) {
setCriteriaProgress(progressData || {})
setGraphState(graphData || null)
const loaders = [listInitiativeRoadmapCriteriaProgress(initiativeId)]
if (!graphStateProp) {
loaders.push(listInitiativeRoadmapGraphState(initiativeId))
}
Promise.all(loaders)
.then((results) => {
if (cancelled) return
setCriteriaProgress(results[0] || {})
if (!graphStateProp && results[1]) {
setGraphStateLocal(results[1] || null)
}
})
.catch(() => {
if (!cancelled) {
setCriteriaProgress({})
setGraphState(null)
if (!graphStateProp) setGraphStateLocal(null)
}
})
return () => {
cancelled = true
}
}, [initiativeId, items])
}, [initiativeId, items, graphStateProp])
const sortedItems = useMemo(() => sortByOrder(items), [items])
@@ -204,6 +207,7 @@ export function RoadmapPlanSection({
itemId={item.id}
siblingItems={sortedItems}
/>
<GateFulfillmentBadge graphState={graphState} itemId={item.id} />
{canReorder && !isDesktop && (
<ReorderControls
itemId={item.id}
+1
View File
@@ -76,6 +76,7 @@ export const ATTENTION_KIND_LABELS = {
initiative_without_next_action: 'Keine nächste Maßnahme',
stale_initiative: 'Inaktives Vorhaben',
milestone_at_risk: 'Meilenstein gefährdet',
gate_graph_blocked: 'Gate blockiert (Graph)',
overdue_action: 'Überfällig',
review_due: 'Review fällig',
recurring_due: 'Wiederkehrend fällig',
+16
View File
@@ -1797,6 +1797,22 @@
color: #b91c1c;
}
.status-pill--fulfillment {
background: #eff6ff;
color: #1d4ed8;
}
.status-pill--fulfillment-primary {
background: #dbeafe;
font-weight: 700;
}
.gates-plan-panel__fulfillment,
.gates-plan-panel__method-hint {
margin: 0 0 0.75rem;
font-size: 0.875rem;
}
.gate-map-view__node-title {
fill: var(--jk-text, #1a1a1a);
font-size: 14px;
+4 -1
View File
@@ -7,7 +7,7 @@ import { WidgetCard } from '../components/WidgetCard.jsx'
import { EmptyState } from '../components/EmptyState.jsx'
import { ATTENTION_KIND_LABELS } from '../constants/operating.js'
import { actionPath, scopedPath } from '../utils/routes.js'
import { actionPath, gatePath, scopedPath } from '../utils/routes.js'
const SEVERITY_LABELS = {
critical: 'Kritisch',
@@ -16,6 +16,9 @@ const SEVERITY_LABELS = {
}
function attentionLink(item) {
if (item.milestone_id) {
return gatePath(item.milestone_id)
}
if (item.action_id) {
return actionPath(item.action_id)
}