Show live cursors of online teammates on board🖱️

Aperta
#645 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
56/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
express, javascript, node.js, react

Direzione di ricerca

Start with server/index.js and client/src/pages/Dashboard.jsx, then check how the app initializes Socket.io and tracks connected users. The issue sketches cursor events and rendering; confirm the existing socket and user patterns before implementing them. Done when online teammates’ cursors appear on the board and disappear when they disconnect.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement good first issue

Show live cursors of online teammates on board

File: server/index.js + client/src/pages/Dashboard.jsx

Nobody knows where teammates are
looking on the board 💀
Figma has this — DevBoard should too fr!!

Fix: emit cursor position via Socket.io:
// server/index.js:
io.on('connection', (socket) => {
socket.on('cursor:move', ({ x, y, userId, name }) => {
socket.broadcast.emit('cursor:update',
{ x, y, userId, name })
})
socket.on('disconnect', () => {
socket.broadcast.emit('cursor:remove',
{ socketId: socket.id })
})
})

// Dashboard.jsx:
const [cursors, setCursors] = useState({})

useEffect(() => {
const handleMove = (e) => {
socket.emit('cursor:move', {
x: (e.clientX / window.innerWidth) * 100,
y: (e.clientY / window.innerHeight) * 100,
userId: user._id,
name: user.name
})
}
window.addEventListener('mousemove', handleMove)
return () => window.removeEventListener(
'mousemove', handleMove)
}, [])

socket.on('cursor:update', ({ x, y, userId, name }) => {
setCursors(prev => ({ ...prev, [userId]: { x, y, name }}))
})

// render cursors:
{Object.entries(cursors).map(([id, { x, y, name }]) => (

{name} ))}

Socket.io already installed ✅
~30 lines! This is LITERALLY Figma-level!! 🔥

Lingua principale
JavaScript
Stelle
39
Fork
105
Merge medio
2g 10h
PR unite (30g)
22

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di anoopcodehack/DevBoard

Tutte le issue di anoopcodehack/DevBoard

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.