Erfassen und Transparent: Archetyp, Methode und Auspraegung in der UI sichtbar.
Test Suite / pytest-backend (push) Failing after 2s
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
Deploy Development / deploy (push) Failing after 50s

Method-Profiles-API und Auswahl beim Anlegen/Profil; Steuerungs-Meta in Listen und Plan; Projekt-Archetyp-Spiegel, Next-Action-Links und Umlaut-Fix fuer testbare Guidance.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-07-10 12:36:12 +02:00
1 parent 95b743d6fd
commit efb45a3ee6
31 files changed
+965 -65

No files matched your search

@@ -0,0 +1,11 @@
import { archetypeLabel } from '../utils/archetypes.js'
export function ArchetypeBadge({ archetypeKey, archetypes = [], title }) {
if (!archetypeKey) return null
const label = archetypeLabel(archetypeKey, archetypes)
return (
<span className="badge archetype-badge" title={title || archetypeKey}>
{label}
</span>
)
}
@@ -8,7 +8,10 @@ import {
getInitiativeFields,
listArchetypeFieldDefinitions,
} from '../api/entityFields.js'
import { listSteeringMethods } from '../api/steering.js'
import { listMethodProfiles } from '../api/methodProfiles.js'
import { FieldRenderer } from './FieldRenderer.jsx'
import { InitiativeSteeringMeta } from './InitiativeSteeringMeta.jsx'
export function InitiativeForm({
initial = {},
@@ -23,6 +26,42 @@ export function InitiativeForm({
const [fieldDefinitions, setFieldDefinitions] = useState([])
const [dynamicValues, setDynamicValues] = useState({})
const [fieldsLoading, setFieldsLoading] = useState(false)
const [steeringMethods, setSteeringMethods] = useState([])
const [methodProfiles, setMethodProfiles] = useState([])
const [methodProfileKey, setMethodProfileKey] = useState('')
useEffect(() => {
let cancelled = false
listSteeringMethods()
.then((items) => {
if (!cancelled) setSteeringMethods(Array.isArray(items) ? items : [])
})
.catch(() => {
if (!cancelled) setSteeringMethods([])
})
return () => {
cancelled = true
}
}, [])
useEffect(() => {
let cancelled = false
setMethodProfileKey('')
if (!archetypeKey) {
setMethodProfiles([])
return undefined
}
listMethodProfiles(archetypeKey)
.then((items) => {
if (!cancelled) setMethodProfiles(Array.isArray(items) ? items : [])
})
.catch(() => {
if (!cancelled) setMethodProfiles([])
})
return () => {
cancelled = true
}
}, [archetypeKey])
useEffect(() => {
let cancelled = false
@@ -91,6 +130,7 @@ export function InitiativeForm({
status: form.status.value,
priority: form.priority.value,
dynamicFields: dynamicValues,
...(methodProfileKey ? { method_profile_key: methodProfileKey } : {}),
})
}
@@ -121,6 +161,30 @@ export function InitiativeForm({
))}
</select>
</label>
{methodProfiles.length > 0 && (
<label>
Ausprägung (optional)
<select
name="method_profile_key"
value={methodProfileKey}
onChange={(e) => setMethodProfileKey(e.target.value)}
>
<option value="">— Standard (nur Archetyp) —</option>
{methodProfiles.map((item) => (
<option key={item.key} value={item.key}>
{item.label}
</option>
))}
</select>
</label>
)}
<InitiativeSteeringMeta
archetypeKey={archetypeKey}
initiativeArchetypes={archetypes || []}
steeringMethods={steeringMethods}
methodProfiles={methodProfiles}
selectedMethodProfileKey={methodProfileKey}
/>
<label>
Kurzbeschreibung (Ziel)
<textarea name="goal" rows={2} defaultValue={initial.goal || ''} />
@@ -0,0 +1,98 @@
import {
archetypeLabel,
findArchetype,
methodDescriptionForKey,
methodLabelForKey,
methodProfileDescription,
methodProfileLabel,
} from '../utils/archetypes.js'
/**
* Zeigt Archetyp → Methode → Ausprägung transparent (Capture & Lagebild).
*/
export function InitiativeSteeringMeta({
archetypeKey,
initiativeArchetypes = [],
steeringSnapshot = null,
steeringMethods = [],
methodProfiles = [],
selectedMethodProfileKey = '',
compact = false,
}) {
const archetype = findArchetype(archetypeKey, initiativeArchetypes)
const profileKey =
steeringSnapshot?.method_profile_key || selectedMethodProfileKey || null
const profileLabel =
steeringSnapshot?.method_profile_label ||
methodProfileLabel(profileKey, methodProfiles)
const profileDescription = methodProfileDescription(profileKey, methodProfiles)
const selectedProfile = profileKey
? methodProfiles.find((item) => item.key === profileKey)
: null
const methodKey =
steeringSnapshot?.method_key ||
selectedProfile?.method_key ||
archetype?.default_method_key ||
null
const methodLabel =
steeringSnapshot?.method_label || methodLabelForKey(methodKey, steeringMethods)
const methodDescription = methodDescriptionForKey(methodKey, steeringMethods)
if (!archetypeKey && !methodKey) {
return null
}
const className = compact
? 'initiative-steering-meta initiative-steering-meta--compact'
: 'initiative-steering-meta'
return (
<div className={className}>
{archetypeKey && (
<div className="initiative-steering-meta__row">
<span className="initiative-steering-meta__label">Archetyp</span>
<span className="initiative-steering-meta__value">
<strong>{archetypeLabel(archetypeKey, initiativeArchetypes)}</strong>
{!compact && archetype?.description && (
<span className="initiative-steering-meta__hint muted">
{archetype.description}
</span>
)}
</span>
</div>
)}
{profileKey && (
<div className="initiative-steering-meta__row">
<span className="initiative-steering-meta__label">Ausprägung</span>
<span className="initiative-steering-meta__value">
<strong>{profileLabel}</strong>
{!compact && profileDescription && (
<span className="initiative-steering-meta__hint muted">
{profileDescription}
</span>
)}
</span>
</div>
)}
{methodKey && (
<div className="initiative-steering-meta__row">
<span className="initiative-steering-meta__label">Steuerungsmethode</span>
<span className="initiative-steering-meta__value">
<strong>{methodLabel}</strong>
{!compact && methodDescription && (
<span className="initiative-steering-meta__hint muted">
{methodDescription}
</span>
)}
{!compact && !steeringSnapshot && archetype?.default_method_key && !profileKey && (
<span className="initiative-steering-meta__hint muted">
Wird beim Anlegen automatisch vom Archetyp abgeleitet.
</span>
)}
</span>
</div>
)}
</div>
)
}
@@ -0,0 +1,56 @@
import { useEffect, useState } from 'react'
import { listMethodProfiles } from '../api/methodProfiles.js'
export function MethodProfileSelect({
archetypeKey,
value = '',
onChange,
disabled = false,
}) {
const [profiles, setProfiles] = useState([])
useEffect(() => {
if (!archetypeKey) {
setProfiles([])
return undefined
}
let cancelled = false
listMethodProfiles(archetypeKey)
.then((items) => {
if (!cancelled) setProfiles(Array.isArray(items) ? items : [])
})
.catch(() => {
if (!cancelled) setProfiles([])
})
return () => {
cancelled = true
}
}, [archetypeKey])
if (profiles.length === 0) {
return (
<p className="muted method-profile-select__empty">
Keine Referenz-Ausprägung für diesen Archetyp hinterlegt.
</p>
)
}
return (
<label className="method-profile-select">
Ausprägung
<select
value={value || ''}
disabled={disabled}
onChange={(e) => onChange?.(e.target.value)}
aria-label="Methoden-Ausprägung"
>
<option value="">— Standard (nur Archetyp) —</option>
{profiles.map((item) => (
<option key={item.key} value={item.key}>
{item.label}
</option>
))}
</select>
</label>
)
}
+31 -1
View File
@@ -1,8 +1,10 @@
import { NavLink, useLocation } from 'react-router-dom'
import { useEffect, useState } from 'react'
import { listInitiativeActions } from '../api/initiatives.js'
import { getInitiative, listInitiativeActions } from '../api/initiatives.js'
import { listInitiativeBacklog } from '../api/backlog.js'
import { useProgramScope } from '../context/ProgramScopeContext.jsx'
import { useEntityArchetypes } from '../hooks/useEntityArchetypes.js'
import { InitiativeSteeringMeta } from './InitiativeSteeringMeta.jsx'
import {
PLAN_OUTLINE_NODES,
resolvePlanOutlineActiveKey,
@@ -11,8 +13,28 @@ import {
export function PlanOutlineNav() {
const location = useLocation()
const { initiativeId, initiativeTitle, hrefWithScope } = useProgramScope()
const { initiativeArchetypes } = useEntityArchetypes()
const activeKey = resolvePlanOutlineActiveKey(location.pathname)
const [counts, setCounts] = useState({ inbox: null, work: null })
const [initiativeArchetypeKey, setInitiativeArchetypeKey] = useState('')
useEffect(() => {
if (!initiativeId) {
setInitiativeArchetypeKey('')
return undefined
}
let cancelled = false
getInitiative(initiativeId)
.then((data) => {
if (!cancelled) setInitiativeArchetypeKey(data.archetype_key || '')
})
.catch(() => {
if (!cancelled) setInitiativeArchetypeKey('')
})
return () => {
cancelled = true
}
}, [initiativeId])
useEffect(() => {
if (!initiativeId) {
@@ -62,6 +84,14 @@ export function PlanOutlineNav() {
)}
</div>
{initiativeId && initiativeArchetypeKey && (
<InitiativeSteeringMeta
archetypeKey={initiativeArchetypeKey}
initiativeArchetypes={initiativeArchetypes}
compact
/>
)}
<ul className="plan-outline-nav__list">
{PLAN_OUTLINE_NODES.map((node) => {
const needsInitiative = node.requiresInitiative && !initiativeId
+17
View File
@@ -1,6 +1,7 @@
import { INITIATIVE_STATUSES, INITIATIVE_STATUS_LABELS } from '../constants/status.js'
import { GateSelect } from './GateSelect.jsx'
import { flattenProjectOptions } from '../utils/projectTree.js'
import { projectArchetypeLabel } from '../utils/archetypes.js'
const CONTAINER_KINDS = [
{ value: '', label: '— Standard —' },
@@ -19,6 +20,9 @@ export function ProjectForm({
onCancel,
busy = false,
submitLabel = 'Speichern',
initiativeArchetypeKey = '',
initiativeArchetypes = [],
projectArchetypes = [],
}) {
const parentOptions = flattenProjectOptions(
projects.filter((p) => p.id !== excludeProjectId),
@@ -51,6 +55,19 @@ export function ProjectForm({
return (
<form className="form workspace-form project-form" onSubmit={handleSubmit}>
{initiativeArchetypeKey && (
<p className="form-hint muted project-form-archetype-hint">
Archetyp wird vom Vorhaben übernommen:{' '}
<strong>
{projectArchetypeLabel(
`project.${initiativeArchetypeKey.replace(/^initiative\./, '')}`,
projectArchetypes,
initiativeArchetypes,
)}
</strong>
. „Art“ unten ist nur die Struktur-Rolle (Projekt, Stream, Phase …).
</p>
)}
<label>
Titel
<input
@@ -170,6 +170,9 @@ export function ProjectsSection({
onDelete,
onReorder,
busy,
initiativeArchetypeKey = '',
initiativeArchetypes = [],
projectArchetypes = [],
}) {
const [modalMode, setModalMode] = useState(null)
const [dragProjectId, setDragProjectId] = useState('')
@@ -315,6 +318,9 @@ export function ProjectsSection({
onCancel={closeModal}
busy={busy}
submitLabel="Anlegen"
initiativeArchetypeKey={initiativeArchetypeKey}
initiativeArchetypes={initiativeArchetypes}
projectArchetypes={projectArchetypes}
/>
)}
{modalMode?.kind === 'edit' && modalMode.project && (
@@ -326,6 +332,9 @@ export function ProjectsSection({
onSubmit={handleEditSubmit}
onCancel={closeModal}
busy={busy}
initiativeArchetypeKey={initiativeArchetypeKey}
initiativeArchetypes={initiativeArchetypes}
projectArchetypes={projectArchetypes}
/>
)}
</Modal>
@@ -4,6 +4,9 @@ import {
NEXT_ACTION_KIND_LABELS,
} from '../constants/operating.js'
import { MILESTONE_STATUS_LABELS } from '../constants/status.js'
import { methodDescriptionForKey } from '../utils/archetypes.js'
import { Link } from 'react-router-dom'
import { scopedPath } from '../utils/routes.js'
function formatDate(iso) {
if (!iso) return '—'
@@ -52,6 +55,7 @@ export function SteeringSnapshotPanel({
archetype_key,
archetype_label,
method_profile_key,
method_profile_label,
steering_guidance,
attention_items = [],
signals = [],
@@ -71,6 +75,27 @@ export function SteeringSnapshotPanel({
{ label: 'Blocker', value: counts.blockers_open, warn: counts.blockers_open > 0 },
]
const methodDescription = methodDescriptionForKey(method_key, methods)
function nextActionLink(item) {
if (item.action_id) {
return { to: `/actions/${item.action_id}`, label: 'Arbeitspaket öffnen' }
}
if (item.backlog_item_id && item.initiative_id) {
return {
to: scopedPath('/plan/inbox', { initiativeId: item.initiative_id }),
label: 'Zum Eingang',
}
}
if (item.kind === 'create_action' && item.initiative_id) {
return {
to: scopedPath('/plan/work', { initiativeId: item.initiative_id }),
label: 'Arbeitspaket anlegen',
}
}
return null
}
return (
<section className="card steering-snapshot steering-snapshot--hero">
<header className="steering-hero-header">
@@ -92,7 +117,13 @@ export function SteeringSnapshotPanel({
{(archetype_label || archetype_key) && (
<p className="steering-archetype-row muted">
Archetyp: <strong>{archetype_label || archetype_key}</strong>
{method_profile_key ? ` · Ausprägung: ${method_profile_key}` : ''}
{method_profile_label || method_profile_key ? (
<>
{' '}
· Ausprägung:{' '}
<strong>{method_profile_label || method_profile_key}</strong>
</>
) : null}
</p>
)}
{(method_label || canManageMethod) && (
@@ -115,6 +146,9 @@ export function SteeringSnapshotPanel({
) : (
<strong>{method_label || method_key}</strong>
)}
{methodDescription && (
<span className="steering-method-description muted">{methodDescription}</span>
)}
</p>
)}
@@ -133,7 +167,7 @@ export function SteeringSnapshotPanel({
{(attention_items?.length > 0 || signals?.length > 0) && (
<p className="muted snapshot-signals snapshot-attention">
Attention:{' '}
Aufmerksamkeit:{' '}
{(attention_items.length > 0
? attention_items.map((a) => a.label)
: signals.map((s) => SIGNAL_LABELS[s] || s)
@@ -146,19 +180,25 @@ export function SteeringSnapshotPanel({
<div className="steering-next-actions">
<h3>Nächste Schritte</h3>
<ol className="item-list compact-list">
{next_actions.map((item, i) => (
{next_actions.map((item, i) => {
const link = nextActionLink(item)
return (
<li key={`${item.kind}-${i}`} className="list-item card-list-item compact">
<div className="list-item-main">
<span className="next-action-rank">{i + 1}</span>
<strong>{item.title}</strong>
<span className="muted list-item-sub">
{NEXT_ACTION_KIND_LABELS[item.kind] || item.kind}
{item.reason_code ? ` · ${item.reason_code}` : ''}
{item.recommended_action ? ` — ${item.recommended_action}` : ''}
</span>
</div>
{link && (
<Link to={link.to} className="btn btn-primary btn-sm">
{link.label}
</Link>
)}
</li>
))}
)})}
</ol>
</div>
)}