MM-70358: use core's Avatars stack for space members - #29
Draft
calebroseland wants to merge 1 commit into
Draft
Conversation
Docs reimplemented core's overlapping avatar stack because only Avatar was published, reintroducing bugs core had already fixed: the +N chip used a translucent fill so the avatar beneath showed through, the overlap offset and ring width were hardcoded to one size, and the avatars had no profile popover or keyboard access. Render core's Avatars when the host publishes it. Hosts that don't keep a local fallback, now with the chip fill opaque and the offset and ring matching core at sm. Context: /longshot — MM-70358 share core Avatars with mattermost-plugin-docs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
+Nchip in the space overview member list rendered with a see-through background, letting theavatar underneath show through it. The cause wasn't the chip: Docs had reimplemented core's whole
avatar stack, because core only published
Avatarto plugins and notAvatars.The copy had drifted from core in eight ways — translucent chip fill
(
rgba(--center-channel-color-rgb, 0.08)where core computes an opaquetinycolor.mix(bg, color, 8)), a hardcoded-8pxoffset and2pxring instead of core's per-size--offset/--border-width, a bare<span>chip rather than anAvatar, no profile popover, nokeyboard access, no hover affordance, no
99+cap ortotalUsershandling, and a differentbreak point.
So rather than patch the chip and leave the other seven, this deletes the reimplementation and
renders core's
Avatars.Host compatibility.
Avatarsis published by mattermost#38165, which hasn't landed. Docs mustkeep running against hosts that predate it, so
member_avatars.tsxprobeshostHasAvatars()andfalls back to the previous local stack — with the reported bug fixed there too: the chip fill is
now opaque via
color-mix, and the offset and ring match core atsm. Once the host publishesAvatarsthe fallback stops being reachable, and the overflow chip also becomes clickable(mattermost#38166) via
canOpenOverflow.Testing
canOpenOverflowset, no fallback) andhost-doesn't (fallback renders, overflow counting). 464 tests pass.
Avatars, since they assert core's counts and popover behaviour. They have not been executedagainst a live server — no available host publishes
Avatarsyet.Ticket Link
Fixes: https://mattermost.atlassian.net/browse/MM-70358
Depends on
Avatars(required for the non-fallback path)canOpenOverflow(stacked on the above)