diff --git a/shared/components/rstack-collab-overlay.ts b/shared/components/rstack-collab-overlay.ts index b187eb6..6c4bff4 100644 --- a/shared/components/rstack-collab-overlay.ts +++ b/shared/components/rstack-collab-overlay.ts @@ -5,7 +5,7 @@ * - "N online" badge (top-right pill with colored dots) * - People panel dropdown (click badge to open) * - Online/Offline mode toggle in panel - * - Remote cursors (SVG arrows with username labels, viewport-relative) + * - Remote cursors (SVG arrows with username labels, page-relative) * - Focus highlighting (colored outline rings on data-collab-id elements) * - Auto-discovery via rspace-doc-subscribe events from runtime * - Bridge API for canvas (external peer management via CommunitySync) @@ -395,7 +395,7 @@ export class RStackCollabOverlay extends HTMLElement { // ── Pointer tracking (15Hz throttle) — covers mouse, touch, and pen ── #pointerHandler = (e: PointerEvent) => { - this.#lastCursor = { x: e.clientX, y: e.clientY }; + this.#lastCursor = { x: e.clientX + window.scrollX, y: e.clientY + window.scrollY }; }; #startMouseTracking() { @@ -747,8 +747,10 @@ export class RStackCollabOverlay extends HTMLElement { const age = now - peer.lastSeen; const opacity = age > 5000 ? 0.3 : 1; + const sx = peer.cursor.x - window.scrollX; + const sy = peer.cursor.y - window.scrollY; fragments.push(` -
+