fix: Sprint-Planung einsehbar und Eingang ohne Voll-Reload.
Deploy Development / deploy (push) Successful in 52s
Test Suite / pytest-backend (push) Successful in 2m46s
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 12s

Geplante Sprints in Plan anwaehlbar, lokales Update beim Commit, Sprint-Auswahl bleibt erhalten.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-07-12 19:38:39 +02:00
1 parent c19b6296ed
commit e221b5b09f
8 files changed
+269 -70

No files matched your search

+14 -3
View File
@@ -12,12 +12,14 @@ import { useMinWidth } from '../hooks/useMinWidth.js'
const PLANNING_STATUSES = new Set(['planned', 'active', 'at_risk'])
/** Backend erlaubt Convert für diese Status — UI war nur bei „Freigegeben“ sichtbar. */
const COMMITTABLE_STATUSES = new Set(['accepted', 'triaged', 'new'])
const SPRINT_TARGET_STORAGE_PREFIX = 'kairo-sprint-target:'
export function BacklogSection({
items,
roadmapItems = [],
workCycles = [],
activeWorkCycle = null,
initiativeId = '',
sprintPlanningEnabled = false,
canManage,
onCreate,
@@ -46,8 +48,12 @@ export function BacklogSection({
const showSprintPlanning = sprintPlanningEnabled && planableSprints.length > 0
useEffect(() => {
if (!showSprintPlanning) {
setSprintTargetId('')
if (!showSprintPlanning || !initiativeId) {
return
}
const stored = sessionStorage.getItem(SPRINT_TARGET_STORAGE_PREFIX + initiativeId)
if (stored && planableSprints.some((cycle) => cycle.id === stored)) {
setSprintTargetId(stored)
return
}
if (sprintTargetId && planableSprints.some((cycle) => cycle.id === sprintTargetId)) {
@@ -55,7 +61,12 @@ export function BacklogSection({
}
const preferred = activeWorkCycle?.id || planableSprints[0]?.id || ''
setSprintTargetId(preferred)
}, [showSprintPlanning, sprintTargetId, planableSprints, activeWorkCycle?.id])
}, [showSprintPlanning, initiativeId, planableSprints, activeWorkCycle?.id])
useEffect(() => {
if (!initiativeId || !sprintTargetId) return
sessionStorage.setItem(SPRINT_TARGET_STORAGE_PREFIX + initiativeId, sprintTargetId)
}, [initiativeId, sprintTargetId])
const selectedSprint = planableSprints.find((cycle) => cycle.id === sprintTargetId) || null
+53 -34
View File
@@ -5,10 +5,13 @@ import { EmptyState } from './EmptyState.jsx'
export function WorkCyclesPanel({
workCycles = [],
activeWorkCycle = null,
selectedSprintId = '',
actionCountByCycleId = {},
canManage,
onCreate,
onActivate,
onComplete,
onSelectSprint,
busy = false,
}) {
const [title, setTitle] = useState('')
@@ -34,8 +37,8 @@ export function WorkCyclesPanel({
<div>
<h2>Sprint</h2>
<p className="section-lead muted">
Der aktive Sprint definiert den Sprint-Backlog — committete Arbeitspakete mit
Sprint-Zuweisung erscheinen unter Ausführen → Sprint.
Sprint anklicken, um den geplanten Sprint-Backlog zu sehen — aktiv oder geplant.
Committete Arbeitspakete aus dem Eingang erscheinen beim gewählten Sprint.
</p>
</div>
</div>
@@ -46,12 +49,9 @@ export function WorkCyclesPanel({
{activeWorkCycle.goal_description && (
<span className="muted"> — {activeWorkCycle.goal_description}</span>
)}
{typeof activeWorkCycle.open_action_count === 'number' && (
<span className="muted"> ({activeWorkCycle.open_action_count} offene APs)</span>
)}
</p>
) : (
<p className="muted">Kein aktiver Sprint — committete Arbeitspakete gelten als Product-Ist.</p>
<p className="muted">Kein aktiver Sprint — du kannst trotzdem geplante Sprints einsehen.</p>
)}
{canManage && (
@@ -91,38 +91,57 @@ export function WorkCyclesPanel({
{workCycles.length === 0 ? (
<EmptyState message="Noch keine Sprints angelegt." />
) : (
<ul className="item-list">
{workCycles.map((cycle) => (
<li key={cycle.id} className="list-item card-list-item work-cycle-row">
<div>
<strong>{cycle.title}</strong>{' '}
<StatusBadge status={cycle.status} />
{cycle.goal_description && (
<p className="muted item-meta">{cycle.goal_description}</p>
)}
</div>
{canManage && cycle.status === 'active' && typeof onComplete === 'function' && (
<ul className="item-list work-cycle-list">
{workCycles.map((cycle) => {
const isSelected = selectedSprintId === cycle.id
const apCount = actionCountByCycleId[cycle.id] || 0
return (
<li
key={cycle.id}
className={
'list-item card-list-item work-cycle-row' +
(isSelected ? ' work-cycle-row--selected' : '')
}
>
<button
type="button"
className="btn btn-secondary btn-sm"
disabled={busy}
onClick={() => onComplete(cycle.id)}
className="work-cycle-row__select"
onClick={() => onSelectSprint?.(cycle.id)}
>
Abschließen
<strong>{cycle.title}</strong>{' '}
<StatusBadge status={cycle.status} />
<span className="muted work-cycle-row__count">
{apCount} AP{apCount === 1 ? '' : 's'}
</span>
{cycle.goal_description && (
<p className="muted item-meta">{cycle.goal_description}</p>
)}
</button>
)}
{canManage && cycle.status !== 'active' && cycle.status !== 'reached' && (
<button
type="button"
className="btn btn-secondary btn-sm"
disabled={busy}
onClick={() => onActivate(cycle.id)}
>
Aktivieren
</button>
)}
</li>
))}
<div className="work-cycle-row__actions">
{canManage && cycle.status === 'active' && typeof onComplete === 'function' && (
<button
type="button"
className="btn btn-secondary btn-sm"
disabled={busy}
onClick={() => onComplete(cycle.id)}
>
Abschließen
</button>
)}
{canManage && cycle.status !== 'active' && cycle.status !== 'reached' && (
<button
type="button"
className="btn btn-secondary btn-sm"
disabled={busy}
onClick={() => onActivate(cycle.id)}
>
Aktivieren
</button>
)}
</div>
</li>
)
})}
</ul>
)}
</section>