AP0.10b: Steering UI Minimum — Next Actions, Heute, Snapshot v2
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 1m13s
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 15s
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Successful in 1m13s
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 15s
Workspace beantwortet die Leitfrage mit prominenten Next-Action- und Heute-Widgets sowie erweitertem Steuerungszustand pro Vorhaben. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
6ea663b4c4
commit
451d62ed46
20 files changed
+892
-21
No files matched your search
@@ -12,6 +12,10 @@ export function listWorkspaceBlockedActions() {
|
||||
return apiFetch('/api/workspace/actions/blocked')
|
||||
}
|
||||
|
||||
export function listWorkspaceTodayActions(limit = 15) {
|
||||
return apiFetch(`/api/workspace/actions/today?limit=${limit}`)
|
||||
}
|
||||
|
||||
export function listWorkspaceActiveInitiatives(limit = 5) {
|
||||
return apiFetch(`/api/workspace/initiatives/active?limit=${limit}`)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,20 @@
|
||||
import { PHASE_LABELS } from '../constants/operating.js'
|
||||
import { Link } from 'react-router-dom'
|
||||
import {
|
||||
PHASE_LABELS,
|
||||
PHASE_DESCRIPTIONS,
|
||||
SIGNAL_LABELS,
|
||||
NEXT_ACTION_KIND_LABELS,
|
||||
} from '../constants/operating.js'
|
||||
import { MILESTONE_STATUS_LABELS } from '../constants/status.js'
|
||||
|
||||
function formatDate(iso) {
|
||||
if (!iso) return '—'
|
||||
try {
|
||||
return new Date(iso).toLocaleDateString('de-DE')
|
||||
} catch {
|
||||
return iso
|
||||
}
|
||||
}
|
||||
|
||||
export function SteeringSnapshotPanel({ snapshot, loading, error }) {
|
||||
if (loading) {
|
||||
@@ -22,8 +38,15 @@ export function SteeringSnapshotPanel({ snapshot, loading, error }) {
|
||||
)
|
||||
}
|
||||
|
||||
const { operating_phase, phase_signals, counts } = snapshot
|
||||
const {
|
||||
operating_phase,
|
||||
phase_signals,
|
||||
counts,
|
||||
upcoming_milestones = [],
|
||||
next_actions = [],
|
||||
} = snapshot
|
||||
const phaseLabel = PHASE_LABELS[operating_phase] || operating_phase
|
||||
const phaseDesc = PHASE_DESCRIPTIONS[operating_phase] || ''
|
||||
|
||||
return (
|
||||
<section className="card steering-snapshot">
|
||||
@@ -31,11 +54,54 @@ export function SteeringSnapshotPanel({ snapshot, loading, error }) {
|
||||
<h2>Steuerungszustand</h2>
|
||||
<span className="badge status-badge status-active">{phaseLabel}</span>
|
||||
</div>
|
||||
|
||||
{phaseDesc && <p className="steering-phase-desc">{phaseDesc}</p>}
|
||||
|
||||
{phase_signals?.length > 0 && (
|
||||
<p className="muted snapshot-signals">
|
||||
Signale: {phase_signals.join(' · ')}
|
||||
{phase_signals.map((s) => SIGNAL_LABELS[s] || s).join(' · ')}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{next_actions.length > 0 && (
|
||||
<div className="steering-next-actions">
|
||||
<h3>Nächste Schritte für dieses Vorhaben</h3>
|
||||
<ol className="item-list compact-list">
|
||||
{next_actions.map((item, i) => (
|
||||
<li key={`${item.kind}-${i}`} className="list-item card-list-item compact">
|
||||
<div className="list-item-main">
|
||||
<span className="next-action-rank">{i + 1}</span>
|
||||
<strong>{item.title}</strong>
|
||||
<span className="muted list-item-sub">
|
||||
{NEXT_ACTION_KIND_LABELS[item.kind] || item.kind}
|
||||
{item.recommended_action ? ` — ${item.recommended_action}` : ''}
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{upcoming_milestones.length > 0 && (
|
||||
<div className="steering-milestones">
|
||||
<h3>Meilenstein-Horizont</h3>
|
||||
<ul className="item-list compact-list">
|
||||
{upcoming_milestones.map((ms) => (
|
||||
<li key={ms.id} className="list-item card-list-item compact">
|
||||
<div className="list-item-main">
|
||||
<strong>{ms.title}</strong>
|
||||
<span className="muted list-item-sub">
|
||||
{MILESTONE_STATUS_LABELS[ms.status] || ms.status}
|
||||
{ms.target_date ? ` · Ziel: ${formatDate(ms.target_date)}` : ''}
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<dl className="snapshot-counts">
|
||||
<div>
|
||||
<dt>Offene Maßnahmen</dt>
|
||||
@@ -62,8 +128,9 @@ export function SteeringSnapshotPanel({ snapshot, loading, error }) {
|
||||
</div>
|
||||
)}
|
||||
</dl>
|
||||
|
||||
<p className="muted snapshot-hint">
|
||||
Kanonischer Operating Cycle — noch heuristisch, später methodengeführt über Steering Core.
|
||||
Heuristischer Steuerungszustand — später methodengeführt über Steering Core.
|
||||
</p>
|
||||
</section>
|
||||
)
|
||||
|
||||
@@ -21,3 +21,48 @@ export const PHASE_LABELS = {
|
||||
adapt: 'Anpassung',
|
||||
closure: 'Abschluss',
|
||||
}
|
||||
|
||||
export const PHASE_DESCRIPTIONS = {
|
||||
capture: 'Ideen und Eingänge erfassen — noch wenig strukturierte Arbeit.',
|
||||
triage: 'Backlog wartet auf Commit — noch keine offene nächste Maßnahme.',
|
||||
structure: 'Vorhaben braucht Struktur — keine offene Maßnahme, Backlog leer.',
|
||||
commit: 'Maßnahmen committen und zuweisen.',
|
||||
execute: 'Aktive Umsetzung — offene Maßnahmen oder Blocker bearbeiten.',
|
||||
verify: 'Nachweise und Ergebnisse belegen.',
|
||||
review: 'Reviews oder Maßnahmen mit Review-Status klären.',
|
||||
adapt: 'Anpassen — Backlog, Meilensteine oder Prioritäten prüfen.',
|
||||
closure: 'Vorhaben abgeschlossen oder archiviert.',
|
||||
}
|
||||
|
||||
export const SIGNAL_LABELS = {
|
||||
initiative_terminal: 'Vorhaben abgeschlossen',
|
||||
backlog_awaiting_commit: 'Backlog wartet auf Maßnahme',
|
||||
no_open_work: 'Keine offene Arbeit',
|
||||
actions_blocked: 'Maßnahmen blockiert',
|
||||
open_blockers: 'Offene Blocker',
|
||||
actions_need_review: 'Maßnahmen brauchen Review',
|
||||
reviews_due: 'Reviews fällig',
|
||||
work_in_progress: 'Arbeit in Umsetzung',
|
||||
}
|
||||
|
||||
export const NEXT_ACTION_KIND_LABELS = {
|
||||
resolve_blocker: 'Blocker klären',
|
||||
assign_action: 'Maßnahme zuweisen',
|
||||
convert_backlog: 'Backlog umwandeln',
|
||||
create_action: 'Maßnahme anlegen',
|
||||
review_milestone: 'Meilenstein prüfen',
|
||||
}
|
||||
|
||||
export const ATTENTION_KIND_LABELS = {
|
||||
blocked_action: 'Blockierte Maßnahme',
|
||||
open_blocker: 'Offener Blocker',
|
||||
high_priority_action: 'High Priority',
|
||||
unassigned_action: 'Ohne Zuweisung',
|
||||
initiative_without_next_action: 'Keine nächste Maßnahme',
|
||||
stale_initiative: 'Inaktives Vorhaben',
|
||||
milestone_at_risk: 'Meilenstein gefährdet',
|
||||
overdue_action: 'Überfällig',
|
||||
review_due: 'Review fällig',
|
||||
recurring_due: 'Wiederkehrend fällig',
|
||||
action_review_required: 'Review ausstehend',
|
||||
}
|
||||
@@ -38,7 +38,7 @@ export function WorkspacePage() {
|
||||
<header className="page-header">
|
||||
<div>
|
||||
<h1>Workspace</h1>
|
||||
<p className="page-lead">Dein Überblick über Vorhaben und Maßnahmen.</p>
|
||||
<p className="page-lead">Was ist dein nächster sinnvoller Schritt?</p>
|
||||
</div>
|
||||
{hasCapability('kairo.initiative.manage') && (
|
||||
<button
|
||||
|
||||
@@ -11,6 +11,8 @@ describe('widgetRegistry', () => {
|
||||
expect(keys).toContain('kairo.blocked_actions')
|
||||
expect(keys).toContain('kairo.tenant_context')
|
||||
expect(keys).toContain('kairo.workspace_summary')
|
||||
expect(keys).toContain('kairo.next_actions')
|
||||
expect(keys).toContain('kairo.workspace_today')
|
||||
expect(keys).toContain('kairo.attention')
|
||||
})
|
||||
|
||||
@@ -20,7 +22,7 @@ describe('widgetRegistry', () => {
|
||||
'kairo.initiative.read',
|
||||
'kairo.workspace.read',
|
||||
])
|
||||
expect(all.length).toBe(6)
|
||||
expect(all.length).toBe(8)
|
||||
|
||||
const readOnly = getWidgetsForArea('workspace', ['kairo.initiative.read'])
|
||||
expect(readOnly.some((w) => w.key === 'kairo.my_open_actions')).toBe(false)
|
||||
|
||||
@@ -4,6 +4,8 @@ import { BlockedActionsWidget } from '../widgets/BlockedActionsWidget.jsx'
|
||||
import { TenantContextWidget } from '../widgets/TenantContextWidget.jsx'
|
||||
import { WorkspaceSummaryWidget } from '../widgets/WorkspaceSummaryWidget.jsx'
|
||||
import { AttentionWidget } from '../widgets/AttentionWidget.jsx'
|
||||
import { NextActionWidget } from '../widgets/NextActionWidget.jsx'
|
||||
import { WorkspaceTodayWidget } from '../widgets/WorkspaceTodayWidget.jsx'
|
||||
|
||||
/** @typedef {import('react').ComponentType<any>} WidgetComponent */
|
||||
|
||||
@@ -28,6 +30,24 @@ export const WIDGETS = [
|
||||
defaultOrder: 0,
|
||||
component: TenantContextWidget,
|
||||
},
|
||||
{
|
||||
key: 'kairo.next_actions',
|
||||
title: 'Nächste Schritte',
|
||||
description: 'Regelbasierte NextAction-Empfehlungen',
|
||||
area: 'workspace',
|
||||
requiredCapability: 'kairo.workspace.read',
|
||||
defaultOrder: 2,
|
||||
component: NextActionWidget,
|
||||
},
|
||||
{
|
||||
key: 'kairo.workspace_today',
|
||||
title: 'Heute',
|
||||
description: 'Meine Maßnahmen — überfällig zuerst',
|
||||
area: 'workspace',
|
||||
requiredCapability: 'kairo.workspace.read',
|
||||
defaultOrder: 4,
|
||||
component: WorkspaceTodayWidget,
|
||||
},
|
||||
{
|
||||
key: 'kairo.workspace_summary',
|
||||
title: 'Überblick',
|
||||
@@ -52,7 +72,7 @@ export const WIDGETS = [
|
||||
description: 'Offene Maßnahmen, die mir zugewiesen sind',
|
||||
area: 'workspace',
|
||||
requiredCapability: 'kairo.action.read',
|
||||
defaultOrder: 10,
|
||||
defaultOrder: 25,
|
||||
component: MyOpenActionsWidget,
|
||||
},
|
||||
{
|
||||
@@ -61,7 +81,7 @@ export const WIDGETS = [
|
||||
description: 'Mir zugewiesene blockierte Maßnahmen',
|
||||
area: 'workspace',
|
||||
requiredCapability: 'kairo.action.read',
|
||||
defaultOrder: 20,
|
||||
defaultOrder: 35,
|
||||
component: BlockedActionsWidget,
|
||||
},
|
||||
{
|
||||
@@ -70,7 +90,7 @@ export const WIDGETS = [
|
||||
description: 'Aktive und pausierte Vorhaben im Tenant',
|
||||
area: 'workspace',
|
||||
requiredCapability: 'kairo.initiative.read',
|
||||
defaultOrder: 30,
|
||||
defaultOrder: 40,
|
||||
component: InitiativesWidget,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -629,6 +629,55 @@
|
||||
margin: 0.75rem 0 0;
|
||||
}
|
||||
|
||||
.steering-phase-desc {
|
||||
margin: 0.5rem 0 0;
|
||||
color: var(--jk-text);
|
||||
}
|
||||
|
||||
.steering-next-actions,
|
||||
.steering-milestones {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.steering-next-actions h3,
|
||||
.steering-milestones h3 {
|
||||
margin: 0 0 0.5rem;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.compact-list .list-item.compact {
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
.next-action-list {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.next-action-rank {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 1.35rem;
|
||||
height: 1.35rem;
|
||||
border-radius: 999px;
|
||||
background: var(--jk-surface-raised, #f3f4f6);
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
margin-right: 0.35rem;
|
||||
}
|
||||
|
||||
.next-action-kind {
|
||||
font-size: 0.75rem;
|
||||
margin-right: 0.35rem;
|
||||
}
|
||||
|
||||
.recommended-action {
|
||||
color: var(--jk-accent, #2563eb);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.action-links {
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
@@ -6,6 +6,8 @@ import { LoadingState } from '../components/LoadingState.jsx'
|
||||
import { WidgetCard } from '../components/WidgetCard.jsx'
|
||||
import { EmptyState } from '../components/EmptyState.jsx'
|
||||
|
||||
import { ATTENTION_KIND_LABELS } from '../constants/operating.js'
|
||||
|
||||
const SEVERITY_LABELS = {
|
||||
critical: 'Kritisch',
|
||||
warning: 'Warnung',
|
||||
@@ -69,6 +71,9 @@ export function AttentionWidget() {
|
||||
<span className={`attention-severity attention-severity--${item.severity}`}>
|
||||
{SEVERITY_LABELS[item.severity] || item.severity}
|
||||
</span>
|
||||
<span className="muted list-item-sub attention-kind">
|
||||
{ATTENTION_KIND_LABELS[item.kind] || item.kind}
|
||||
</span>
|
||||
<strong>{item.title}</strong>
|
||||
{item.summary && <p className="list-item-desc muted">{item.summary}</p>}
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
import { useCallback, useEffect, useState } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { getNextActionCandidates } from '../api/attention.js'
|
||||
import { NEXT_ACTION_KIND_LABELS } from '../constants/operating.js'
|
||||
import { EmptyState } from '../components/EmptyState.jsx'
|
||||
import { ErrorState } from '../components/ErrorState.jsx'
|
||||
import { LoadingState } from '../components/LoadingState.jsx'
|
||||
import { WidgetCard } from '../components/WidgetCard.jsx'
|
||||
|
||||
export function NextActionWidget() {
|
||||
const [items, setItems] = useState([])
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [error, setError] = useState(null)
|
||||
|
||||
const load = useCallback(async () => {
|
||||
setLoading(true)
|
||||
setError(null)
|
||||
try {
|
||||
const data = await getNextActionCandidates(5)
|
||||
setItems(Array.isArray(data) ? data : [])
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
load()
|
||||
}, [load])
|
||||
|
||||
return (
|
||||
<WidgetCard
|
||||
title="Nächste sinnvolle Schritte"
|
||||
subtitle="Was bringt deine Vorhaben jetzt am wirksamsten voran?"
|
||||
className="widget-card--span-full"
|
||||
actions={
|
||||
<button type="button" className="btn btn-ghost" onClick={load} disabled={loading}>
|
||||
Aktualisieren
|
||||
</button>
|
||||
}
|
||||
>
|
||||
{loading && <LoadingState />}
|
||||
{!loading && error && <ErrorState message={error} onRetry={load} />}
|
||||
{!loading && !error && items.length === 0 && (
|
||||
<EmptyState message="Keine Empfehlungen — entweder alles erledigt oder noch nichts zu steuern." />
|
||||
)}
|
||||
{!loading && !error && items.length > 0 && (
|
||||
<ol className="item-list next-action-list">
|
||||
{items.map((item, index) => (
|
||||
<li key={`${item.kind}-${item.initiative_id}-${item.action_id || item.backlog_item_id || index}`} className="list-item card-list-item">
|
||||
<div className="list-item-main">
|
||||
<span className="next-action-rank">{index + 1}</span>
|
||||
<span className="badge status-badge status-active next-action-kind">
|
||||
{NEXT_ACTION_KIND_LABELS[item.kind] || item.kind}
|
||||
</span>
|
||||
<strong>{item.title}</strong>
|
||||
{item.summary && <p className="list-item-desc muted">{item.summary}</p>}
|
||||
{item.recommended_action && (
|
||||
<p className="list-item-sub recommended-action">
|
||||
→ {item.recommended_action}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="list-item-meta">
|
||||
{item.initiative_id && (
|
||||
<Link to={`/initiatives/${item.initiative_id}`} className="btn btn-primary btn-sm">
|
||||
Zum Vorhaben
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
)}
|
||||
</WidgetCard>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
import { useCallback, useEffect, useState } from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { listWorkspaceTodayActions } from '../api/workspace.js'
|
||||
import { StatusBadge } from '../components/StatusBadge.jsx'
|
||||
import { PriorityBadge } from '../components/PriorityBadge.jsx'
|
||||
import { EmptyState } from '../components/EmptyState.jsx'
|
||||
import { ErrorState } from '../components/ErrorState.jsx'
|
||||
import { LoadingState } from '../components/LoadingState.jsx'
|
||||
import { WidgetCard } from '../components/WidgetCard.jsx'
|
||||
|
||||
function formatDue(iso) {
|
||||
if (!iso) return null
|
||||
try {
|
||||
return new Date(iso).toLocaleString('de-DE', {
|
||||
day: '2-digit',
|
||||
month: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
})
|
||||
} catch {
|
||||
return iso
|
||||
}
|
||||
}
|
||||
|
||||
export function WorkspaceTodayWidget() {
|
||||
const [actions, setActions] = useState([])
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [error, setError] = useState(null)
|
||||
|
||||
const load = useCallback(async () => {
|
||||
setLoading(true)
|
||||
setError(null)
|
||||
try {
|
||||
const data = await listWorkspaceTodayActions(10)
|
||||
setActions(Array.isArray(data) ? data : [])
|
||||
} catch (err) {
|
||||
setError(err.message)
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
load()
|
||||
}, [load])
|
||||
|
||||
return (
|
||||
<WidgetCard
|
||||
title="Heute"
|
||||
subtitle="Deine Maßnahmen — überfällig und dringend zuerst"
|
||||
actions={
|
||||
<button type="button" className="btn btn-ghost" onClick={load} disabled={loading}>
|
||||
Aktualisieren
|
||||
</button>
|
||||
}
|
||||
footer={
|
||||
actions.length > 0 ? (
|
||||
<Link to="/my-actions" className="link-inline">
|
||||
Alle meine Maßnahmen →
|
||||
</Link>
|
||||
) : null
|
||||
}
|
||||
>
|
||||
{loading && <LoadingState />}
|
||||
{!loading && error && <ErrorState message={error} onRetry={load} />}
|
||||
{!loading && !error && actions.length === 0 && (
|
||||
<EmptyState message="Keine Maßnahmen für heute — prüfe „Nächste sinnvolle Schritte“ oben." />
|
||||
)}
|
||||
{!loading && !error && actions.length > 0 && (
|
||||
<ul className="item-list">
|
||||
{actions.map((action) => (
|
||||
<li key={action.id} className="list-item card-list-item">
|
||||
<div className="list-item-main">
|
||||
{action.is_overdue && (
|
||||
<span className="badge status-badge status-blocked">Überfällig</span>
|
||||
)}
|
||||
<strong>{action.title}</strong>
|
||||
{action.initiative_title && (
|
||||
<span className="muted list-item-sub">{action.initiative_title}</span>
|
||||
)}
|
||||
{action.due_at && (
|
||||
<span className="muted list-item-sub">Fällig: {formatDue(action.due_at)}</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="list-item-meta">
|
||||
<StatusBadge status={action.status} />
|
||||
<PriorityBadge priority={action.priority} />
|
||||
<Link to={`/initiatives/${action.initiative_id}`} className="btn btn-secondary btn-sm">
|
||||
Öffnen
|
||||
</Link>
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</WidgetCard>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user