Milestone 6: canvas for health and leaving

Devices report freshness per vault every 30 s (counts only); the canvas
shows current / behind / offline, held secrets in red, and a Nudge that
reaches the device at its next check-in. Notes kept in two versions can
be compared side by side and tidied on the hub's copy. Handovers are
reviewed in the vault panel; people can be removed from the team and
restored with a one-time link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 09:47:28 +07:00
parent 193cb06f85
commit 8be559817c
15 changed files with 744 additions and 57 deletions

View File

@@ -32,6 +32,19 @@ pub struct Me {
/// Vaults this device must leave (access ended).
#[serde(default)]
pub leaving: Vec<Departure>,
/// Someone asked this device to share now (Nudge).
#[serde(default)]
pub nudge: bool,
}
/// One vault's health, as a device reports it to the hub: counts only, never content.
#[derive(Debug, Serialize)]
pub struct VaultHealth {
pub vault_id: i64,
pub last_synced: Option<i64>,
pub waiting: usize,
pub held_secrets: usize,
pub holding: bool,
}
/// A vault this device has to hand over and leave (A6).
@@ -186,6 +199,11 @@ impl HubLink {
Ok(v["url"].as_str().unwrap_or_default().to_string())
}
pub fn report(&self, vaults: &[VaultHealth]) -> Result<()> {
let _: Value = self.post("/api/report", json!({ "vaults": vaults }))?;
Ok(())
}
pub fn remove(&self, person: &str, vault: &str, without_saving: bool) -> Result<usize> {
let v: Value = self.post("/api/remove", json!({"person": person, "vault": vault, "without_saving": without_saving}))?;
Ok(v["devices"].as_u64().unwrap_or(0) as usize)