Repository navigation
Conversation
Wrap the @wordpress/ui Avatar in the editor and add the inactive state that the editor Avatar has: `dimmed` drops the collaborator color, turns the avatar gray and fades it, and `statusIndicator` shows an icon over a dimmed avatar at full opacity. The collaborator UI can then move to the ui Avatar without adding these props to the ui component. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 PR meta 🤖📦 Bundle sizeSize Change: 0 B Total Size: 8.85 MB
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. As a user I want to be able to create a navigation overlay for a specific navigation block in
|
The status indicator is decorative, but custom JSX could add its text to the accessible name of a surrounding control. Also check that an avatar that isn't dimmed keeps its color.
… opacity Opacity fades a whole group, so the indicator's own opacity doesn't show whether it is faded.
… containers A flex or grid container stretched the wrapper, but not the avatar inside it, so the indicator centered on the wrapper instead of the avatar. Keep the wrapper at the size of the avatar.
No caller has ever passed `statusIndicator`, to this wrapper or to the editor Avatar it comes from. Without it, the wrapper returns the ui Avatar directly, with no extra element to position or size.
|
@WordPress/gutenberg-components @WordPress/gutenberg-design @Mamaduka This PR is part of a larger refactor that removes custom editor Avatar styles (which also didn't use WPDS tokens) in favour of reusing the shared One feature that the shared Other collaborators. I think we can keep the fade as the cue while someone disconnects. It only lasts 5 seconds: after that, the collaborator is removed from the list, and the "%s has left the post." snackbar already says it in text. The list row should still expose the state to screen readers during those 5 seconds, since the fade is visual only. Ourselves. This case needs a different cue. Today, our own avatar never dims, because nothing marks our own client as disconnected. The "Connection lost" modal only appears once background retries fail, so nothing tells us we're offline while the editor retries. We could add either:
Either way, it's a separate treatment from the fade. I'd lean toward the text status: it's a single state, it's easier to notice than a badge on a 24px avatar, and it reads the same for everyone. Where it lives. If we keep the fade only for other collaborators, it's a short exit cue specific to the collaborator UI, so it can stay in the editor wrapper this PR adds. A badge would be the part worth considering for the ui What do you think? More context
|
What?
Follow-up to #87841 (follow-up 2) and #87862.
Adds
CollaboratorAvatar, an editor wrapper around the@wordpress/uiAvatarwith thedimmedstate that the editorAvataruses for disconnected collaborators. Nothing uses it yet.Why?
The collaborator UI is moving to the ui
Avatar, but the uiAvatarhas no inactive state. The collaborators list dims the avatar of a collaborator who disconnected. This PR keeps that state in the editor, so the move doesn't need a new ui prop. Whetherdimmedbelongs in the uiAvataritself is open for discussion here.How?
dimmeddrops the collaboratorcolor, so the avatar uses the neutral fill and ring of the theme. It also turns the image gray and fades the avatar to 50%. The text around the avatar has to describe the inactive state.Avatar. The import has an inline exception for@wordpress/use-recommended-components, ascore-fieldsdoes.Avatar'sstatusIndicatorprop. It came in with [Real-time collaboration] Refine collaborator overlay with Avatar component integration #75595 and no caller has ever passed it. The editorAvatarkeeps it until a later step removes that component.Testing Instructions
npm run storybook:devand open Editor / Collaborator Avatar.Testing Instructions for Keyboard
No interaction. The wrapper adds no focusable element.
Screenshots or screencast
Rendered in a browser test, not part of this PR. The first row is the editor
Avataron trunk, the second isCollaboratorAvatar. In each row: active initials, dimmed initials, active image, dimmed image.Points to discuss:
CollaboratorAvataruses the neutral fill, as the SCSS intended.Avatar.Follow-ups
Avatar. The list will useCollaboratorAvatarwithdimmed.Use of AI Tools
Written with Claude Code (Claude Opus 5.5), at my direction: Claude made the change, captured the screenshots, and drafted this description.
🤖 Generated with Claude Code