feat(AP1.9d, AP2.2d): Work-Default-UI, Sprint-Planung und Composition Work-Slots
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) Successful in 47s
Test Suite / pytest-backend (push) Has been cancelled

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-07-27 18:05:15 +02:00
1 parent 89ae15ca4c
commit 252b3f05f2
20 files changed
+639 -246

No files matched your search

@@ -33,6 +33,9 @@ export function InitiativeCompositionSurface({
handleMethodChange: ops.handleMethodChange,
methodBusy: ops.methodBusy,
formBusy: ops.formBusy,
activeWorkCycle: ops.activeWorkCycle,
uiFeatures: ops.uiFeatures,
dataSlices: ops.dataSlices,
onAcceptBacklogProposal,
}),
[
@@ -46,6 +49,9 @@ export function InitiativeCompositionSurface({
ops.handleMethodChange,
ops.methodBusy,
ops.formBusy,
ops.activeWorkCycle,
ops.uiFeatures,
ops.dataSlices,
onAcceptBacklogProposal,
],
)
@@ -0,0 +1,113 @@
import { useInitiativeOperations } from '../context/InitiativeOperationsContext.jsx'
import { InitiativeActionsHub } from '../components/InitiativeActionsHub.jsx'
import { EmptyState } from '../components/EmptyState.jsx'
import { PRODUCT_TERMS, actionCountLabel } from '../constants/productLanguage.js'
/**
* Composition-Provider: committete Arbeitspakete als Drill-down (nicht Hauptbild).
* @param {{ variant?: 'today' | 'sprint' | 'sprint-product', defaultCollapsed?: boolean }} props
*/
export function WorkActionsPanel({ variant = 'today', defaultCollapsed = true }) {
const ops = useInitiativeOperations()
const {
initiativeId,
actions,
visibleActions,
sprintActions,
activeWorkCycle,
uiFeatures,
dataSlices,
projects,
roadmapItems,
actionContextById,
hideDone,
setHideDone,
showActionForm,
setShowActionForm,
editingActionId,
setEditingActionId,
formBusy,
actors,
actorsLoading,
actorsError,
actorsUsedFallback,
reloadActors,
handleCreateAction,
handleUpdateAction,
handleQuickStatus,
handleCreateBlockerForAction,
handleMoveActionToSprint,
handleUnplanAction,
capabilities,
workCycles,
} = ops
const supportsWorkCycles = dataSlices.includes('work_cycles')
const isProductMode = uiFeatures.continuousProductWorkMode && supportsWorkCycles
let panelActions = visibleActions
let sectionTitle = PRODUCT_TERMS.actionPlural
let sectionLead =
'Committete operative Einheit — nur bei Bedarf die volle Liste öffnen.'
if (variant === 'sprint' && activeWorkCycle) {
panelActions = sprintActions
sectionTitle = PRODUCT_TERMS.sprintBacklog
sectionLead = `Arbeitspakete im ${PRODUCT_TERMS.workCycle} „${activeWorkCycle.title}“.`
} else if (variant === 'sprint-product' && isProductMode && !activeWorkCycle) {
panelActions = visibleActions
sectionTitle = `Committete ${PRODUCT_TERMS.actionPlural}`
sectionLead = `Ohne aktiven ${PRODUCT_TERMS.workCycle} — Product-Ist im Vorhaben.`
} else if (variant === 'sprint' && !activeWorkCycle && !isProductMode) {
return (
<EmptyState
message={`${PRODUCT_TERMS.sprintBacklog} ist für diesen Vorhabentyp nicht verfügbar.`}
/>
)
}
const openCount = panelActions.filter((a) => a.status !== 'done' && a.status !== 'discarded').length
const expandLabel =
openCount > 0
? `${actionCountLabel(openCount)} anzeigen`
: `Alle ${PRODUCT_TERMS.actionPlural} anzeigen`
return (
<InitiativeActionsHub
initiativeId={initiativeId}
actions={panelActions}
projects={projects}
roadmapItems={roadmapItems}
actionContextById={actionContextById}
hideDone={hideDone}
onHideDoneChange={setHideDone}
showForm={showActionForm}
onToggleForm={() => setShowActionForm((v) => !v)}
editingActionId={editingActionId}
onEditAction={setEditingActionId}
onCancelEdit={() => setEditingActionId(null)}
onCreateAction={handleCreateAction}
onUpdateAction={handleUpdateAction}
onQuickStatus={handleQuickStatus}
onCreateBlockerForAction={handleCreateBlockerForAction}
onMoveToSprint={handleMoveActionToSprint}
onUnplanToBacklog={handleUnplanAction}
canManage={capabilities.has('kairo.action.manage')}
canManageBlocker={capabilities.has('kairo.blocker.manage')}
formBusy={formBusy}
actors={actors}
actorsLoading={actorsLoading}
actorsError={actorsError}
actorsUsedFallback={actorsUsedFallback}
onReloadActors={reloadActors}
workCycles={workCycles}
activeWorkCycle={activeWorkCycle}
allActions={actions}
sectionTitle={sectionTitle}
sectionLead={sectionLead}
collapsible
defaultCollapsed={defaultCollapsed}
expandLabel={expandLabel}
/>
)
}
@@ -22,6 +22,7 @@ import { WIDGETS } from '../registry/widgetRegistry.js'
* @property {string} [proposalKey]
* @property {string} [widgetKey]
* @property {string} [predicateKey]
* @property {string} [workActionsVariant]
*/
const WIDGET_PROVIDERS = WIDGETS.filter((w) => w.area === 'workspace').map((widget) => ({
@@ -81,7 +82,7 @@ export const COMPOSITION_PROVIDERS = [
key: 'steering.next_action',
kind: 'steering_element',
steeringElement: 'next_action_primary',
slotKeys: ['control.status.steering'],
slotKeys: ['control.status.steering', 'work.today.primary', 'work.sprint.primary'],
componentKey: 'NextActionWidget',
requiresCapability: 'kairo.workspace.read',
scopeTypes: ['initiative'],
@@ -137,6 +138,40 @@ export const COMPOSITION_PROVIDERS = [
scopeTypes: ['initiative'],
order: 0,
},
// —— Work / Ausführen (AP1.9d — Drill-down, kein Todo-Wand-Hauptbild) ——
{
key: 'work.actions.today',
kind: 'core',
slotKeys: ['work.today.actions'],
componentKey: 'WorkActionsPanel',
workActionsVariant: 'today',
requiresCapability: 'kairo.action.read',
scopeTypes: ['initiative'],
order: 0,
},
{
key: 'work.actions.sprint',
kind: 'conditional',
predicateKey: 'hasActiveWorkCycle',
slotKeys: ['work.sprint.backlog'],
componentKey: 'WorkActionsPanel',
workActionsVariant: 'sprint',
requiresCapability: 'kairo.action.read',
scopeTypes: ['initiative'],
order: 0,
},
{
key: 'work.actions.sprint_product',
kind: 'conditional',
predicateKey: 'isProductWithoutActiveSprint',
slotKeys: ['work.sprint.backlog'],
componentKey: 'WorkActionsPanel',
workActionsVariant: 'sprint-product',
requiresCapability: 'kairo.action.read',
scopeTypes: ['initiative'],
order: 5,
},
]
/**
@@ -7,6 +7,7 @@ import { RecurringRhythmPanel } from '../components/RecurringRhythmPanel.jsx'
import { AgentSlotsPanel } from '../components/AgentSlotsPanel.jsx'
import { SteeringProposalsPanel } from '../components/SteeringProposalsPanel.jsx'
import { NextActionWidget } from '../widgets/NextActionWidget.jsx'
import { WorkActionsPanel } from './WorkActionsPanel.jsx'
/** Roadblocker-Strip — extrahiert aus InitiativeOverviewPage für Composition. */
export function RoadblockersStrip({ initiativeId, actionsBlocked = 0, blockersOpen = 0 }) {
@@ -43,6 +44,7 @@ export const PROVIDER_COMPONENTS = {
SteeringProposalsPanel,
RoadblockersStrip,
WidgetHost,
WorkActionsPanel,
}
/**
@@ -33,6 +33,25 @@ const CONDITIONAL_PREDICATES = {
const counts = ctx.steeringSnapshot?.counts || {}
return (counts.actions_blocked || 0) > 0 || (counts.blockers_open || 0) > 0
},
hasActiveWorkCycle(ctx) {
const cycle =
ctx.steeringSnapshot?.active_work_cycle
|| ctx.opsContext?.activeWorkCycle
|| null
return Boolean(cycle?.id)
},
isProductWithoutActiveSprint(ctx) {
if (CONDITIONAL_PREDICATES.hasActiveWorkCycle(ctx)) return false
const features =
ctx.operatingContext?.ui_features
|| ctx.opsContext?.uiFeatures
|| {}
const slices =
ctx.operatingContext?.data_slices
|| ctx.opsContext?.dataSlices
|| []
return Boolean(features.continuousProductWorkMode && slices.includes('work_cycles'))
},
}
/**
@@ -221,6 +240,11 @@ export function buildProviderProps(provider, input) {
const widget = getWidgetByKey(provider.widgetKey)
return { widget }
}
case 'WorkActionsPanel':
return {
variant: provider.workActionsVariant || 'today',
defaultCollapsed: true,
}
default:
return {}
}
@@ -18,6 +18,8 @@ describe('uiSlotRegistry', () => {
it('defines MVP surfaces', () => {
expect(COMPOSITION_SURFACES['control.status']).toBeTruthy()
expect(COMPOSITION_SURFACES['plan.inbox']).toBeTruthy()
expect(COMPOSITION_SURFACES['work.today']).toBeTruthy()
expect(COMPOSITION_SURFACES['work.sprint']).toBeTruthy()
expect(COMPOSITION_SURFACES.cockpit).toBeTruthy()
})
@@ -258,4 +260,67 @@ describe('resolveSteeringComposition', () => {
expect(withGate.showGateHorizon).toBe(true)
expect(withoutGate.showGateHorizon).toBe(false)
})
it('activates work.today next action and actions providers', () => {
const result = resolveSteeringComposition({
surfaceKey: 'work.today',
scope: 'initiative',
capabilities: CAPS,
steeringElements: ['next_action_primary', 'critical_path'],
steeringSnapshot: { counts: {}, next_actions: [{ kind: 'action', title: 'X' }] },
opsContext: { initiativeId: 'init-1' },
})
expect(result.slots['work.today.primary']?.some((p) => p.key === 'steering.next_action')).toBe(
true,
)
expect(result.slots['work.today.actions']?.some((p) => p.key === 'work.actions.today')).toBe(
true,
)
})
it('activates sprint backlog provider when active work cycle', () => {
const result = resolveSteeringComposition({
surfaceKey: 'work.sprint',
scope: 'initiative',
capabilities: CAPS,
steeringElements: ['next_action_primary', 'work_cycle_scope'],
steeringSnapshot: {
counts: {},
next_actions: [],
active_work_cycle: { id: 'wc-1', title: 'Sprint R1' },
},
opsContext: { initiativeId: 'init-1', activeWorkCycle: { id: 'wc-1' } },
})
expect(result.slots['work.sprint.backlog']?.some((p) => p.key === 'work.actions.sprint')).toBe(
true,
)
})
it('activates product backlog panel without active sprint', () => {
const result = resolveSteeringComposition({
surfaceKey: 'work.sprint',
scope: 'initiative',
capabilities: CAPS,
operatingContext: {
ui_features: { continuousProductWorkMode: true },
data_slices: ['work_cycles'],
},
steeringSnapshot: { counts: {}, next_actions: [] },
opsContext: {
initiativeId: 'init-1',
uiFeatures: { continuousProductWorkMode: true },
dataSlices: ['work_cycles'],
},
})
expect(
result.slots['work.sprint.backlog']?.some((p) => p.key === 'work.actions.sprint_product'),
).toBe(true)
})
it('buildProviderProps passes work actions variant', () => {
const provider = COMPOSITION_PROVIDERS.find((p) => p.key === 'work.actions.today')
const props = buildProviderProps(provider, { opsContext: {} })
expect(props.variant).toBe('today')
expect(props.defaultCollapsed).toBe(true)
})
})
@@ -26,6 +26,11 @@ export const UI_SLOTS = [
{ key: 'plan.inbox.proposals', mode: 'plan', routeKey: 'inbox', label: 'Triage-Vorschläge', order: 0 },
{ key: 'plan.sprint.proposals', mode: 'plan', routeKey: 'sprint', label: 'Sprint-Vorschläge', order: 0 },
{ key: 'plan.gates.proposals', mode: 'plan', routeKey: 'gates', label: 'Gate-Vorschläge', order: 0 },
{ key: 'work.today.primary', mode: 'work', routeKey: 'today', label: 'Nächster Schritt', order: 0 },
{ key: 'work.today.actions', mode: 'work', routeKey: 'today', label: 'Arbeitspakete', order: 10 },
{ key: 'work.sprint.primary', mode: 'work', routeKey: 'sprint', label: 'Nächster Schritt', order: 0 },
{ key: 'work.sprint.backlog', mode: 'work', routeKey: 'sprint', label: 'Sprint-Backlog', order: 10 },
]
/**
@@ -68,6 +73,16 @@ export const COMPOSITION_SURFACES = {
routeKey: 'gates',
slotKeys: ['plan.gates.proposals'],
},
'work.today': {
mode: 'work',
routeKey: 'today',
slotKeys: ['work.today.primary', 'work.today.actions'],
},
'work.sprint': {
mode: 'work',
routeKey: 'sprint',
slotKeys: ['work.sprint.primary', 'work.sprint.backlog'],
},
}
/**