Skip to content

Co-DM presence: web client renders human-collaborator presence on the encounter runner (#816 slice 2) #2212

Closed

Description

@AwsomeFox

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 an encounter.presence campaign event on the SSE stream.
  • REST GET/POST/DELETE /encounters/:id/presence for 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 to encounter.presence campaign 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

Activity

  1. added
    enhancement
    theme: table-depth
    priority: P3 low
    complexity: M
    on Aug 12, 2026
  2. AwsomeFox commented on Aug 12, 2026

    @AwsomeFox
    OwnerAuthor

    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

    Blocker

    • None
  3. added
    agent: claimed
    agent: copilot
    on Aug 12, 2026
  4. added 3 commits that reference this issue on Aug 12, 2026
  5. removed
    agent: claimed
    agent: copilot
    on Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity: Menhancementpriority: P3 lowtheme: table-depth

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions