Skip to content

MM-70358: use core's Avatars stack for space members - #29

Draft
calebroseland wants to merge 1 commit into
masterfrom
MM-70358-share-core-avatars
Draft

MM-70358: use core's Avatars stack for space members#29
calebroseland wants to merge 1 commit into
masterfrom
MM-70358-share-core-avatars

Conversation

@calebroseland

Copy link
Copy Markdown
Member

Summary

The +N chip in the space overview member list rendered with a see-through background, letting the
avatar underneath show through it. The cause wasn't the chip: Docs had reimplemented core's whole
avatar stack, because core only published Avatar to plugins and not Avatars.

The copy had drifted from core in eight ways — translucent chip fill
(rgba(--center-channel-color-rgb, 0.08) where core computes an opaque
tinycolor.mix(bg, color, 8)), a hardcoded -8px offset and 2px ring instead of core's per-size
--offset / --border-width, a bare <span> chip rather than an Avatar, no profile popover, no
keyboard access, no hover affordance, no 99+ cap or totalUsers handling, and a different
break point.

So rather than patch the chip and leave the other seven, this deletes the reimplementation and
renders core's Avatars.

Host compatibility. Avatars is published by mattermost#38165, which hasn't landed. Docs must
keep running against hosts that predate it, so member_avatars.tsx probes hostHasAvatars() and
falls 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 at sm. Once the host publishes
Avatars the fallback stops being reachable, and the overflow chip also becomes clickable
(mattermost#38166) via canOpenOverflow.

Testing

  • Unit: both paths covered — host-publishes (ids forwarded, canOpenOverflow set, no fallback) and
    host-doesn't (fallback renders, overflow counting). 464 tests pass.
  • Playwright specs added for the space member avatars. They skip when the host doesn't publish
    Avatars, since they assert core's counts and popover behaviour. They have not been executed
    against a live server — no available host publishes Avatars yet.

Ticket Link

Fixes: https://mattermost.atlassian.net/browse/MM-70358

Depends on

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
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