Kairo-Jinkendo/frontend/src/composition/useSteeringComposition.js
Lars 43d33d0edb
All checks were successful
Deploy Development / deploy (push) Successful in 47s
Test Suite / pytest-backend (push) Successful in 4m24s
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
feat(AP2.2b, UX): Linear E2E, Composition-Kernel und Steering-Paritaet
AP2.2b: Integrationstests Neue-Kueche-Happy-Path, Truth Table und Execution Plan abgeschlossen. UX Composition Kernel (Control/Plan/Cockpit-Slots), CriticalPathPanel aus Kernel-Read-Model mit Gate-Horizont, Next Action elementgesteuert ohne Snapshot-Doppelung, Product-Continuous-Copy und Plan/Arbeit ueber Kernel planning_debt.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 13:34:13 +02:00

66 lines
1.8 KiB
JavaScript

import { useMemo } from 'react'
import { useInitiativeOperations } from '../context/InitiativeOperationsContext.jsx'
import { resolveSteeringComposition } from './resolveSteeringComposition.js'
/**
* Hook: baut Composition-Input aus InitiativeOperationsContext.
* @param {string} surfaceKey
* @param {Record<string, unknown>} [options]
*/
export function useSteeringComposition(surfaceKey, options = {}) {
const ops = useInitiativeOperations()
const {
filterContext = options.filterContext || {},
scope = 'initiative',
} = options
const opsContext = useMemo(
() => ({
initiativeId: ops.initiativeId,
actions: ops.actions,
steeringSnapshotLoading: ops.steeringSnapshotLoading,
steeringSnapshotError: ops.steeringSnapshotError,
steeringMethods: ops.steeringMethods,
handleMethodChange: ops.handleMethodChange,
methodBusy: ops.methodBusy,
formBusy: ops.formBusy,
onAcceptBacklogProposal: options.onAcceptBacklogProposal,
}),
[
ops.initiativeId,
ops.actions,
ops.steeringSnapshotLoading,
ops.steeringSnapshotError,
ops.steeringMethods,
ops.handleMethodChange,
ops.methodBusy,
ops.formBusy,
options.onAcceptBacklogProposal,
],
)
return useMemo(
() =>
resolveSteeringComposition({
surfaceKey,
scope,
steeringElements: ops.steeringElements,
operatingContext: ops.operatingContext,
steeringSnapshot: ops.steeringSnapshot,
capabilities: ops.capabilities,
filterContext,
opsContext,
}),
[
surfaceKey,
scope,
ops.steeringElements,
ops.operatingContext,
ops.steeringSnapshot,
ops.capabilities,
filterContext,
opsContext,
],
)
}