Skip to content

fix(core): sanitize collaboration presence colors - #3475

Open
nperez0111 wants to merge 1 commit into
mainfrom
fix/collaboration-presence-colors
Open

nperez0111 wants to merge 1 commit into
mainfrom
fix/collaboration-presence-colors

Conversation

@nperez0111

@nperez0111 nperez0111 commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Applies the v0.57.1 collaboration presence color fix to main. Both collaboration adapters constrain remote cursor and selection colors to single CSS values.

Validation: the @blocknote/core suite passed locally on this branch (100 files, 1,505 tests passed).

Summary by CodeRabbit

  • Bug Fixes
    • Improved the display of collaborator cursors and selections when a color is missing or invalid. These now use a consistent orange fallback, and cursor text contrast is adjusted for readability.

@vercel

vercel Bot commented Dec 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
blocknote Ready Ready Preview Dec 6, 2026 9:53am UTC
blocknote-website Ready Ready Preview Dec 6, 2026 9:53am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Both cursor plugin implementations add fallback color handling for cursor rendering and validate user colors for selection rendering. Cursor and label colors are set through DOM style properties.

Changes: Cursor Color Handling

Layer / File(s) Summary
Cursor and selection color handling
packages/core/src/y/extensions/YCursorPlugin.ts, packages/core/src/yjs/extensions/YCursorPlugin.ts
Cursor rendering uses #ffa500 when user.color is not a string and sets colors through style properties. The core selection builder parses the color as a CSS background color and falls back when parsing returns an empty value. The yjs selection builder accepts six-digit hex colors and uses #ffa500 for other values.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: yousefed, matthewlipski

Merge Risk: Minimal · up to ac564

This change constrains remote cursor and selection colors to single CSS values and falls back to a default color when none is valid. No actionable merge-blocking risk is identified.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Description check Inconclusive The description gives a brief summary and a validation note, but it does not follow the repository template. It has no Rationale, Changes, Impact, Testing detail beyond one test run, Screenshots/Video… Add the template sections: Summary (what the fix does, with the color constraint for both adapters), Rationale (why single CSS values are needed for remote cursor and selection colors), Changes (list the YCursorPlugin fallback and validatio…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the core change: the fix sanitizes collaboration presence colors in core. The raw summary confirms the YCursorPlugin changes validate and constrain remote cursor and selection colors, …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the core change: the fix sanitizes collaboration presence colors in core. The raw summary confirms the YCursorPlugin changes validate and constrain remote cursor and selection colors, with a fallback to #ffa500. The title is specific and concise, and it follows the conventional commit style.

Full details: Description check

Explanation

The description gives a brief summary and a validation note, but it does not follow the repository template. It has no Rationale, Changes, Impact, Testing detail beyond one test run, Screenshots/Video, Checklist, or Additional Notes sections. It also does not describe the change itself beyond a reference to a prior release fix. The description is incomplete, but the core intent is stated, so the check is not a total failure.

Resolution

Add the template sections: Summary (what the fix does, with the color constraint for both adapters), Rationale (why single CSS values are needed for remote cursor and selection colors), Changes (list the YCursorPlugin fallback and validation changes), Impact (behavior change for non-string or non-six-digit colors, which now fall back to #ffa500), Testing (the 1,505-test run plus any test added for invalid colors), Screenshots/Video (or state not applicable), and complete the Checklist.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the cursor’s hue,
And gives a safe fallback too.
The label gets its colors set,
The selection checks them yet.
Then hops away, content and bright.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f446db4c-05a4-4b4e-b503-5e116cd01e3b
Commits

Reviewing files that changed from the base of the PR and between 51ad2b4 and ac564e0.

Files selected for processing: 2

  • packages/core/src/y/extensions/YCursorPlugin.ts
  • packages/core/src/yjs/extensions/YCursorPlugin.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@pkg-pr-new

pkg-pr-new Bot commented Dec 6, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/@blocknote/ariakit@3475

@blocknote/code-block

npm i https://pkg.pr.new/@blocknote/code-block@3475

@blocknote/core

npm i https://pkg.pr.new/@blocknote/core@3475

@blocknote/diagram-block

npm i https://pkg.pr.new/@blocknote/diagram-block@3475

@blocknote/mantine

npm i https://pkg.pr.new/@blocknote/mantine@3475

@blocknote/math-block

npm i https://pkg.pr.new/@blocknote/math-block@3475

@blocknote/react

npm i https://pkg.pr.new/@blocknote/react@3475

@blocknote/server-util

npm i https://pkg.pr.new/@blocknote/server-util@3475

@blocknote/shadcn

npm i https://pkg.pr.new/@blocknote/shadcn@3475

@blocknote/xl-ai

npm i https://pkg.pr.new/@blocknote/xl-ai@3475

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/@blocknote/xl-docx-exporter@3475

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/@blocknote/xl-email-exporter@3475

@blocknote/xl-multi-column

npm i https://pkg.pr.new/@blocknote/xl-multi-column@3475

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/@blocknote/xl-odt-exporter@3475

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/@blocknote/xl-pdf-exporter@3475

@blocknote/xl-typst-exporter

npm i https://pkg.pr.new/@blocknote/xl-typst-exporter@3475

commit: ac564e0

@github-actions

github-actions Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.2

QR code for preview link

🚀 View preview at
https://TypeCellOS.github.io/BlockNote/pr-preview/pr-3475/

Built to branch gh-pages at 2026-12-06 10:01 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

This branch was successfully deployed

2 active deployments
Preview – blocknote-website — ac564e0b Deployed Dec 6, 2026 by vercel[bot]
Preview – blocknote — ac564e0b Deployed Dec 6, 2026 by vercel[bot]
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