Skip to content

feat(presence): PRES-3a — whiteboard cursors on the real transport#140

Merged
th3-br41n merged 1 commit into
mainfrom
feat/pres-3-whiteboard-cursors
Jul 12, 2026
Merged

feat(presence): PRES-3a — whiteboard cursors on the real transport#140
th3-br41n merged 1 commit into
mainfrom
feat/pres-3-whiteboard-cursors

Conversation

@th3-br41n

Copy link
Copy Markdown
Contributor

Builds on PRES-2b (now on main). The whiteboard already renders remote cursors + selection from awareness — it just ran on a local no-transport channel (single-device). This swaps it onto the real DEK-sealed presence transport, so two users on the same board see each other's cursors, with zero change to the publisher / peer derivation / overlay paint (the transport abstraction's whole point).

Changes

  • presence-channel.tspresenceAwarenessFor(boardEntityId): the live transport in the shell (services.presence.publish/untrack + presence.onPeers, keyed on the board's entity id), else a local single-device channel (standalone / preview).
  • engine.tsawareness is now re-bindable; bindPresence(boardId) on every openBoard swaps the transport to the open board (boards switch in-window; the real id only lands on open), tearing down the prior board's presence (final clear + untrack). Closures read the current binding at call time; only the change listener re-attaches.
  • storage/runtime.ts — consumer typing for services.presence + presence.onPeers.

Verification

  • 8 presence-channel tests (+2: shell publishes to the service · inbound peer push → remote state · untrack on destroy · standalone → local).
  • 239 whiteboard-logic tests green; whiteboard build clean (runtime imports survive the type-strip); full typecheck (packages + 12 apps) + lint clean.
  • Behavioural (two cursors actually appear across two shells) is the PRES-4 /pentester two-shell dogfood — now unblocked by this.

Remaining PRES-3

The fleet header <PresenceStack> avatar mount across the React shared-entity apps (Notes/Database/…) — likely with an SDK extraction of the transport glue (rule-of-three). Whiteboard is the canvas-cursor reference; the header stacks are the who's-here-avatars half.

🤖 Generated with Claude Code

The whiteboard already renders remote cursors/selection from awareness; it just
ran on a local no-transport channel (single-device). Swap it onto the real
PRES-2b presence transport so cursors go cross-device — no change to the
publisher, peer derivation, or overlay paint (the whole point of the transport
abstraction).

- `presence-channel.ts` — `presenceAwarenessFor(boardEntityId)`: the live
  DEK-sealed transport in the shell (`services.presence.publish/untrack` +
  `presence.onPeers`, keyed on the board's entity id), else a local single-device
  channel (standalone / preview).
- `engine.ts` — `awareness` is now re-bindable; `bindPresence(boardId)` on every
  `openBoard` swaps the transport to the open board (boards switch in-window; the
  real id only lands on open) — tearing down the prior board's presence (final
  clear + untrack). Closures read the current binding; only the `change` listener
  re-attaches.
- `storage/runtime.ts` — the consumer typing for `services.presence` +
  `presence.onPeers` on `WhiteboardBrainstorm`.

8 presence-channel tests (+2: shell publishes to the service / inbound peer push
→ remote state / untrack on destroy; standalone → local). 239 whiteboard-logic
tests green; whiteboard build + full typecheck (packages + 12 apps) + lint clean.

Remaining PRES-3: the fleet header `<PresenceStack>` avatar mount across the
React shared-entity apps (Notes/Database/…). Then PRES-4 `/pentester` two-shell.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@th3-br41n th3-br41n merged commit 3bd0561 into main Jul 12, 2026
1 of 3 checks passed
@th3-br41n th3-br41n deleted the feat/pres-3-whiteboard-cursors branch July 12, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant