From 912f9c5ed25be9f2caebbe7e4db7d252e6fa51a6 Mon Sep 17 00:00:00 2001 From: iris Date: Mon, 1 Jun 2026 20:29:43 +0200 Subject: [PATCH] =?UTF-8?q?feat(#1007):=20select-as-action=20=E2=80=94=20p?= =?UTF-8?q?icking=20a=20parent=20directly=20triggers=20M0V3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Selecting any option in the M0V3 dropdown now fires confirm+POST immediately; no separate button needed. On cancel or after the request completes, the select resets to the placeholder. Removes the now-redundant btn-move button and its CSS rule. --- frontend/packages/dashboard/src/dashboard.css | 4 +- frontend/packages/dashboard/src/tabs.js | 59 ++++++++----------- 2 files changed, 24 insertions(+), 39 deletions(-) diff --git a/frontend/packages/dashboard/src/dashboard.css b/frontend/packages/dashboard/src/dashboard.css index e10073be..2578cbdd 100644 --- a/frontend/packages/dashboard/src/dashboard.css +++ b/frontend/packages/dashboard/src/dashboard.css @@ -2520,6 +2520,4 @@ body.dashboard-shell.has-selection { padding-bottom: 4.5em; } opacity: 0.5; cursor: default; } -.move-picker .btn-move { - margin-left: 0; -} + diff --git a/frontend/packages/dashboard/src/tabs.js b/frontend/packages/dashboard/src/tabs.js index 1f55ca28..494ecb4d 100644 --- a/frontend/packages/dashboard/src/tabs.js +++ b/frontend/packages/dashboard/src/tabs.js @@ -933,33 +933,24 @@ window.marked = marked; disabledTitle: why('PURG3', managerNames.map((n) => `\`${n}\` is the manager`)), }); - // Move agent(s) in the topology tree — see - // docs/web-ui.md::Selection bar for the two affordances: + // Move agent(s) in the topology tree — selecting an option in the + // M0V3 dropdown immediately confirms + executes the move. "(no parent)" + // promotes to root (empty new_parent on the backend). Cycle-safe: + // dropdown filters out self and descendants on the client side; the + // backend rechecks via `topology::set_parent`. // - // ⇡ M0V3 → ROOT promote selected agent(s) to top-level (parent=null) - // ⇢ M0V3 → [sel] reparent the single selected agent under a picked - // parent (cycle-safe — the dropdown filters out self - // and own descendants on the client side; the - // backend rechecks via `topology::set_parent`). - // - // Backend lives at POST /api/topology/set-parent (dashboard.rs), - // form-encoded `child=&new_parent=`. The - // backend re-emits container snapshots on success, so the tree - // repaints without a separate refresh. + // Backend: POST /api/topology/set-parent (dashboard.rs), + // form-encoded `child=&new_parent=`. Re-emits + // container snapshots on success so the tree repaints without a + // separate refresh. addMoveActions(actions, selected, containers); } - // Render the M0V3 affordances inside the selection bar — separate - // helper because the picker variant needs a select + button pair, - // not the single-button shape addBulkButton ships. Backend - // `topology::set_parent` refuses moves it can't satisfy (manager - // included) and the refusal surfaces in the bulk-action error - // roll-up. + // Render the M0V3 picker in the selection bar. Selecting any real option + // (including "(no parent)") immediately fires a confirm + POST — no + // separate button. Backend `topology::set_parent` refuses invalid moves + // and the refusal surfaces in the alert roll-up. function addMoveActions(parent, selected, containers) { - // Unified M0V3 picker: a single `