feat(steering): Epic Roll-up Read Model und Attention (ADP P4)
Test Suite / pytest-backend (push) Waiting to run
Test Suite / lint-backend (push) Waiting to run
Test Suite / compose-smoke (push) Waiting to run
Test Suite / k6 /api/health Baseline (push) Blocked by required conditions
Test Suite / playwright-smoke (push) Blocked by required conditions
Deploy Development / deploy (push) Has been cancelled
Test Suite / pytest-backend (push) Waiting to run
Test Suite / lint-backend (push) Waiting to run
Test Suite / compose-smoke (push) Waiting to run
Test Suite / k6 /api/health Baseline (push) Blocked by required conditions
Test Suite / playwright-smoke (push) Blocked by required conditions
Deploy Development / deploy (push) Has been cancelled
Schliesst den Backlog/Epic-Track mit kernel-basiertem Fortschritt pro Epic, Steuerungs-Attention und UI-Fortschrittsanzeige im Plan-Eingang ab. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
a13913f1a0
commit
ef5ee0d19b
13 files changed
+708
-5
No files matched your search
@@ -14,6 +14,11 @@ import { useInitiativeOperations } from '../context/InitiativeOperationsContext.
|
||||
import { hasSteeringElement } from '../registry/steeringElementRegistry.js'
|
||||
import { BacklogIntakeGuide } from './BacklogIntakeGuide.jsx'
|
||||
import { actionTitleById } from '../utils/actionReferences.js'
|
||||
import {
|
||||
epicRollupById,
|
||||
epicRollupProgressPercent,
|
||||
formatEpicRollupSummary,
|
||||
} from '../utils/epicRollup.js'
|
||||
|
||||
const PLANNING_STATUSES = new Set(['planned', 'active', 'at_risk'])
|
||||
/** Backend erlaubt Convert für diese Status — UI war nur bei „Freigegeben“ sichtbar. */
|
||||
@@ -38,7 +43,7 @@ export function BacklogSection({
|
||||
sectionTitle = 'Product Backlog',
|
||||
sectionLead = 'Eingang vor dem Commit — triagieren, dann in den Sprint planen.',
|
||||
}) {
|
||||
const { operatingContext, steeringElements } = useInitiativeOperations()
|
||||
const { operatingContext, steeringElements, steeringSnapshot } = useInitiativeOperations()
|
||||
const [modalMode, setModalMode] = useState(null)
|
||||
const [dragItemId, setDragItemId] = useState('')
|
||||
const [dropTargetId, setDropTargetId] = useState('')
|
||||
@@ -107,6 +112,12 @@ export function BacklogSection({
|
||||
return map
|
||||
}, [epicItems])
|
||||
|
||||
const rollupByEpicId = useMemo(
|
||||
() => epicRollupById(steeringSnapshot?.epic_rollup),
|
||||
[steeringSnapshot?.epic_rollup],
|
||||
)
|
||||
const showEpicRollup = Boolean(vocabulary.capabilities?.epic_hierarchy)
|
||||
|
||||
const defaultKind = vocabulary.default_kind || 'story'
|
||||
const hasConvertedItems = items.some((item) => item.status === 'converted')
|
||||
const directWorkEnabled = Boolean(
|
||||
@@ -326,6 +337,7 @@ export function BacklogSection({
|
||||
const isDropTarget = dropTargetId === item.id && dragItemId && dragItemId !== item.id
|
||||
const reorderable = canReorder && item.status !== 'converted'
|
||||
const isEpic = item.item_kind === 'epic'
|
||||
const epicRollup = isEpic && showEpicRollup ? rollupByEpicId[item.id] : null
|
||||
const flatIndex = sortedItems.findIndex((row) => row.id === item.id)
|
||||
|
||||
return (
|
||||
@@ -376,6 +388,24 @@ export function BacklogSection({
|
||||
{item.description && (
|
||||
<p className="list-item-desc">{item.description}</p>
|
||||
)}
|
||||
{epicRollup && (
|
||||
<div className="epic-rollup-summary">
|
||||
<div
|
||||
className="epic-rollup-summary__bar"
|
||||
role="progressbar"
|
||||
aria-valuenow={epicRollupProgressPercent(epicRollup)}
|
||||
aria-valuemin={0}
|
||||
aria-valuemax={100}
|
||||
aria-label={`Epic-Fortschritt ${epicRollupProgressPercent(epicRollup)} Prozent`}
|
||||
>
|
||||
<span
|
||||
className="epic-rollup-summary__fill"
|
||||
style={{ width: `${epicRollupProgressPercent(epicRollup)}%` }}
|
||||
/>
|
||||
</div>
|
||||
<p className="list-item-sub muted">{formatEpicRollupSummary(epicRollup)}</p>
|
||||
</div>
|
||||
)}
|
||||
{item.parent_backlog_id && (
|
||||
<p className="list-item-sub muted">
|
||||
Epic: {epicTitleById.get(item.parent_backlog_id) || '…'}
|
||||
|
||||
@@ -1678,6 +1678,27 @@
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
.epic-rollup-summary {
|
||||
margin-top: 0.35rem;
|
||||
max-width: 28rem;
|
||||
}
|
||||
|
||||
.epic-rollup-summary__bar {
|
||||
height: 0.35rem;
|
||||
border-radius: 999px;
|
||||
background: color-mix(in srgb, var(--jk-primary) 10%, var(--jk-surface));
|
||||
overflow: hidden;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.epic-rollup-summary__fill {
|
||||
display: block;
|
||||
height: 100%;
|
||||
border-radius: inherit;
|
||||
background: var(--jk-primary);
|
||||
transition: width 0.2s ease;
|
||||
}
|
||||
|
||||
.archetype-badge {
|
||||
background: var(--jk-surface-muted, #eef2f6);
|
||||
color: var(--jk-text-secondary, #445);
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/** Epic roll-up labels for Backlog UI (P4). */
|
||||
|
||||
export function epicRollupById(epicRollup = []) {
|
||||
return Object.fromEntries(
|
||||
(epicRollup || []).map((row) => [row.epic_backlog_id, row]),
|
||||
)
|
||||
}
|
||||
|
||||
export function formatEpicRollupSummary(rollup) {
|
||||
if (!rollup || rollup.child_total === 0) {
|
||||
return 'Noch keine Stories unter diesem Epic'
|
||||
}
|
||||
const done = rollup.actions_done ?? 0
|
||||
const total = rollup.child_total
|
||||
const uncommitted = rollup.child_uncommitted ?? 0
|
||||
if (rollup.status === 'done') {
|
||||
return `${done}/${total} erledigt — Epic abgeschlossen`
|
||||
}
|
||||
if (rollup.status === 'intake_only') {
|
||||
return `${total} Item(s) im Eingang — noch nicht committet`
|
||||
}
|
||||
let text = `${done}/${total} erledigt`
|
||||
if (uncommitted > 0) {
|
||||
text += `, ${uncommitted} noch im Eingang`
|
||||
}
|
||||
if (rollup.actions_in_progress > 0) {
|
||||
text += `, ${rollup.actions_in_progress} in Arbeit`
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
export function epicRollupProgressPercent(rollup) {
|
||||
if (!rollup?.child_total) return 0
|
||||
return Math.round((rollup.completion_ratio ?? 0) * 100)
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
epicRollupById,
|
||||
epicRollupProgressPercent,
|
||||
formatEpicRollupSummary,
|
||||
} from './epicRollup.js'
|
||||
|
||||
describe('epicRollup', () => {
|
||||
const rollup = {
|
||||
epic_backlog_id: 'e1',
|
||||
child_total: 4,
|
||||
child_uncommitted: 1,
|
||||
actions_done: 2,
|
||||
actions_in_progress: 1,
|
||||
completion_ratio: 0.5,
|
||||
status: 'in_progress',
|
||||
}
|
||||
|
||||
it('maps rollup by epic id', () => {
|
||||
const map = epicRollupById([rollup])
|
||||
expect(map.e1).toEqual(rollup)
|
||||
})
|
||||
|
||||
it('formats in-progress summary', () => {
|
||||
expect(formatEpicRollupSummary(rollup)).toContain('2/4 erledigt')
|
||||
expect(formatEpicRollupSummary(rollup)).toContain('1 noch im Eingang')
|
||||
})
|
||||
|
||||
it('computes progress percent', () => {
|
||||
expect(epicRollupProgressPercent(rollup)).toBe(50)
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user