Skip to content

playhtml: reevaluate cursor render predicates - #345

Draft
spencerc99 wants to merge 1 commit into
mainfrom
cx/fix-cursor-predicate-reevaluation
Draft

playhtml: reevaluate cursor render predicates#345
spencerc99 wants to merge 1 commit into
mainfrom
cx/fix-cursor-predicate-reevaluation

Conversation

@spencerc99

Copy link
Copy Markdown
Owner

Summary

  • Reevaluate every current remote cursor when shouldRenderCursor changes.
  • Reuse the existing cursor update path so filtered cursors are removed and newly allowed cursors are recreated without waiting for another peer event.
  • Add focused regression coverage for both visibility directions and a playhtml patch changeset.

Root cause

CursorClientAwareness.configure() updated the stored cursor options, but shouldRenderCursor was only read by updateCursor(). Existing remote cursor DOM was therefore left in its prior state until that peer published another cursor update.

Validation

  • bun run test -- src/cursors/__tests__/configure-render-filter.test.ts (2 tests)
  • bun run test in packages/playhtml (51 files, 501 tests)
  • bun run build in packages/common
  • bun run build in packages/playhtml
  • bunx tsc --noEmit in packages/playhtml
  • Real-browser validation with two independent clients: a current remote cursor disappears when the predicate filters it and reappears when the predicate allows it, with no new peer movement.

Docs and starters

No docs change is needed because the documented shouldRenderCursor signature and usage are unchanged. The fix makes configure() honor the existing contract immediately. No starter update is needed because imports, options, markup, and CSS are unchanged.

@spencerc99

Copy link
Copy Markdown
Owner Author

Preview evidence

Changing shouldRenderCursor immediately hides and restores current remote cursor DOM without another peer update.

Open preview · Review all evidence · Commit fb87f5a

Current remote cursor filtered

Current remote cursor filtered

Two clients remain online while the current remote cursor DOM is removed immediately after the predicate changes to false.

Open captured page · 1280×720

Current remote cursor restored

Current remote cursor restored

The same current remote cursor reappears immediately after the predicate changes to true, without another peer movement.

Open captured page · 1280×720

Published by PR Evidence. Media is temporary and is removed after retention expires.

@pkg-pr-new

pkg-pr-new Bot commented Jul 31, 2026

Copy link
Copy Markdown

Open in StackBlitz

bun add https://pkg.pr.new/@playhtml/common@345
bun add https://pkg.pr.new/playhtml@345
bun add https://pkg.pr.new/@playhtml/react@345

commit: fb87f5a

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