Invite someone straight to a folder, and finish sharing its key unasked #186

Merged
nectenda-agent merged 3 commits from worktree-nec-124-invite-to-folder into main 2026-09-26 19:31:30 +01:00
Collaborator

Task: NEC-124 — https://projectron.nerchure.com/tasks/124

Plugin half of "invite straight to a folder" (server half: #185). Collaborating took an organisation invitation, a wait, and a second trip to the members dialog; the second step was the one people missed.

  • One action — "Nectenda: Invite to folder…" on the folder menu, the palette, the organisation page and the people dialog. Existing members are added and the key wrapped at once; new addresses get a folder invitation plus the organisation invitation (rolled back if the second fails).
  • Automatic key sharing (key-grants.ts) — owner devices wrap the folder key for members still waiting for one: cached keys only, never a prompt, only the missing generations, 409 counts as done.
  • Remembered keys (known-keys.ts) — a collaborator whose key differs from the one used for them before is refused with a lasting warning. The people list shows "not compared yet" or "compared ", with Mark as compared. Manual adds go through the same check. This is stricter than before.
  • "Shared a folder with you" (awaiting-folders.ts) — a new folder is offered once, after its key has arrived. Vaults that were already signed in record what is listed on their first pass rather than offering it.
  • Safe add location (add-location.ts) — adding without choosing a location never adopts a folder that already holds notes; it uses <name> (shared) instead. Choosing such a folder by hand asks first. Previously, same-named local notes were uploaded to everyone.
  • The dialog is now titled "People in ", and lists pending invitations with Revoke.
  • Docs: security-model.md (automatic sharing, trust on first use and its first-sighting caveat, checklist), sync-limitations.md (add location settled; waiting for an owner's device, open by design), manual-testing.md (13b, mobile).

Tests:

  • Unit: key-grants, awaiting-folders (location, routing), quick-map, commands.
  • New e2e file invite-to-folder.test.ts: the full journey in two real Obsidian vaults, and refusal of a changed key.
  • Mutation-checked: with the refusal and the location rule disabled, both e2e tests fail. The same holds at unit level for the refusal, the missing-only filter, no-key-on-device, 409 and the location rule.
  • Full multi suite passed locally, apart from a stale dialog-title assertion in commands.test.ts, which is fixed here.

Changelog

Invite someone to a shared folder by email in one step: they get the folder as soon as they join, and your vault shares its key automatically.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NnpsVLx9NmMG2N2nJnA8mR

Task: NEC-124 — https://projectron.nerchure.com/tasks/124 Plugin half of "invite straight to a folder" (server half: #185). Collaborating took an organisation invitation, a wait, and a second trip to the members dialog; the second step was the one people missed. - **One action** — "Nectenda: Invite to folder…" on the folder menu, the palette, the organisation page and the people dialog. Existing members are added and the key wrapped at once; new addresses get a folder invitation plus the organisation invitation (rolled back if the second fails). - **Automatic key sharing** (`key-grants.ts`) — owner devices wrap the folder key for members still waiting for one: cached keys only, never a prompt, only the missing generations, 409 counts as done. - **Remembered keys** (`known-keys.ts`) — a collaborator whose key differs from the one used for them before is refused with a lasting warning. The people list shows "not compared yet" or "compared <date>", with **Mark as compared**. Manual adds go through the same check. This is stricter than before. - **"Shared a folder with you"** (`awaiting-folders.ts`) — a new folder is offered once, after its key has arrived. Vaults that were already signed in record what is listed on their first pass rather than offering it. - **Safe add location** (`add-location.ts`) — adding without choosing a location never adopts a folder that already holds notes; it uses `<name> (shared)` instead. Choosing such a folder by hand asks first. Previously, same-named local notes were uploaded to everyone. - The dialog is now titled "People in <folder>", and lists pending invitations with Revoke. - Docs: `security-model.md` (automatic sharing, trust on first use and its first-sighting caveat, checklist), `sync-limitations.md` (add location settled; waiting for an owner's device, open by design), `manual-testing.md` (13b, mobile). Tests: - Unit: `key-grants`, `awaiting-folders` (location, routing), `quick-map`, `commands`. - New e2e file `invite-to-folder.test.ts`: the full journey in two real Obsidian vaults, and refusal of a changed key. - Mutation-checked: with the refusal and the location rule disabled, both e2e tests fail. The same holds at unit level for the refusal, the missing-only filter, no-key-on-device, 409 and the location rule. - Full multi suite passed locally, apart from a stale dialog-title assertion in `commands.test.ts`, which is fixed here. ## Changelog Invite someone to a shared folder by email in one step: they get the folder as soon as they join, and your vault shares its key automatically. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01NnpsVLx9NmMG2N2nJnA8mR
Invite someone straight to a folder, and finish sharing its key unasked
Some checks failed
CI / promote (pull_request) Has been cancelled
CI / e2e (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
Release note / release-note (pull_request) Successful in 12s
ebeb57c986
Collaborating on a folder took an organisation invitation, a wait, and a
second trip to the members dialog; the second step was the one people
missed. Now one action does it, from the folder menu, the palette, the
organisation page or the people dialog:

- Someone already in the organisation is added and the key wrapped now.
- Someone new gets a folder invitation (the shard claims it when they
  join) plus the organisation invitation.
- An owner's device wraps the folder key for members still waiting on one
  (key-grants.ts): owner devices only, keys already open only, never a
  prompt. A collaborator whose key differs from the one this vault used
  for them before is refused, with a warning that stays on screen
  (known-keys.ts). The people list shows each key as compared or not, with
  "Mark as compared".
- The invitee's vault offers a newly shared folder once its key has
  arrived ("Ann shared a folder with you" / Add to this vault).
- Adding a shared folder without choosing a location never adopts a
  vault folder that already holds notes; it lands in "<name> (shared)".
  Choosing one by hand asks first. Before this, same-named local notes
  were uploaded to everyone in the shared folder.

security-model.md, sync-limitations.md and manual-testing.md say what
changed. The e2e journey has its own file, because identity.test.ts stops
its identity service part-way; both new tests were mutation-checked
(refusal and location rule disabled: both fail).

Task: NEC-124

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NnpsVLx9NmMG2N2nJnA8mR
cruelacid referenced this pull request from a commit 2026-09-26 19:10:56 +01:00
Release notes for #186
Some checks failed
Release note / release-note (pull_request) Successful in 13s
CI / build (pull_request) Successful in 4m41s
CI / e2e (pull_request) Failing after 6m2s
CI / promote (pull_request) Has been skipped
de933d2857
Task: NEC-124

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NnpsVLx9NmMG2N2nJnA8mR
Accept the old members-dialog title in the e2e the previous release also runs
All checks were successful
Release note / release-note (pull_request) Successful in 13s
CI / build (pull_request) Successful in 4m40s
CI / e2e (pull_request) Successful in 5m18s
CI / promote (pull_request) Has been skipped
Deploy site / deploy (push) Successful in 48s
CI / build (push) Successful in 5m2s
CI / e2e (push) Successful in 5m22s
CI / promote (push) Successful in 33s
5a8c619a75
CI runs identity.test.ts a second time against the last published plugin
(0.2.1), which still titles the dialog "Members of".

Task: NEC-124

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NnpsVLx9NmMG2N2nJnA8mR
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
Nectenda/nectenda!186
No description provided.