diff --git a/frontend/src/client/admin-approval-policies.ts b/frontend/src/client/admin-approval-policies.ts index bb66ee5..ae48a5e 100644 --- a/frontend/src/client/admin-approval-policies.ts +++ b/frontend/src/client/admin-approval-policies.ts @@ -208,12 +208,19 @@ function renderUnitMatrix(unit: PartnerUnit): string { function renderUnits(): void { const host = document.getElementById("ap-units-list"); if (!host) return; + // Preserve which unit blocks were expanded across re-renders. Without this, + // changing any cell's required_role saves and re-renders, collapsing the + // accordion the admin was working in (m, 2026-05-08). + const openUnitIDs = new Set(); + host.querySelectorAll("details.ap-unit-block").forEach((d) => { + if (d.open && d.dataset.unitId) openUnitIDs.add(d.dataset.unitId); + }); if (partnerUnits.length === 0) { host.innerHTML = `

${esc(t("admin.approval_policies.units.empty") || "Keine Partner Units vorhanden.")}

`; return; } host.innerHTML = partnerUnits.map((u) => ` -
+
${esc(u.name)} ${esc(u.office)}