feat(device-detail): rename, delete, move devices (VAPP-9) #15
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/device-management-actions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements VAPP-9: device management (rename, delete, move to mesh) from the web UI.
What
The device detail header gains an overflow (...) menu with Rename, Move to mesh, and Delete. Each opens a modal dialog and writes over the existing
/control.ashxcontrol channel, surfacing the server's ack result inline.src/server_fns/mod.rs):rename_device,remove_device,move_device, each one control-channel action plus ack. A shareddevice_write_ackhelper maps every non-okackresult(not-authorized,not-found,bad-name,mtype-mismatch, ...) to a human message. Verbs and ackforfields were verified against vervain-server'suser_session.rshandlers (noteeditdeviceacks aschangedevice, and delete usesremovedevices).use_server_futurerestart.list_meshes(the device's current mesh is excluded); refreshes the header on success./devices.control.rs:REQUEST_TIMEOUTmadepubso the write helper reuses the standard round-trip ceiling.models:MeshderivesPartialEq/Eq(component prop).main.cssaddsvc-btn-dangerand a disabled-button style.Tags and notes are intentionally out of scope per the issue.
Acceptance criteria
get_device)not-authorizedack -> inline error)Checks
cargo check --features server,cargo check --target wasm32-unknown-unknown,cargo clippy --all-targets --features server -- -D warnings,cargo fmt --check, andcargo test --features server --bin vervain-appall pass.🤖 Generated with Claude Code
Add the write path for device management. The detail header gains an overflow (...) menu with Rename, Move to mesh, and Delete, each opening a modal that surfaces the control-channel ack result inline so a user without mesh rights sees the "not-authorized" error instead of a silent no-op. - Three new server fns in server_fns/mod.rs: rename_device (changedevice verb), remove_device (single-node removedevices), move_device (changeDeviceMesh). A shared device_write_ack helper sends the action, awaits the {action:"ack",for:<verb>,result:...} envelope, and maps every non-"ok" result (not-authorized, not-found, bad-name, mtype-mismatch, ...) to a human message. Verbs and ack "for" fields verified against vervain-server's user_session.rs handlers (editdevice acks as changedevice). - control.rs: REQUEST_TIMEOUT is now pub so the write helper can reuse the standard round-trip ceiling. - Rename uses an inline text prompt; Move is a select fed by list_meshes (the device's current mesh is excluded); Delete is a typed-confirmation dialog (the Delete button stays disabled until the typed text matches the device name exactly). Rename and Move restart the header's use_server_future so the new name/mesh show without a manual reload; Delete navigates back to /devices. - models: Mesh derives PartialEq/Eq so it can ride as a component prop. main.css gains vc-btn-danger and a disabled-button style. - Tags and notes stay out of scope per the issue; they ride different doc fields and can follow once the basic write path is proven. #VAPP-9 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Resolved the merge conflict with main: PR #17's PowerActions component and this PR's management overflow menu both rewrote the device-detail header action cluster. Resolution keeps PowerActions (Wake, Power dropdown, Remote desktop) and appends the overflow menu beside it; the management dialogs block is unchanged. Verified post-merge against a live vervain-server with an enrolled agent: header renders both feature sets, and rename / move-to-mesh / delete all round-tripped (name change and mesh move confirmed via meshctrl, delete left 0 nodes). just check clean.