Skip to content

Show collaborator names as written in cursor labels - #5300

Merged
elias-ba merged 1 commit into
mainfrom
cursor-label-names
Dec 4, 2026
Merged

elias-ba merged 1 commit into
mainfrom
cursor-label-names

Conversation

@elias-ba

@elias-ba elias-ba commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR fixes two things with collaborator cursors in the job editor. A name with a quote or a backslash broke the label above that person's cursor. Names are now escaped before they go into the cursor styles, so they show as written.

Each collaborator's cursor color now comes from their user ID, the same way every browser already picks its own color. So a collaborator has the same color on every screen, in the job editor, on the diagram and in the avatars.

Validation steps

  1. Open the same workflow in two browsers as two users.
  2. Change one user's first name to Ada "The Countess" \ Lovelace and open a job in both browsers.
  3. The other browser shows the full name in that user's cursor label, and that user's cursor color matches their avatar.

AI Usage

Please disclose whether you've used AI anywhere in this PR (it's cool, we just want to know!):

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our Responsible AI Policy

Pre-submission checklist

  • I have performed an AI review of my code (we recommend using /review with Claude Code)
  • I have implemented and tested all related authorization policies. (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

@github-project-automation github-project-automation Bot moved this to New Issues in Core Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

Security Review ✅

  • S0 (project scoping): N/A, changes are frontend-only (cursor label rendering in the collaborative editor) with no new queries or web-layer entrypoints touching project data.
  • S1 (authorization): N/A, no new controller actions, LiveView events, or policy changes.
  • S2 (audit trail): N/A, no writes to config resources (workflows, credentials, project settings, etc.).

Note: this PR itself hardens the cursor-label renderer by replacing dangerouslySetInnerHTML with a text child, serialising user names through a CSSOM-compliant cssString(), and guarding clientId with Number.isSafeInteger before interpolating it into class selectors (assets/js/collaborative-editor/components/Cursors.tsx:65-93).

Cursor labels in the job editor are drawn with generated CSS. A name
with quotes or backslashes now goes through a CSS string serialiser, so
it shows as written. The stylesheet is rendered as a text child.

Cursor colors now come from the user ID in the awareness store, the same
way each client picks its own, so a collaborator has the same color on
every screen.
@codecov

codecov Bot commented Dec 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.9%. Comparing base (4d15430) to head (8165466).

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #5300     +/-   ##
=======================================
- Coverage   91.9%   91.9%   -0.0%     
=======================================
  Files        482     482             
  Lines      24481   24481             
=======================================
- Hits       22493   22492      -1     
- Misses      1988    1989      +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@elias-ba
elias-ba merged commit 3e2e552 into main Dec 4, 2026
8 checks passed
@elias-ba
elias-ba deleted the cursor-label-names branch December 4, 2026 15:17
@github-project-automation github-project-automation Bot moved this from New Issues to Done in Core Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants