Skip to content

feat(collaboration): live presence + session chat (cursors, mentions, emoji, pins) - #150

Open
professionalarduino-max wants to merge 2 commits into
DashBlocks:developfrom
professionalarduino-max:feature/live-collaboration-presence
Open

professionalarduino-max wants to merge 2 commits into
DashBlocks:developfrom
professionalarduino-max:feature/live-collaboration-presence

Conversation

@professionalarduino-max

@professionalarduino-max professionalarduino-max commented Oct 16, 2026 •

Copy link
Copy Markdown

Adds Figma-style live presence and a session chat to live-collaboration sessions 🎉

1. Live presence (cursors & co.)

  • src/lib/dash-presence.js — ephemeral presence channel: cursor (surface + position), open sprite, dragged block. Relayed over the collaboration WebSocket as best-effort presence messages — never written to the persistent Yjs document, so it also works for viewers.
  • PresenceCursors overlay — colored cursors with name labels:
    • on the stage (normalized coordinates, resolution independent);
    • in the blocks workspace (workspace coordinates, so cursors stay glued to blocks across zoom/scroll differences);
    • remote blocks being dragged get a colored outline + a ⠿ badge on the cursor.
  • Sprite indicators — tiles of sprites that other participants have open show colored dots and a ring.
  • PresenceAvatars in the menu bar — who is in the session, who is currently online.

2. Session chat (src/lib/dash-chat.js + dash-chat panel)

  • Chat panel in the collaboration status bar with message history (server keeps a 200-message room history, replayed on join).
  • @username mentions — highlighted in messages, unread badge + tooltip notification when someone mentions you.
  • Emoji picker — 6 categories, inserted at the caret.
  • Pinned messages — pin a message to the current sprite / costume / block; pin chips navigate on click (block pins flash-highlight the block). Filter toggle for pinned-only.

Compatibility — feature handshake

  • auth advertises features: ['presence', 'chat'], ready lists server support.
  • Presence/chat are only sent and relayed when both sides support them: old clients never receive unknown message types (which used to kill their session), and new clients never send presence/chat to old servers (which used to close the connection).

Notes

  • Requires the matching DashBlocks/server change (PR Bump scratch-vm from 555aa35 to 929071f #3 in DashBlocks/server).
  • Presence throttled ~12 msg/s; presence payloads capped at 2 KB, chat text at 500 chars server-side; peers expire after 12 s.
  • All changes follow the existing collab architecture (vm.dashCollaboration session, DASH_COLLABORATION_STATUS events).

…indicators and avatars

Add Figma-style real-time presence to live-collaboration sessions:

- dash-presence: ephemeral presence channel (cursor surface/position, open
  sprite, dragged block) relayed over the collaboration WebSocket as
  best-effort 'presence' messages — never persisted, available to viewers
- PresenceCursors overlay: colored cursors with name labels on the stage
  and in the blocks workspace (workspace coordinates stay glued across
  zoom/scroll), plus a colored outline on blocks being dragged remotely
- Sprite tiles show colored dots and a ring for sprites open in other
  participants' editors
- PresenceAvatars in the menu bar: who is in the session, who is online
- DashCollaboration: sendPresence()/onPresence + connectionId from 'ready'

Requires the matching DashBlocks/server change that relays 'presence'
messages and includes connectionId in the room 'ready' message.
…ned messages

- dash-chat: room chat store + panel in the collaboration status bar —
  history, @mentions with unread notifications, emoji picker with
  categories, and pinned messages pointing at sprites/costumes/blocks
  with click-to-focus (block pins flash-highlight the block)
- Chat travels over the collaboration WebSocket as ephemeral 'chat'
  messages with server-side room history — never written to the project
  document, so viewers can chat too
- Feature handshake: 'auth' advertises features ['presence', 'chat'] and
  'ready' lists server support; presence/chat are only sent when both
  sides support them, so old servers and old clients keep working
@professionalarduino-max professionalarduino-max changed the title feat(collaboration): live presence — cursors, drag highlight, sprite indicators and avatars feat(collaboration): live presence + session chat (cursors, mentions, emoji, pins) Oct 16, 2026

This branch has not been deployed

No deployments
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