Repository navigation
Closed
Labels
complexity: MMedium: several files or one subsystem, modest integration workenhancementNew feature or requestpriority: P3 lowLow: optional expansion, polish, or deferrable enhancementtheme: table-depthTTRPG depth: XP, loot, sheets, systems
Description
Split from #816 (Co-DM presence, P3, XL). This is slice 2: the web client that consumes the encounter.presence SSE events (delivered by #2209/PR #2210) and renders human-collaborator presence on the encounter runner.
What this slice covers
Render "Alice and Bob are here" on the encounter runner by consuming the encounter.presence campaign-event frames broadcast by the EncounterPresenceService (#2209). This is the UI layer that makes the server-side presence foundation visible to DMs.
What #2209 delivered (the foundation this consumes)
EncounterPresenceSnapshot({ campaignId, encounterId, members: [{ userId, activity }] }) broadcast as anencounter.presencecampaign event on the SSE stream.- REST
GET/POST/DELETE /encounters/:id/presencefor declaring/leaving/reading presence. - Role-filtered secrecy: hidden encounters' presence is DM-only.
- In-memory registry with TTL expiry + lazy reap.
Acceptance criteria
- The encounter runner (
RunSessionPage) subscribes toencounter.presencecampaign events for the current encounter and maintains a live presence roster in component state. - When a DM opens a running encounter, the client declares presence (
POST /encounters/:id/presence) and leaves on unmount/navigate-away (DELETE). - The client heartbeats presence on a cadence well inside the server TTL (45s) — e.g., every 30s while the encounter tab is visible.
- The encounter runner shows a compact presence indicator (e.g., "Alice and Bob are here" or avatar chips) listing other human collaborators currently on the same encounter, with their coarse activity (
viewing/editing). - The current user does not see themselves in the presence list (or is clearly distinguished).
- Presence disappears when a collaborator's heartbeat expires (the server emits the updated snapshot).
- A non-DM on a hidden encounter never sees presence (server-enforced; the client just doesn't receive the frames).
- E2E or unit test: a second client connecting to the same encounter sees the first's presence; disconnecting removes it.
Out of scope (subsequent slices)
- Advisory intent ("Bob is resolving this turn") — separate slice (needs a richer activity model than
viewing/editing). - Short-lived warnings/leases around high-risk actions — separate slice.
- Tab close / sleep / network-loss detection beyond SSE disconnect + heartbeat — separate slice.
- Presence on the AI driver panel (the AI already has its own presence model).
Related
- Co-DM presence: show human collaborators and edit intent during live encounters #816 — parent epic
- Co-DM presence: ephemeral authenticated presence on the encounter SSE stream (#816 slice 1) #2209 — slice 1 (server foundation, MERGED via PR feat(encounters): ephemeral Co-DM presence on the encounter SSE stream (#2209) #2210)
RunSessionPage.tsx:783— existing AI-driver presence display (a precedent for the UI shape)
Metadata
Metadata
Assignees
Labels
complexity: MMedium: several files or one subsystem, modest integration workenhancementNew feature or requestpriority: P3 lowLow: optional expansion, polish, or deferrable enhancementtheme: table-depthTTRPG depth: XP, loot, sheets, systems
Activity
AwsomeFox commentedon Aug 12, 2026
Agent Workpad
State: PR_OPEN
Tool: copilot
Run ID: copilot-20260812T005700Z-glm
Claim comment ID: 5260816266
Claimed at: 2026-08-12T00:57:00Z
Lease until: 2026-08-12T02:27:00Z
Worker: glm-issue-worker
Worktree: /Users/anthonyanderson/Documents/campfire/.copilot-worktrees/glm-20260812T005700Z/issue-2212
Branch: copilot/backlog-2212-presence-ui
PR: #2213
Latest head: 5919484
Notes
useEncounterPresence(declare/heartbeat/leave + roster),EncounterPresenceIndicator, RunSessionPage wiring (SSE subscribe, declare as DM, reconnect redeclare),isCampaignEventguard, i18n (en+ar), 15 component tests. typecheck/lint/i18n/test:component:web/test:unit:web all green. Pushed + opened PR feat(encounters): render Co-DM presence on the encounter runner (#2212) #2213. Watching CI.Blocker
review(#2212): abort obsolete declarations, null-safe self filter, fi…
review(#2212): abort obsolete declarations, null-safe self filter, fi…
feat(encounters): render Co-DM presence on the encounter runner (#2212)…