From 4297436d94dfc7e73b7d305f79c63b51b092fe17 Mon Sep 17 00:00:00 2001 From: iris Date: Wed, 17 Jun 2026 17:53:03 +0200 Subject: [PATCH] dashboard: single save-all button for the permissions page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the per-row save buttons on the P3RM1SS10NS tab with one page-level "save all (N agents)" button covering both the capabilities and tool-groups matrices. Toggling cells stages edits in the DOM; each checkbox carries its render-time baseline (data-baseline). On save we diff against the baseline and POST only the perm-types that actually changed per agent to the new combined endpoint: POST /api/permissions { changes: [ { agent, tool_groups?, capabilities? } ] } An omitted field leaves that perm-type untouched (no commit, no diff); an included array fully replaces it. The backend coalesces caps + groups for one agent into a single rebuild — no more double-rebuild when an operator changes both for the same agent. The batch is atomic: on a clean 200 the bar shows queued -> rebuilding and re-fetches (resetting baselines); on any validation error nothing is applied and an error note is shown. Live capabilities_changed / tool_groups_changed re-renders are skipped while the section has unsaved edits so a half-finished edit set is not clobbered; the tab-activation and post-save re-fetches are the recovery paths. Pairs with the hive-c0re combined-PermPayload half (damocles). --- frontend/packages/dashboard/src/dashboard.css | 34 ++- .../packages/dashboard/src/dashboard.html | 22 +- .../packages/dashboard/src/permissions.js | 241 ++++++++++++------ frontend/packages/dashboard/src/tabs.js | 2 + 4 files changed, 208 insertions(+), 91 deletions(-) diff --git a/frontend/packages/dashboard/src/dashboard.css b/frontend/packages/dashboard/src/dashboard.css index 5b688269..8dda2a6d 100644 --- a/frontend/packages/dashboard/src/dashboard.css +++ b/frontend/packages/dashboard/src/dashboard.css @@ -804,9 +804,6 @@ footer .banner-thin { .cap-col { min-width: 5em; } -.cap-save-col { - min-width: 4em; -} .cap-agent-name { color: var(--fg); font-weight: 600; @@ -817,11 +814,6 @@ footer .banner-thin { height: 1em; accent-color: var(--purple); } -.cap-save-btn { - font-size: 0.78em; - padding: 0.2em 0.6em; - white-space: nowrap; -} .cap-row:hover td { background: var(--bg-elev); } @@ -837,12 +829,34 @@ footer .banner-thin { .tg-table thead th { background: var(--bg-elev); color: var(--muted); letter-spacing: 0.05em; white-space: nowrap; } .tg-agent-col { text-align: left !important; min-width: 8em; } .tg-group-col { min-width: 5em; } -.tg-save-col { min-width: 4em; } .tg-agent-name { color: var(--fg); font-weight: 600; } .tg-cb { cursor: pointer; width: 1em; height: 1em; accent-color: var(--purple); } -.tg-save-btn { font-size: 0.78em; padding: 0.2em 0.6em; white-space: nowrap; } .tg-row:hover td { background: var(--bg-elev); } +/* ─── permissions save bar (save-all) ────────────────────────────── + One page-level save button for the whole P3RM1SS10NS tab. Sticks to + the bottom of the pane so it stays reachable while scrolling a long + agent×perm matrix. Disabled (dim) until an edit makes the page dirty; + the (N agents) count in the label reflects how many agents will + rebuild. `#perm-save-note` carries the transient rebuilding/error + line beside it. */ +.perm-save-bar { + position: sticky; + bottom: 0; + display: flex; + align-items: center; + gap: 0.8em; + margin-top: 1em; + padding: 0.7em 0; + background: var(--bg); + border-top: 1px solid var(--border); +} +.perm-save-bar .btn:disabled { + opacity: 0.45; + cursor: not-allowed; +} +.perm-save-err { color: var(--red); } + /* ─── scheduled prompts tab ──────────────────────────────────────── Creation form at the top, list of queued schedule cards below. */ diff --git a/frontend/packages/dashboard/src/dashboard.html b/frontend/packages/dashboard/src/dashboard.html index fe8546d2..91e38517 100644 --- a/frontend/packages/dashboard/src/dashboard.html +++ b/frontend/packages/dashboard/src/dashboard.html @@ -153,22 +153,36 @@ role="tabpanel" aria-labelledby="tab-permissions">

◆ C4P4B1L1T13S ◆

══════════════════════════════════════════════════════════════
-

per-agent capability grants. capabilities unlock gated MCP tools and system access. saving queues a rebuild for the affected agent.

+

per-agent capability grants. capabilities unlock gated MCP tools and system access. toggle any cells across both tables, then hit "save all" at the bottom — each changed agent rebuilds exactly once.

loading…

◆ T00L GR0UPS ◆

══════════════════════════════════════════════════════════════
-

per-agent tool-group permissions. columns are filled from the backend — adding a new group requires no UI change. agents without an explicit entry use the role default (agents: messaging, meta, inbox, execution; manager: all). saving queues a rebuild.

+

per-agent tool-group permissions. columns are filled from the backend — adding a new group requires no UI change. agents without an explicit entry use the role default (agents: messaging, meta, inbox, execution).

loading…

+ + +
+ + +