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

Can the User Icons be Customised? #754

Closed
LarnuUK opened this issue Dec 5, 2019 · 15 comments · Fixed by #825
Closed

Can the User Icons be Customised? #754

LarnuUK opened this issue Dec 5, 2019 · 15 comments · Fixed by #825

Comments

@LarnuUK
Copy link

LarnuUK commented Dec 5, 2019

When using Subversion in VSCode, each different person that commits to the branch is given a little icon. These also appear to be consistent between different Projects. I can't see anything about the icon in SVN itself, so I assume these come from the extension, rather than Subversion (please correct me if this assumption is wrong).

If they are from the extension, is there are change the images? Ones I'm referencing can be seen in the image below the Pink, White, Orange and Green icons.
image

@JohnstonCode
Copy link
Owner

Icons are generated using https://www.gravatar.com/avatar/${md5(author)}.jpg?s=${size}&d=robohash What sort of customisation are you looking for?

@LarnuUK
Copy link
Author

LarnuUK commented Dec 5, 2019

In a work environment, for example, it could be nice to have a small image of the user's face, for example, or perhaps initials instead (means that I know that commits showing up with a TA image are myself, rather than an icon that looks like a green balloon).

I assume you could leverage the user having a gravatar account, but less idea for an office environment. It was more a passing idea than anything, as someone asked why I "gave them the pink robot."

@JohnstonCode
Copy link
Owner

I think using initials would be possible

@edgardmessias
Copy link
Contributor

You can use this: https://ui-avatars.com/

Example: https://www.gravatar.com/avatar/EMAIL_MD5?d=https%3A%2F%2Fui-avatars.com%2Fapi%2F/Lasse+Rafn/128

@marvingreenberg
Copy link

marvingreenberg commented Dec 9, 2019

Because we do something different with subversion, our commits do not have emails for the commit, instead just have a user name like jsmith. If I could do something like configure the gravatar like,

https://www.gravatar.com/avatar/${md5(author + '@business.domain.com')}.jpg?s=${size}&d=robohash

that would be cool, but it's a use-case that isn't worth any effort. Then we could set up a gravatar account just to hold developer pixs.

@edgardmessias
Copy link
Contributor

@JohnstonCode , maybe we can create a option to allow customization, with placeholders

@JohnstonCode
Copy link
Owner

@marvingreenberg It can be change to tkae usernames. My svn setup uses usernames over emails.

@edgardmessias Yes creating an option would be good. I need to have a real good look at the history stuff. Lots of issues rasied against it.

@marvingreenberg
Copy link

marvingreenberg commented Dec 9, 2019

@JohnstonCode I don't understand exactly. My svn setup uses usernames like yours. But you said the icon does a lookup in gravatar. There is no way to tell GRAVATAR to store an image for just a user name, like "jsmith" it has to be a unique email address like [email protected]

That was why I was suggesting you allow customizing the way the author is resolved to a hash. And actually, if you made that whole bit of "javascript"

https://www.gravatar.com/avatar/${md5(author)}.jpg?s=${size}&d=robohash

an internal configuration setting, but without any UI or anything, folks who cared could do things like switch from "robohash" to "monsterid" if they wanted to, or stand up their own "gravatar-like" server for their company (if they're insane).

P.S. there is a minor typo in johnstoncode.svn-scm for the svn:Gravatars settings ("use garavatar icons" instead of "use gravatar icons")

@JohnstonCode
Copy link
Owner

Currently it is randomly generated based on the MD5 hash of the author. But using somethnig like https://eu.ui-avatars.com/ we can get usernames to display as initials.

@marvingreenberg
Copy link

Just to be clear, I'm suggesting that a simple short term thing might be to add a new setting,

"svn.gravatar.icon_url": "https://www.gravatar.com/avatar/${md5(author)}.jpg?s=${size}&d=robohash"

Then folks could customize it, to use a different gravatar default or even default to ui-avatar.com like

  "svn.gravatar.icon_url": "https://www.gravatar.com/avatar/${md5(author)}.jpg?s=${size}&d=https%3A%2F%2Fui-avatars.com%2Fapi%2F/${author}/128"

which might not work without more work depending on the value of author

@JohnstonCode
Copy link
Owner

🎉 This issue has been resolved in version 2.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@spmeesseman
Copy link

i know this is closed but just a question and seemed senseless to open another ticket, i didn't know we had gravatar integration in the extension, that's cool, I'm confused too though, you mentioned you got this to work with just using usernames without the domain part of an email, how are you doing that?
Even with the new functionality with the placeholders, I can't construct it so that it adds "@domain.com" to the author name before performing the MD5 hash to form the url

@JohnstonCode
Copy link
Owner

JohnstonCode commented Feb 24, 2020

Will display the icons as initials CJ with a svn name of cjohnston
https://www.gravatar.com/avatar/<AUTHOR_MD5>.jpg?s=<SIZE>&d=https%3A%2F%2Fui-avatars.com%2Fapi%2F/<AUTHOR>/128

@spmeesseman
Copy link

yeah, i meant to use the actual gravatar icons though, without the ui-avatars. For example, a <AUTHOR<AUTHOR_DOMAIN>_MD5> type tag that would take an SVN username of 'smeesseman' and convert it to '[email protected]' before creating the MD5 hash to make the request to gravatar. I thought about it and its really not as simple as just an extra placeholder tag, but definitely possible. Would you accept a pull request if I could think up a good way to accomplish this?

@JohnstonCode
Copy link
Owner

Yeah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants