@@ -68,7 +68,42 @@ reporting success. This confirmation is not a transaction against other clients.
6868Use the persistent left community rail to select a saved community or Personal
6969space. Personal space
7070clears selection without forgetting memberships. The rail’s Add control opens the
71- existing join dialog; displaying saved communities reads relay metadata but does not open sessions for them. Messages shows an intentional
71+ existing join dialog; displaying saved communities reads relay metadata but does not open sessions for them.
72+ Right-click a saved community (or press the ContextMenu key or Shift+F10 on it)
73+ for Mark all as read, Copy community URL, Invite to community, Community
74+ settings and, last, Leave community. Only the selected community can be marked
75+ read, and only while its read state syncs; Invite shows only where the viewer
76+ owns or administers the selected community and this build can mint invites,
77+ with the role read from the relay-signed roster through the selected
78+ community's existing session rather than a further session request. The
79+ Membership settings card applies the same gate: it stays registered in native
80+ builds so owners and admins can still read the relay-signed member list, but
81+ its Invite members button and per-member actions are absent there, with a
82+ note that this build can't create invites or change members, since ` invite ` and
83+ ` member ` are broker routes the packaged adapter does not carry. Copy,
84+ Community settings and Leave work on inactive communities without opening their
85+ sessions. Leave asks for confirmation, then sends a signed NIP-43 leave request
86+ (kind 28936) to that community's relay before the device forgets it. Three
87+ answers end the membership here. The relay accepting, or answering that the
88+ viewer is not a member, removes the community and clears its drafts, reading
89+ positions and other device state, since the relay holds nothing to go back to.
90+ The relay answering that the viewer is banned also removes the community and
91+ disposes its session, but keeps that device state: the relay still holds the
92+ membership while a ban lasts (bans can be timed or lifted), and the data is
93+ keyed by origin and viewer, so adding the community again by its URL finds it.
94+ That notice says the viewer is currently banned, so the leave was refused, and
95+ promises nothing about how long; it never calls access revoked for good. Any
96+ other refusal or an unreachable relay keeps the membership and reports the
97+ failure so Leave can be tried again. Once the relay has answered, only this
98+ device can still fail: a device record that will not save keeps the community
99+ in the rail and says so, naming the storage error so a store that never saves
100+ is not the same promise every attempt, and leaving it again finishes through
101+ the not-a-member answer; a store that will not clear is logged by name and the
102+ success notice says some saved data remains. A left community that was selected
103+ lands on Personal space through the host's selection path, exactly as clicking
104+ Personal space would; a host callback that fails there is logged as the host's
105+ own error, and the leave still reports success because the device did finish.
106+ Messages shows an intentional
72107empty state there. Try drafting in A, switching to B, then returning to A.
73108Selected channels, drafts and reading offsets are partitioned by the canonical
74109community origin and viewer; channel IDs alone are not sufficient keys.
@@ -97,9 +132,9 @@ not a plugin key service.
97132
98133Packaged builds do not include the broker. Native macOS, Windows and Linux
99134[ identity import/create] ( identity.md ) and the shared native relay adapter provide
100- discovery, admission, profile publication, authenticated reads and supported event
101- writes. Windows/Linux installed-app acceptance remains unverified. Community
102- creation/removal and background connection eviction are not implemented. Native
135+ discovery, admission, leave requests, profile publication, authenticated reads and
136+ supported event writes. Windows/Linux installed-app acceptance remains unverified.
137+ Community creation and background connection eviction are not implemented. Native
103138agent enrollment has its own [ local control contract] ( agent-control.md ) . Avatar
104139uploads still require the development media host. Agents have local
105140configuration plus separately scoped participation; selecting a community must
@@ -184,7 +219,21 @@ backup; same-origin plugin JavaScript is trusted and can invoke that IPC too.
184219## Verification
185220
186221` src/features/communities/service.test.ts ` covers no-community initialization,
187- local profiles, scoped view intent, session retention and selective restoration.
222+ local profiles, scoped view intent, session retention, selective restoration and
223+ leaving (membership removal, Personal space fallback, session disposal, purged
224+ device state, a leave that keeps device state for the banned answer, the last
225+ community, a purge that leaves named failures, and a native device record that
226+ will not save, which throws before the snapshot, session, record or device state
227+ change). ` CommunityRail.test.tsx ` covers the leave flow end to end against the
228+ broker route: confirm, publish, then remove; cancel; refusals and timeouts that
229+ keep the membership; the not-a-member answers (purging) and the banned answer
230+ (keeping device state); a device record that will not save after the relay
231+ answered, naming the storage error; a host selection callback that throws after
232+ a completed leave; residual saved data; the host selection of Personal space for
233+ a left selection; focus placement; the in-flight state; and that no inactive
234+ session is acquired. ` device-state.test.ts ` covers the per-origin purge and its
235+ per-store failure report. The broker and native adapter tests sign the exact
236+ leave shape and pass through only the relay's known refusals.
188237` broker.test.ts ` runs real localhost HTTP with signed fixture events to verify
189238multi-community routing, profile publication, invite claims, and a captured send
190239after opening another community. ` destination.test.ts ` checks normalization and
0 commit comments