feat(steering): K-Ext-5 Portfolio-Kernel-Aggregation ueber Initiativen
Deploy Development / deploy (push) Successful in 48s
Test Suite / pytest-backend (push) Successful in 4m14s
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
Deploy Development / deploy (push) Successful in 48s
Test Suite / pytest-backend (push) Successful in 4m14s
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
GET /api/workspace/steering; Portfolio-Widget nutzt Kernel-Attention, Vorschlaege und Agent-Slots. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
390161e224
commit
b6434bcc50
11 files changed
+312
-7
No files matched your search
@@ -30,3 +30,7 @@ export function reorderPortfolio(initiativeIds) {
|
||||
body: JSON.stringify({ initiative_ids: initiativeIds }),
|
||||
})
|
||||
}
|
||||
|
||||
export function getPortfolioSteering(limit = 30) {
|
||||
return apiFetch(`/api/workspace/steering?limit=${limit}`)
|
||||
}
|
||||
@@ -1308,6 +1308,11 @@
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.initiative-portfolio-card-meta {
|
||||
margin: 0.5rem 0 0;
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
.initiative-journey-lead {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { getAttentionItems } from '../api/attention.js'
|
||||
import { listInitiatives } from '../api/initiatives.js'
|
||||
import { groupAttentionByInitiative } from '../utils/attentionSignals.js'
|
||||
import { InitiativePortfolioSignalChips } from '../components/InitiativePortfolioSignalChips.jsx'
|
||||
import { reorderPortfolio } from '../api/workspace.js'
|
||||
import { getPortfolioSteering, reorderPortfolio } from '../api/workspace.js'
|
||||
import { StatusBadge } from '../components/StatusBadge.jsx'
|
||||
import { PriorityBadge } from '../components/PriorityBadge.jsx'
|
||||
import { EmptyState } from '../components/EmptyState.jsx'
|
||||
@@ -24,6 +24,8 @@ export function InitiativePortfolioWidget() {
|
||||
const canManage = hasCapability('kairo.initiative.manage')
|
||||
const [initiatives, setInitiatives] = useState([])
|
||||
const [attentionByInitiative, setAttentionByInitiative] = useState({})
|
||||
const [proposalsByInitiative, setProposalsByInitiative] = useState({})
|
||||
const [agentSlotsByInitiative, setAgentSlotsByInitiative] = useState({})
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [busy, setBusy] = useState(false)
|
||||
const [error, setError] = useState(null)
|
||||
@@ -32,12 +34,25 @@ export function InitiativePortfolioWidget() {
|
||||
setLoading(true)
|
||||
setError(null)
|
||||
try {
|
||||
const [data, attention] = await Promise.all([
|
||||
const [data, steering] = await Promise.all([
|
||||
listInitiatives(),
|
||||
getAttentionItems().catch(() => []),
|
||||
getPortfolioSteering().catch(() => null),
|
||||
])
|
||||
setInitiatives(Array.isArray(data) ? data : [])
|
||||
setAttentionByInitiative(groupAttentionByInitiative(attention))
|
||||
if (steering?.attention_by_initiative) {
|
||||
setAttentionByInitiative(steering.attention_by_initiative)
|
||||
setProposalsByInitiative(
|
||||
Object.fromEntries(
|
||||
(steering.proposals_summary || []).map((row) => [row.initiative_id, row]),
|
||||
),
|
||||
)
|
||||
setAgentSlotsByInitiative(steering.agent_slots_by_initiative || {})
|
||||
} else {
|
||||
const attention = await getAttentionItems().catch(() => [])
|
||||
setAttentionByInitiative(groupAttentionByInitiative(attention))
|
||||
setProposalsByInitiative({})
|
||||
setAgentSlotsByInitiative({})
|
||||
}
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
} finally {
|
||||
@@ -98,6 +113,8 @@ export function InitiativePortfolioWidget() {
|
||||
<div className="initiative-portfolio-grid">
|
||||
{sortedInitiatives.map((item, index) => {
|
||||
const rankLabel = formatPortfolioRank(item.portfolio_rank ?? index)
|
||||
const proposalRow = proposalsByInitiative[item.id]
|
||||
const slotCount = (agentSlotsByInitiative[item.id] || []).length
|
||||
return (
|
||||
<article key={item.id} className="initiative-portfolio-card card">
|
||||
{canManage && (
|
||||
@@ -137,6 +154,17 @@ export function InitiativePortfolioWidget() {
|
||||
<InitiativePortfolioSignalChips
|
||||
signals={attentionByInitiative[item.id] || []}
|
||||
/>
|
||||
{(proposalRow?.total > 0 || slotCount > 0) && (
|
||||
<p className="initiative-portfolio-card-meta muted">
|
||||
{proposalRow?.total > 0 && (
|
||||
<span>{proposalRow.total} Steuerungsvorschlag{proposalRow.total === 1 ? '' : 'e'}</span>
|
||||
)}
|
||||
{proposalRow?.total > 0 && slotCount > 0 && ' · '}
|
||||
{slotCount > 0 && (
|
||||
<span>{slotCount} Agent-Slot{slotCount === 1 ? '' : 's'}</span>
|
||||
)}
|
||||
</p>
|
||||
)}
|
||||
</Link>
|
||||
</article>
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user