fix(ui): Steuerungszustand sichtbar auch bei Lade-/API-Fehler
Deploy Development / deploy (push) Successful in 46s
Test Suite / pytest-backend (push) Failing after 1m12s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped

Vorher wurde das Panel bei fehlendem Snapshot komplett ausgeblendet.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-07-05 15:36:15 +02:00
1 parent e25ff86420
commit 1b19deb728
2 files changed
+40 -6

No files matched your search

+19 -4
View File
@@ -91,6 +91,8 @@ export function InitiativeDetailPage() {
const [reviews, setReviews] = useState([])
const [recurringItems, setRecurringItems] = useState([])
const [steeringSnapshot, setSteeringSnapshot] = useState(null)
const [steeringSnapshotLoading, setSteeringSnapshotLoading] = useState(false)
const [steeringSnapshotError, setSteeringSnapshotError] = useState(null)
const [loading, setLoading] = useState(true)
const [error, setError] = useState(null)
const [showActionForm, setShowActionForm] = useState(false)
@@ -123,9 +125,18 @@ export function InitiativeDetailPage() {
loads.push(listInitiativeReviews(id).then(setReviews).catch(() => setReviews([])))
loads.push(listInitiativeRecurring(id).then(setRecurringItems).catch(() => setRecurringItems([])))
loads.push(
getInitiativeSteeringSnapshot(id)
.then(setSteeringSnapshot)
.catch(() => setSteeringSnapshot(null))
(async () => {
setSteeringSnapshotLoading(true)
setSteeringSnapshotError(null)
try {
setSteeringSnapshot(await getInitiativeSteeringSnapshot(id))
} catch (err) {
setSteeringSnapshot(null)
setSteeringSnapshotError(err.message || 'Snapshot fehlgeschlagen')
} finally {
setSteeringSnapshotLoading(false)
}
})()
)
}
await Promise.all(loads)
@@ -483,7 +494,11 @@ export function InitiativeDetailPage() {
{error && <p className="error">{error}</p>}
{capabilities.has('kairo.initiative.read') && (
<SteeringSnapshotPanel snapshot={steeringSnapshot} />
<SteeringSnapshotPanel
snapshot={steeringSnapshot}
loading={steeringSnapshotLoading}
error={steeringSnapshotError}
/>
)}
<section className="card">