Skip to content

Conversation

@kettanaito
Copy link
Member

The user avatar element on the /users/:username/notes page shrinks, resulting in a broken UI:

Screenshot 2025-08-25 at 12 13 41

This is even more apparent with a placeholder avatar:

Screenshot 2025-07-14 at 10 25 21

This happens because the Link parent has display: flex and the text content (the user name) takes priority when it grows, shrinking the image.

Now, traditionally, you fix this by setting flex-shrink: 0 on the element whose dimensions you wish to preserve. Alas, the component tree of the Img component doesn't make that fix possible as the classes you provide to the component end up on the <img /> element and not the parent <picture /> element, which is the child of the flex container:

<Link>
  <picture> // <- shrink-0 needs to go here
    <img> // <- but it ends up going here

As such, I'm proposing the next best thing, which is to fallback to the next responsive state of this element sooner:

Screenshot 2025-08-25 at 12 18 33

This makes the avatar/username wrap sooner, preventing the shrunk avatar issue.

Test Plan

Checklist

  • Tests updated
  • Docs updated

Screenshots

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

Good catch. Thanks!

@kentcdodds kentcdodds merged commit fb1f753 into main Aug 25, 2025
6 checks passed
@kentcdodds kentcdodds deleted the fix/user-notes-avatar-shrink branch August 25, 2025 17:52
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.

3 participants