feat: add rDesign module metadata, collab presence-leave cleanup

- Register rDesign in folk-rapp MODULE_META and shell FAVICON_BADGE_MAP
- Handle explicit presence-leave messages for immediate peer cleanup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-03-25 16:35:10 -07:00
parent 6b81f808f5
commit 2f8ce08e3c
3 changed files with 17 additions and 0 deletions

View File

@ -42,6 +42,7 @@ const MODULE_META: Record<string, { badge: string; color: string; name: string;
rmeets: { badge: "rMe", color: "#6ee7b7", name: "rMeets", icon: "📹" },
rschedule: { badge: "rSc", color: "#93c5fd", name: "rSchedule", icon: "⏰" },
rsocials: { badge: "rSo", color: "#f9a8d4", name: "rSocials", icon: "📱" },
rdesign: { badge: "rDe", color: "#7c3aed", name: "rDesign", icon: "🎨" },
};
const styles = css`

View File

@ -47,6 +47,7 @@ const FAVICON_BADGE_MAP: Record<string, { badge: string; color: string }> = {
rschedule: { badge: "r⏱", color: "#a5b4fc" },
crowdsurf: { badge: "r🏄", color: "#fde68a" },
rids: { badge: "r🪪", color: "#6ee7b7" },
rdesign: { badge: "r🎨", color: "#7c3aed" },
rstack: { badge: "r✨", color: "#c4b5fd" },
};

View File

@ -210,6 +210,21 @@ export class RStackCollabOverlay extends HTMLElement {
this.#renderBadge();
if (this.#panelOpen) this.#renderPanel();
});
// Listen for explicit leave signals (immediate cleanup, no GC wait)
this.#unsubLeave = runtime.onCustomMessage('presence-leave', (msg: any) => {
const pid = msg.peerId;
if (!pid || pid === this.#localPeerId) return;
if (this.#peers.has(pid)) {
this.#peers.delete(pid);
this.#renderBadge();
if (!this.#badgeOnly) {
this.#renderCursors();
this.#renderFocusRings();
}
if (this.#panelOpen) this.#renderPanel();
}
});
}
#connectToDoc() {