feat(realtime): live enclave settings-page member list (LC-172) #217
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-172-live-settings-members"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes LC-172. Continuation of LC-170 (live enclave landing member/room lists). The enclave settings page (
/enclave/{id}/settings) renders its own member list carrying the kick / role-toggle / transfer controls and is where managers actually work, but it did not subscribe to the enclave topic, so it stayed static until reload. LC-170 already broadcastsEnclaveMember{Added,Removed,RoleChanged}on theenclave:{id}topic; this wires the settings page as a second consumer.Changes
enclave/settings_members_items.html) so the page and the live OOB fragment (ws/enclave_settings_members_live.html, swapping#lc-enclave-settings-members) render identically. The other settings sections (visibility, invite code, emojis, groups, branding, delete) are untouched.data-lc-live-topic="enclave:{id}".topic_subscribe_allowedalready authorizes enclave members and (from the LC-170 review) site admins;get_settingsalready 403s non-managers, so only managers reach the page.render_enclave_membersnow takes the recipient and emits BOTH member fragments in one frame: the read-only landing list (#lc-enclave-members, recipient-independent) and the settings list (#lc-enclave-settings-members, rendered per recipient because the kick/role/transfer controls gate oncan_delete). A connection on the landing page matches only the first id, a connection on settings only the second, and htmx silently drops the unmatched OOB target. The enclave row is fetched once for the settings variant; if it is gone the landing fragment is the sole output.Out of scope
The User groups section on the settings page has no broadcast events today (group CRUD fires nothing over the WS), so live group updates are deferred rather than wired here.
Verification
just testandjust test-saasboth green (106test result: okeach, zero failures);cargo clippy/cargo fmtclean. New regression test (routes_enclave_nav::settings_page_is_wired_for_live_member_updates) asserts the settings page subscribes to the topic, renders the swappable member region, and still shows the manager controls inside it.Continuation of LC-170. The enclave settings page (/enclave/{id}/settings) renders its own member list carrying the kick / role-toggle / transfer controls and is where managers actually work, but it did not subscribe to the enclave topic, so it stayed static until reload. LC-170 already broadcasts EnclaveMember{Added,Removed,RoleChanged} on the enclave:{id} topic; this wires the settings page as a second consumer. - The settings member list is extracted into a shared partial (enclave/settings_members_items.html) so the page and the live OOB fragment (ws/enclave_settings_members_live.html, swapping #lc-enclave-settings-members) render identically. The unrelated settings sections (visibility, invite code, emojis, groups, branding, delete) stay in the page untouched. - The settings page now carries data-lc-live-topic="enclave:{id}". topic_subscribe_allowed already authorizes enclave members and (LC-170 review) site admins; get_settings already 403s non-managers, so only managers reach the page. - render_enclave_members now takes the recipient and emits BOTH member fragments in one frame: the read-only landing list (#lc-enclave-members, recipient-independent) and the settings list (#lc-enclave-settings-members, rendered per recipient because the kick/role/transfer controls gate on can_delete). A connection on the landing page matches only the first id, a connection on settings only the second, and htmx silently drops the unmatched OOB target. The enclave row is fetched once for the settings variant; if it is gone the landing fragment is the sole output. Out of scope: the User groups section on the settings page has no broadcast events today (group CRUD fires nothing), so live group updates are deferred rather than wired here. Regression test asserts the settings page subscribes to the topic, renders the swappable member region, and still shows the manager controls inside it. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>