VAPP-22: Device notes: view and edit per-device notes on the detail page #24

Merged
David merged 2 commits from feat/device-notes-vapp-22 into main 2026-06-07 19:40:28 +02:00
Owner

VAPP-22: Device notes: view and edit per-device notes on the detail page

Adds a Notes card to the device detail Overview tab so operators can read and edit free-text notes for a device.

Changes

  • New server fns get_device_notes(device_id) and set_device_notes(device_id, notes) in src/server_fns/mod.rs, wrapping vervain-server's getnotes / setnotes over the control channel. Verified against the vervain-server dispatch (crates/meshcentral-web/src/user_session.rs): notes are stored as the raw string value of the nt<nodeid> companion doc with no base64 encoding, so the payload is passed through verbatim. getnotes replies with action getNotes and a nullable notes field; setnotes acks with for: "setNotes" and reuses the existing device_write_ack result mapping.
  • Notes card on the Overview tab (device_detail.rs): a textarea seeded once from get_device_notes, a Save button calling set_device_notes, a "Saved" badge (same pattern as the settings AccountCard), and inline error rendering. Notes load lazily with the tab via the existing per-tab use_resource pattern.

Acceptance criteria

  • Overview tab shows the device's saved notes
  • Editing and saving persists; the note survives a page reload (fetched fresh from the server on load)
  • Save shows a confirmation indicator and server errors render inline
  • Empty notes render as an empty editor, not an error (null/missing notes map to an empty string)
  • just check passes

🤖 Generated with Claude Code

## VAPP-22: Device notes: view and edit per-device notes on the detail page Adds a Notes card to the device detail Overview tab so operators can read and edit free-text notes for a device. ### Changes - New server fns `get_device_notes(device_id)` and `set_device_notes(device_id, notes)` in `src/server_fns/mod.rs`, wrapping vervain-server's `getnotes` / `setnotes` over the control channel. Verified against the vervain-server dispatch (`crates/meshcentral-web/src/user_session.rs`): notes are stored as the raw string `value` of the `nt<nodeid>` companion doc with no base64 encoding, so the payload is passed through verbatim. `getnotes` replies with action `getNotes` and a nullable `notes` field; `setnotes` acks with `for: "setNotes"` and reuses the existing `device_write_ack` result mapping. - Notes card on the Overview tab (`device_detail.rs`): a textarea seeded once from `get_device_notes`, a Save button calling `set_device_notes`, a "Saved" badge (same pattern as the settings AccountCard), and inline error rendering. Notes load lazily with the tab via the existing per-tab `use_resource` pattern. ### Acceptance criteria - [x] Overview tab shows the device's saved notes - [x] Editing and saving persists; the note survives a page reload (fetched fresh from the server on load) - [x] Save shows a confirmation indicator and server errors render inline - [x] Empty notes render as an empty editor, not an error (null/missing notes map to an empty string) - [x] `just check` passes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(device-detail): view and edit per-device notes
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 58s
0651548873
Add a Notes card to the device detail Overview tab so operators can read
and edit free-text notes for a device. New server fns get_device_notes /
set_device_notes wrap vervain-server's getnotes / setnotes over the
control channel (notes are stored as the raw string value of the nt<nodeid>
companion doc, no base64 encoding). The card lazily loads with the tab,
seeds the editor once, saves on demand with a "Saved" badge, renders server
errors inline, and shows empty notes as a blank editor rather than an error.

#VAPP-22
Merge branch 'main' into feat/device-notes-vapp-22
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / fmt + clippy + build + tests (pull_request) Successful in 1m28s
4f33f8565d
David merged commit 4b2d777929 into main 2026-06-07 19:40:28 +02:00
David deleted branch feat/device-notes-vapp-22 2026-06-07 19:40:28 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-apps!24
No description provided.