Skip to content
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

feat(avatar): added image position option #2433

Merged
merged 4 commits into from
Feb 24, 2025
Merged

feat(avatar): added image position option #2433

merged 4 commits into from
Feb 24, 2025

Conversation

agliga
Copy link
Contributor

@agliga agliga commented Feb 14, 2025

Description

  • Added image position option
  • Options are fit, contain and auto. Auto detects aspect ratio and sets fit or contain.

References

#2434

Screenshots

Screenshot 2025-02-14 at 9 24 33 AM

@agliga agliga self-assigned this Feb 14, 2025
Copy link

changeset-bot bot commented Feb 14, 2025

🦋 Changeset detected

Latest commit: 28142af

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@ebay/ebayui-core Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@LuLaValva LuLaValva left a comment

Choose a reason for hiding this comment

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

Mostly looks good, but philosophical question— why do we allow users to use anything besides "auto"? Shouldn't avatar look the same everywhere? I understand it's more overhead on the client if an app team already had information about the aspect ratio of the image, but I'm not sure that's worth accounting for.

@agliga
Copy link
Contributor Author

agliga commented Feb 19, 2025

Mostly looks good, but philosophical question— why do we allow users to use anything besides "auto"? Shouldn't avatar look the same everywhere? I understand it's more overhead on the client if an app team already had information about the aspect ratio of the image, but I'm not sure that's worth accounting for.

I only set it like this because if you can detect the dimensions on the server you should set it there.

Also i set cover as default so it doesnt break but we can change it to auto as default if needed.

@LuLaValva
Copy link
Member

I only set it like this because if you can detect the dimensions on the server you should set it there.

I don't think we should add the option to set it from the backend. We don't have clear documentation on the specific aspect ratio where it switches from "fit" to "cover", and if it ever changes then a bunch of apps will be out of sync

Copy link
Contributor Author

@agliga agliga left a comment

Choose a reason for hiding this comment

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

From design
It should be
3:4 aspect ratio or 4:3 aspect ration and square (1/1) to be center
All others fit. If there is an irregular aspect ratio it should also be fit.
This isnt taking square into account. Or its allowing more than it should.

@LuLaValva
Copy link
Member

All others fit. If there is an irregular aspect ratio it should also be fit.

I will talk to a designer, but I don't think that's right. My understanding is that everything between 4:3 and 3:4 should be "fill", based on this part of playbook:

Crops narrower than a 4:3 aspect ratio, such as 16:9 or more extreme formats, are adjusted to “fit.”

@agliga agliga merged commit f82f058 into 15.1.0 Feb 24, 2025
5 checks passed
@agliga agliga deleted the avatar branch February 24, 2025 22:46
@github-actions github-actions bot mentioned this pull request Feb 24, 2025
@github-actions github-actions bot mentioned this pull request Feb 25, 2025
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.

2 participants