Skip to content

feat: serve admin avatars through the picture helper - #281

Merged
hellopablo merged 4 commits into
developfrom
feature/avatar-picture-sources
Oct 3, 2026
Merged

hellopablo merged 4 commits into
developfrom
feature/avatar-picture-sources

Conversation

@hellopablo

Copy link
Copy Markdown
Member

Summary

  • User-cell profile images and the topbar avatar now use Nails\Cdn\Helper\Picture, with a 2x source at double the crop size (70px and 200px).
  • Those are real CDN crop URLs, so a cached 1x file is never requested again with an @2x suffix.
  • Permits the 70×70 crop the user cell needs. 200×200 was already permitted.
  • Blank avatars stay a single image. Picture only accepts a CDN object.

Depends on nails/module-cdn#472. Without that change, a density-only source is emitted with an empty media attribute and the 2x crop loads on 1x displays too.

Test plan

  • On a user list, confirm a profile image is a <picture> whose source is the 70px crop with media="(min-resolution: 2dppx)", and a user without a photo still shows the blank avatar.
  • On a 2x display, confirm the network panel requests the 70px and 200px crops, not a cached filename with @2x appended.
  • Confirm the topbar avatar still sits in the account cluster as a circle, including for an account with no profile image.

The 2x candidate is a real 70px crop, so a cached 35px file is never requested with an @2x suffix.
Profile images get a 200px source on 2x displays. The avatar is an img so object-fit can cover the circle.
@hellopablo
hellopablo enabled auto-merge October 3, 2026 10:04
@hellopablo
hellopablo merged commit 9680e9c into develop Oct 3, 2026
5 checks passed
@hellopablo
hellopablo deleted the feature/avatar-picture-sources branch October 3, 2026 10:05
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