Skip to content

feat(collaboration): control center, follow mode, presenter mode and activity feed - #152

Open
professionalarduino-max wants to merge 4 commits into
DashBlocks:developfrom
professionalarduino-max:feature/collab-control-center
Open

professionalarduino-max wants to merge 4 commits into
DashBlocks:developfrom
professionalarduino-max:feature/collab-control-center

Conversation

@professionalarduino-max

Copy link
Copy Markdown

What

The collaboration experience, upgraded: a beautiful control center, follow mode with live presentations, and an activity feed with per-user undo. Built on top of the live-presence and chat work (PR #150).

🎛 Control center (replaces the basic collaborators modal)

  • Participant list with colorful avatars, online dots, role badges (Owner / Editor / Viewer) and a "looking at: sprite" hint per person
  • Owner moderation: promote/demote editors↔viewers, remove collaborators (server-enforced — their session closes), remove + ban (persistent block list, remembered across sessions)
  • Invite link with one-click copy
  • Tabs: Participants · Activity · Chat in one polished modal

📡 Follow mode and presentation

  • Every participant can publish their view state (editor tab, sprite, workspace zoom and scroll) over the presence channel
  • «Follow» button on any participant: the editor continuously mirrors their view — exactly what a teacher or streamer needs
  • Presenter mode («Ведущий»): the project owner starts a lesson/presentation — everyone else watches read-only and can raise a hand; the presenter sees the queue and grants speech per person
  • Floating follow bar: "Following X", live presentation chip, raise-hand button, raised-hands counter for the presenter

🕒 Activity feed and per-user undo

  • Live feed of what happened: "Den4ik-12 deleted sprite Cat", "CHIPY renamed sound" — with author, icon, target name and time; presentation and moderation events too
  • Personal undo: each participant can undo only their own changes (restore functions captured from the VM — deletes are reversible, renames roll back). Shared undo stays untouched, so nobody destroys other people's work
  • Per-entry Undo buttons + "Undo my last change"; entries that can be undone are highlighted

Technical notes

  • View/presenter/hand-raise state rides the existing best-effort presence channel (new view, control, action fields) — no server changes required; the kick uses the existing collaborator REST API for real enforcement
  • Presence action events are dispatched per message (new onEvent hook) so consecutive edits never collapse in the feed
  • Editing is gated by sessionControl.canEdit() in the operation tracking wrappers and DashCollaborationSession.canEdit()
  • Full webpack build passes with 0 errors

Testing

  • Share a project and open the collaboration control center from the menu bar
  • As owner: start presentation → other tabs become read-only; raise hand on another account → "Give speech" appears
  • Follow a participant from a second account and change sprites/tabs/zoom — the follower mirrors the view
  • Delete a sprite/costume/sound → Activity tab shows it highlighted → "Undo my last change" restores it
  • Owner: Remove/Ban a collaborator — their session closes (server-enforced for remove)

…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
…activity feed

Control center (replaces the basic collaborators modal):
- Participant list with colorful avatars, online status, role badges
- Owner moderation: change roles, remove collaborators (server-enforced
  kick), remove + ban with a persistent session block list
- Invite link with one-click copy
- Tabs: participants, activity feed and the session chat

Follow mode and presentation:
- Share your view (editor tab, sprite, zoom, scroll) over the presence
  channel and follow any participant with one click
- Presenter mode for lessons and streams: the owner presents, everyone
  else watches read-only and can raise a hand; the presenter grants speech
- Floating follow bar: follow state, live presentation chip, raise-hand
  button, raised-hand counter

Activity feed and per-user undo:
- Live feed of sprite/costume/sound edits, presentation and moderation
  events with author, target name and time
- Personal undo: each participant undoes only their own changes (restore
  functions captured from the VM), never other people's work
- Per-entry Undo buttons plus a global 'undo my last change'

Presence: action events are dispatched per message so consecutive edits
never collapse; presentation and view state ride the best-effort channel.
… the presenter

- Activity entries capture before/after diffs (renames show old and new
  names, deletes show a sprite summary); click an entry to expand the diff,
  including entries relayed from other participants
- Targeted Restore: bring back a deleted sprite/costume/sound or roll a
  name back straight from the history, independent of the undo stack
- While a presentation is live the audience automatically follows the
  presenter's view (tab, sprite, zoom, scroll); dismissing the follow chip
  keeps it off until the presenter changes
- Owner crown badge and a gold ring on the presenting participant

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