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

@@ -153,40 +153,38 @@ Only the current milestone gets detailed below. The next one is detailed when th
---
## 6. Milestone 5 — Canvas for access
## 6. Milestone 6 — Canvas for health and leaving
Milestones 1–4 (sync, safety checks, the hub, taking access back) are built; their detail lives in the code and tests now. The canvas follows Sen's clickable prototype (team canvas artboard) and the X decisions.
Milestones 1–5 (sync, safety checks, the hub, taking access back, the canvas for access) are built; their detail lives in the code and tests now.
### Goal
The hub serves a web canvas where access is managed by touch: drag a vault onto a person to grant, pull a ribbon until it snaps to revoke (with Undo), and every gesture has a button in the details panel. Invites and device labels live here too.
Before you need someone's work, you can see whether it has reached the team, and ask for it. Everything that needs a human decision — a note changed in two places, a handover, removing someone from the team — can be done on the canvas, including from a phone.
### What Sen does
```bash
lunesync open # opens the canvas in the browser, already signed in
```
Or on a phone / another browser: open the hub's address, type a code from `lunesync pair`.
On the canvas: drag DevOps onto Alice (she gets Edit; change the role in the panel), pull the dot on a ribbon until it pinches and snaps (Undo for 8 s), **Invite person** (name + vaults → a one-time link to copy), rename or remove a device in a person's panel, switch **Float** / **Dock**, create a vault (owner), turn "delete from their devices" on or off per vault.
### What Sen does (on the canvas)
- Sees each person ringed by freshness and each device dotted the same way: green current, amber behind, grey offline (X6). A red dot means a possible secret was held back on that device.
- Opens a behind device: "4 changes not shared · 2 days" → **Nudge**.
- A vault shows "1 note to tidy" → **Compare** shows both versions side by side → keep one, or keep both.
- A vault shows a handover → see which notes it changes → **Keep** / **Discard**. A device that never came back → **Delete without saving**.
- A person → **Remove from team** (owner, asks to confirm, says how much unshared work will come back first). A removed person stays visible to the owner, dimmed, with **Restore** (gives a one-time sign-in link).
### Behavior
- **Sign-in (decided, §8)**: no passwords. `lunesync open` makes a one-time sign-in link (2 minutes) from a signed-in device; or type a pairing code on the hub's sign-in page. The session cookie lasts 30 days (HttpOnly, SameSite=Strict, Secure on HTTPS); signing out, or removal from the team, ends it. The canvas acts as the person ("Sen (web)" in the access log), never as a device: it holds no vault content.
- **What you see**: the owner sees every vault and person; others see the vaults they're in. Everyone sees the team's people (to grant). Devices are visible to their owner, the team owner, and managers of a vault the person is in. Gestures only work on vaults you manage.
- **Grant** = drop a vault on a person (Edit). Dropping on an invited person who hasn't joined yet adds it to their invite. No confirmation (X2).
- **Revoke** = pull a ribbon's dot until it snaps. The ribbon disappears and an 8 s Undo toast shows; the hub holds the removal until the window passes, so nothing reaches the person's devices before then. Then the M4 flow runs (handover, delete).
- **Panels (X1, X3, X11)**: overview (vaults, people, recent activity for the owner), vault (members with role and Remove, Give access, the delete-from-devices setting), person (devices: rename, remove; vaults). Back navigation remembers where a panel was opened from. Bottom sheet on phones.
- **Look**: X4–X8 as in the prototype — metaball ribbons with the goo filter, identity colors fading vault→person, focus with veils, Float (shared bobbing clock) and Dock, reduced motion respected. Status colors stay unused until M6.
- **Invite link in a browser** shows how to join (`lunesync join <link> --name …`) instead of an error.
- The hub serves the canvas itself (built into the binary); nothing else to deploy.
- **Health reports**: while `lunesync run` is going, each device tells the hub every ~30 s, per vault: when it last synced, how many changes are waiting, and whether something is held (a big change, or a possible secret — counts only, never content). The hub knows work exists, not what it is.
- **Freshness**: current = reported in the last 2 minutes with nothing waiting; behind = something waiting or held; offline = not heard from in 2 minutes (shown with when it was last seen). A person's ring shows their worst device.
- **Nudge** reaches the device on its next check-in (~30 s): it saves what has settled and syncs at once. If something is held, the panel says so instead of pretending a nudge will help.
- **Tidy on the canvas** reads the two versions from the hub's copy of the vault (members only; Edit to decide). Keeping one, or both as separate notes, is a normal change on the hub that every device receives — same outcome as `lunesync tidy keep`.
- **Handovers on the canvas** are the M4 review (show / keep / discard / delete without saving), shown in the vault and person panels.
- **Remove from team / Restore** are the M4 flows; this is the only gesture on the canvas that asks for confirmation (X2).
- Status colors are used only for status; red only for a held secret (X6).
### Acceptance — Sen acts this out
1. `lunesync open` → the canvas, signed in. A phone signs in with a code.
2. Drag a vault onto a teammate: the vault arrives on their devices. Change their role in the panel.
3. Pull a ribbon until it snaps, press Undo: nothing changed on their devices. Pull again and wait: the M4 removal runs.
4. Invite a person with a vault; they join from the link; they appear on the canvas with their device.
5. Rename and remove a device from the panel; switch Float/Dock; everything works with buttons alone (keyboard).
1. Laptop offline with edits: its ring turns amber, then grey with "last seen"; back online it turns green on its own.
2. A behind laptop that's online but idle: **Nudge** → green within a minute.
3. Same lines edited on two devices: the vault shows 1 to tidy; compare side by side on the canvas; keep one; the copy disappears on every device.
4. Remove someone from a vault with unshared work: review and keep the handover on the canvas.
5. From a phone: remove someone from the team (confirm), see their devices leave; restore them.
### Out of scope for M5
Freshness glow, Nudge, tidy and handover review, remove from team (M6). Desktop app (M7).
### Out of scope for M6
Desktop app, tray, installers, updates (M7). Push notifications for Nudge (the next check-in is enough for now).
## 7. Open questions
None open.