Skip to content

Improve/ RTC UI refinement. #75535

Closed
dabowman wants to merge 8 commits intoWordPress:improve/awareness-cursors-jsxfrom
dabowman:add/rtc-cursors-awareness
Closed

Improve/ RTC UI refinement. #75535
dabowman wants to merge 8 commits intoWordPress:improve/awareness-cursors-jsxfrom
dabowman:add/rtc-cursors-awareness

Conversation

@dabowman
Copy link
Copy Markdown
Contributor

Summary

  • Align collaborator avatar, cursor, and block-highlight styles with the WordPress design system (@wordpress/base-styles tokens)
  • Add WCAG-compliant collaborator color derivation using OKLCH
  • Update cursor label to pill-shaped avatar badge with hover-expand name
  • Refine block highlight to match core selection outline via selected-block-focus() mixin
  • Remove Gravatar detection / initials fallback — display WordPress-provided avatar directly

Test plan

  • Verify collaborator avatars render correctly in the presence list (small + medium sizes, with and without color border)
  • Verify cursor overlay labels display avatar + name on hover
  • Verify block highlighting matches core selection outline style
  • Verify collaborator colors have sufficient contrast on light and dark backgrounds
  • Check Safari and Chrome for consistent cursor blink animation

🤖 Generated with Claude Code

@dabowman dabowman requested a review from nerrad as a code owner February 13, 2026 18:19
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 13, 2026

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: [Package] Core data, [Package] Editor, First-time Contributor.

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions github-actions bot added [Package] Core data /packages/core-data [Package] Editor /packages/editor labels Feb 13, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 13, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: chriszarate <czarate@git.wordpress.org>
Co-authored-by: dabowman <davidabowman@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Feb 13, 2026
@github-actions
Copy link
Copy Markdown

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @dabowman! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@maxschmeling maxschmeling force-pushed the add/rtc-cursors-awareness branch from 2823310 to 4bf94b6 Compare February 13, 2026 18:21
@dabowman dabowman force-pushed the add/rtc-cursors-awareness branch from c7c2694 to fe75b2f Compare February 13, 2026 18:43
dabowman and others added 6 commits February 13, 2026 11:53
Bug: useBlockHighlighting crashes with TypeError: Cannot read properties of undefined (reading 'WholeBlock') when two users edit the same post.
Cause: In use-block-highlighting.ts:15, SelectionType is destructured from unlock(coreDataPrivateApis), but it was never added to the private APIs in private-apis.js. It's undefined at runtime.
Fix: Import SelectionType directly from @wordpress/core-data (it's already a public export), matching the pattern in use-render-cursors.ts. Remove it from the unlock() destructure.
Replace the naive RGB lightness-shift color system with a contrast-aware
pipeline that derives two purpose-specific colors per collaborator from
seed colors in the palette:

- strokeColor: meets 3.1:1 contrast against white (WCAG 2.1 SC 1.4.11
  for UI components like borders and block highlights)
- backgroundColor: meets 7:1 contrast against white (WCAG 2.1 SC 1.4.3
  AA for white text on colored cursor labels)

Colors are manipulated in OKLCH space (Björn Ottosson's OKLAB) for
perceptually uniform darkening — only lightness is reduced while chroma
and hue are preserved. This avoids the hue drift that CIE LCH exhibits
when darkening blues. The implementation is ~60 lines of pure math with
zero external dependencies.

Also updates the seed palette to use more vibrant, distinct colors and
replaces the RGB-shift overflow strategy with OKLCH hue rotation for
generating new colors when all palette slots are taken.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the inline box-shadow approach for RTC block highlighting with
the same outline-based method core uses for `.is-highlighted` blocks.
This ensures consistent outline style, width, offset, and zoom scaling
across both the default selection and collaborator highlights.

- Switch from inline `style.boxShadow` to a `.is-collaborator-selected`
  CSS class with a `--collaborator-outline-color` custom property
- Reuse the `selected-block-focus()` mixin from `@wordpress/base-styles`
- Add `:not(:focus)` guard so the user's own selection always wins
- Extract shared `collaborator-contrast-shadow()` mixin used by both the
  block highlight and avatar components
- Add compiled `COLLABORATOR_CONTRAST_SHADOW` constant for iframe styles

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Redesign the cursor label from a plain text tag to a pill-shaped badge
with the collaborator's avatar. The label defaults to showing just the
avatar circle and expands on hover to reveal the username.

- Add `collaborator-avatar()` mixin for shared avatar styles between
  the presence list and cursor label, using `--avatar-url` CSS custom
  property
- Restyle cursor label as a flex pill with avatar + name, white outline
  contrast ring, and hover expand transition
- Add white outline + elevation shadow to cursor caret for contrast
- Fix block highlight inset shadow: use a wider inset that extends past
  the outline so the white inner ring remains visible
- Consolidate `collaborator-contrast-shadow()` to include inset ring,
  fixing the `--with-color-border` avatar variant losing its inner ring
- Sync all changes to `overlay-iframe-styles.ts` for iframe injection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dabowman dabowman changed the base branch from add/rtc-cursors-awareness to improve/awareness-cursors-jsx February 13, 2026 19:01
@chriszarate chriszarate force-pushed the improve/awareness-cursors-jsx branch from 2317f57 to 16a4108 Compare February 13, 2026 19:03
When a collaborator has no custom Gravatar, display their first two
initials on their assigned background color instead of the default
placeholder image. A shared gravatar-check utility detects real vs
default avatars by preloading with `d=404` and caching the result
for both the React presence avatar and the imperative cursor overlay.

Also refines cursor overlay visuals: Safari-style blink animation,
rounded caret edges, label centered on caret midpoint, and
box-sizing fix for accurate avatar dimensions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dabowman dabowman force-pushed the add/rtc-cursors-awareness branch from fe75b2f to ef83f5d Compare February 13, 2026 19:10
@maxschmeling maxschmeling deleted the branch WordPress:improve/awareness-cursors-jsx February 13, 2026 19:15
@dabowman dabowman changed the title RTC cursor awareness: collaborator styling refinements Improve: RTC UI refinement. Feb 14, 2026
@dabowman dabowman changed the title Improve: RTC UI refinement. Improve/ RTC UI refinement. Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Package] Core data /packages/core-data [Package] Editor /packages/editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants