Skip to content

DEV: unify presence avatar size to make layout shift less likely #33844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 24, 2025

Conversation

awesomerobot
Copy link
Member

Concerns the presence indicator at the bottom of topics, "replying..." seen here:

image

Previously we've had cases where the min-height of this element had regressed and ends up causing unwanted layout shift on appearance. (See #33022)

Rather than relying on having the correct magic number here, I've centralized the avatar size in a variable. This then gets translated to a CSS variable and also passed to the component that renders the avatar.

This ensures that min-height: calc(var(--avatar-min-height) + 1px); will be larger than the avatar and we won't have to worry about our CSS falling out of sync.

Copy link
Contributor

@jjaffeux jjaffeux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clever!

@awesomerobot awesomerobot merged commit 791908b into main Jul 24, 2025
27 of 28 checks passed
@awesomerobot awesomerobot deleted the dev-presence-avatar-height branch July 24, 2025 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants