AP2.2e: Unplan, Bug/Issue-Referenz und Sprint-Lebenszyklus.
Deploy Development / deploy (push) Successful in 44s
Test Suite / pytest-backend (push) Successful in 2m52s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 13s

Ermöglicht APs zurück in den Eingang zu schieben, Bugs/Issues mit Feature-Bezug zu planen und den Scrum-Sprint-Ablauf in der UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-07-13 08:07:02 +02:00
1 parent e221b5b09f
commit e65838118c
21 files changed
+794 -14

No files matched your search

+28 -1
View File
@@ -1,9 +1,10 @@
import { Link } from 'react-router-dom'
import { ACTION_STATUSES, ACTION_STATUS_LABELS } from '../constants/status.js'
import { ACTION_STATUSES, ACTION_STATUS_LABELS, ACTION_KIND_LABELS } from '../constants/status.js'
import { StatusBadge } from './StatusBadge.jsx'
import { PriorityBadge } from './PriorityBadge.jsx'
import { ActionForm } from './ActionForm.jsx'
import { gateTitleById } from './GateSelect.jsx'
import { actionTitleById } from '../utils/actionReferences.js'
function formatDue(iso) {
if (!iso) return null
@@ -43,6 +44,7 @@ export function ActionHubCard({
onSubmitEdit,
onQuickStatus,
onCreateBlocker,
onUnplanToBacklog,
canManage,
canManageBlocker,
formBusy,
@@ -56,10 +58,15 @@ export function ActionHubCard({
roadmapItems = [],
workCycles = [],
activeWorkCycle = null,
allActions = [],
detailMode = false,
}) {
const due = formatDue(action.due_at)
const isBlocked = action.status === 'blocked' || context?.has_open_blocker
const canUnplan =
typeof onUnplanToBacklog === 'function' &&
action.work_cycle_id &&
['open', 'ready'].includes(action.status)
if (editing) {
return (
@@ -94,6 +101,11 @@ export function ActionHubCard({
<div className="action-hub-card-badges">
<StatusBadge status={action.status} />
<PriorityBadge priority={action.priority} />
{action.action_kind && action.action_kind !== 'delivery' && (
<span className="badge badge--kind muted">
{ACTION_KIND_LABELS[action.action_kind] || action.action_kind}
</span>
)}
</div>
</div>
{action.description && (
@@ -103,6 +115,11 @@ export function ActionHubCard({
{action.roadmap_item_id && (
<span>Gate: {gateTitleById(roadmapItems, action.roadmap_item_id) || '…'}</span>
)}
{action.parent_action_id && (
<span>
Feature: {actionTitleById(allActions, action.parent_action_id) || '…'}
</span>
)}
{action.assigned_actor_ids?.length > 0 && (
<span>{action.assigned_actor_ids.length} zugewiesen</span>
)}
@@ -174,6 +191,16 @@ export function ActionHubCard({
Blocker melden
</button>
)}
{canUnplan && (
<button
type="button"
className="btn btn-secondary btn-sm"
onClick={() => onUnplanToBacklog(action)}
disabled={formBusy}
>
Zurück in Eingang
</button>
)}
<button
type="button"
className="btn btn-ghost btn-sm"
@@ -1,14 +1,18 @@
import {
BACKLOG_STATUSES,
BACKLOG_STATUS_LABELS,
BACKLOG_ITEM_KINDS,
BACKLOG_ITEM_KIND_LABELS,
PRIORITIES,
PRIORITY_LABELS,
} from '../constants/status.js'
import { GateSelect } from './GateSelect.jsx'
import { FeatureParentSelect } from './FeatureParentSelect.jsx'
export function BacklogItemForm({
initial = {},
roadmapItems = [],
featureActions = [],
onSubmit,
onCancel,
busy = false,
@@ -19,17 +23,23 @@ export function BacklogItemForm({
e.preventDefault()
const form = e.target
const gateValue = form.roadmap_item_id?.value ?? ''
const parentValue = form.parent_action_id?.value ?? ''
await onSubmit({
title: form.title.value.trim(),
description: form.description.value,
status: form.status?.value,
priority: form.priority.value,
item_kind: form.item_kind?.value || 'story',
roadmap_item_id: gateValue || undefined,
clear_roadmap_item: gateValue === '',
parent_action_id: parentValue || undefined,
clear_parent_action: parentValue === '',
})
}
const statusLocked = initial.status === 'converted'
const showFeatureRef =
(initial.item_kind || 'story') !== 'story' || featureActions.length > 0
return (
<form className="form workspace-form backlog-item-form" onSubmit={handleSubmit}>
@@ -53,6 +63,20 @@ export function BacklogItemForm({
/>
</label>
<div className="form-row form-row--2">
<label>
Typ
<select
name="item_kind"
defaultValue={initial.item_kind || 'story'}
disabled={statusLocked}
>
{BACKLOG_ITEM_KINDS.map((kind) => (
<option key={kind} value={kind}>
{BACKLOG_ITEM_KIND_LABELS[kind]}
</option>
))}
</select>
</label>
{allowStatus && (
<label>
Status
@@ -69,6 +93,8 @@ export function BacklogItemForm({
</select>
</label>
)}
</div>
<div className="form-row form-row--2">
<label>
Priorität
<select name="priority" defaultValue={initial.priority || 'normal'} disabled={statusLocked}>
@@ -87,6 +113,13 @@ export function BacklogItemForm({
disabled={statusLocked}
/>
)}
{showFeatureRef && (
<FeatureParentSelect
featureActions={featureActions}
defaultValue={initial.parent_action_id || ''}
disabled={statusLocked}
/>
)}
<div className="form-actions">
<button type="submit" className="btn btn-primary" disabled={busy || statusLocked}>
{busy ? 'Speichern …' : submitLabel}
@@ -8,6 +8,8 @@ import { ReorderControls } from './ReorderControls.jsx'
import { gateTitleById } from './GateSelect.jsx'
import { computeDropPatches, computeMovePatches, sortByOrder } from '../utils/reorder.js'
import { useMinWidth } from '../hooks/useMinWidth.js'
import { BACKLOG_ITEM_KIND_LABELS } from '../constants/status.js'
import { actionTitleById } from '../utils/actionReferences.js'
const PLANNING_STATUSES = new Set(['planned', 'active', 'at_risk'])
/** Backend erlaubt Convert für diese Status — UI war nur bei „Freigegeben“ sichtbar. */
@@ -19,6 +21,7 @@ export function BacklogSection({
roadmapItems = [],
workCycles = [],
activeWorkCycle = null,
featureActions = [],
initiativeId = '',
sprintPlanningEnabled = false,
canManage,
@@ -89,6 +92,8 @@ export function BacklogSection({
description: payload.description,
priority: payload.priority,
roadmap_item_id: payload.roadmap_item_id,
item_kind: payload.item_kind,
parent_action_id: payload.parent_action_id,
status: payload.status || 'new',
})
closeModal()
@@ -103,6 +108,9 @@ export function BacklogSection({
priority: payload.priority,
roadmap_item_id: payload.roadmap_item_id,
clear_roadmap_item: payload.clear_roadmap_item,
item_kind: payload.item_kind,
parent_action_id: payload.parent_action_id,
clear_parent_action: payload.clear_parent_action,
})
if (ok !== false) closeModal()
}
@@ -302,9 +310,19 @@ export function BacklogSection({
disabled={!canManage}
>
<strong>{item.title}</strong>
{item.item_kind && item.item_kind !== 'story' && (
<span className="badge badge--kind muted">
{BACKLOG_ITEM_KIND_LABELS[item.item_kind] || item.item_kind}
</span>
)}
{item.description && (
<p className="list-item-desc">{item.description}</p>
)}
{item.parent_action_id && (
<p className="list-item-sub muted">
Feature: {actionTitleById(featureActions, item.parent_action_id) || '…'}
</p>
)}
{item.roadmap_item_id && (
<p className="list-item-sub muted">
Gate:{' '}
@@ -374,6 +392,7 @@ export function BacklogSection({
{modalMode?.kind === 'create' && (
<BacklogItemForm
roadmapItems={roadmapItems}
featureActions={featureActions}
onSubmit={handleCreateSubmit}
onCancel={closeModal}
busy={busy}
@@ -384,6 +403,7 @@ export function BacklogSection({
<BacklogItemForm
initial={modalMode.item}
roadmapItems={roadmapItems}
featureActions={featureActions}
onSubmit={handleEditSubmit}
onCancel={closeModal}
busy={busy}
@@ -0,0 +1,25 @@
export function FeatureParentSelect({
featureActions = [],
defaultValue = '',
disabled = false,
label = 'Bezug zu Feature (Arbeitspaket)',
}) {
return (
<label>
{label}
<select name="parent_action_id" defaultValue={defaultValue} disabled={disabled}>
<option value="">— kein Bezug —</option>
{featureActions.map((action) => (
<option key={action.id} value={action.id}>
{action.title}
</option>
))}
</select>
{featureActions.length === 0 && (
<span className="muted form-hint">
Lege zuerst ein Feature-Arbeitspaket an (Story/Lieferung), um Bugs/Issues zu verknüpfen.
</span>
)}
</label>
)
}
@@ -21,6 +21,7 @@ export function InitiativeActionsHub({
onUpdateAction,
onQuickStatus,
onCreateBlockerForAction,
onUnplanToBacklog,
canManage,
canManageBlocker,
formBusy,
@@ -96,6 +97,7 @@ export function InitiativeActionsHub({
onSubmitEdit={(payload) => onUpdateAction(action.id, payload)}
onQuickStatus={(status) => onQuickStatus(action, status)}
onCreateBlocker={() => onCreateBlockerForAction(action.id)}
onUnplanToBacklog={onUnplanToBacklog}
canManage={canManage}
canManageBlocker={canManageBlocker}
formBusy={formBusy}
@@ -109,6 +111,7 @@ export function InitiativeActionsHub({
roadmapItems={roadmapItems}
workCycles={workCycles}
activeWorkCycle={activeWorkCycle}
allActions={actions}
/>
))}
</div>
+46 -1
View File
@@ -2,6 +2,18 @@ import { useState } from 'react'
import { StatusBadge } from './StatusBadge.jsx'
import { EmptyState } from './EmptyState.jsx'
const SPRINT_LIFECYCLE = [
{ key: 'planned', label: 'Planung' },
{ key: 'active', label: 'Ausführung' },
{ key: 'reached', label: 'Abgeschlossen' },
]
function lifecycleStepIndex(status) {
if (status === 'reached') return 2
if (status === 'active' || status === 'at_risk') return 1
return 0
}
export function WorkCyclesPanel({
workCycles = [],
activeWorkCycle = null,
@@ -31,6 +43,18 @@ export function WorkCyclesPanel({
setGoal('')
}
async function handleComplete(cycle) {
const openCount = actionCountByCycleId[cycle.id] || 0
if (openCount > 0) {
const ok = window.confirm(
`Sprint „${cycle.title}" hat noch ${openCount} offene Arbeitspaket${openCount === 1 ? '' : 'e'}. ` +
'Trotzdem abschließen? Offene APs bleiben dem Sprint zugeordnet und können in den Eingang zurückgeschoben werden.',
)
if (!ok) return
}
await onComplete(cycle.id)
}
return (
<section className="card work-cycles-panel">
<div className="section-header">
@@ -39,6 +63,7 @@ export function WorkCyclesPanel({
<p className="section-lead muted">
Sprint anklicken, um den geplanten Sprint-Backlog zu sehen — aktiv oder geplant.
Committete Arbeitspakete aus dem Eingang erscheinen beim gewählten Sprint.
Lebenszyklus: Planung → Ausführung → Abschluss (Scrum).
</p>
</div>
</div>
@@ -95,6 +120,7 @@ export function WorkCyclesPanel({
{workCycles.map((cycle) => {
const isSelected = selectedSprintId === cycle.id
const apCount = actionCountByCycleId[cycle.id] || 0
const step = lifecycleStepIndex(cycle.status)
return (
<li
key={cycle.id}
@@ -113,6 +139,25 @@ export function WorkCyclesPanel({
<span className="muted work-cycle-row__count">
{apCount} AP{apCount === 1 ? '' : 's'}
</span>
<div className="work-cycle-lifecycle muted" aria-label="Sprint-Lebenszyklus">
{SPRINT_LIFECYCLE.map((phase, index) => (
<span
key={phase.key}
className={
'work-cycle-lifecycle__step' +
(index === step ? ' work-cycle-lifecycle__step--current' : '') +
(index < step ? ' work-cycle-lifecycle__step--done' : '')
}
>
{phase.label}
{index < SPRINT_LIFECYCLE.length - 1 && (
<span className="work-cycle-lifecycle__sep" aria-hidden="true">
→
</span>
)}
</span>
))}
</div>
{cycle.goal_description && (
<p className="muted item-meta">{cycle.goal_description}</p>
)}
@@ -123,7 +168,7 @@ export function WorkCyclesPanel({
type="button"
className="btn btn-secondary btn-sm"
disabled={busy}
onClick={() => onComplete(cycle.id)}
onClick={() => handleComplete(cycle)}
>
Abschließen
</button>