-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Always generate avatar #6876
Always generate avatar #6876
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6876 +/- ##
============================================
+ Coverage 50.85% 50.89% +0.03%
- Complexity 24539 24557 +18
============================================
Files 1584 1584
Lines 93798 93891 +93
Branches 1358 1358
============================================
+ Hits 47704 47788 +84
- Misses 46094 46103 +9
|
Ah mmm so upating the JS is a tiny bit tricky as there is also some code to handle unknown users etc. |
So @tobiasKaminsky this is what you wanted right? @jancborchardt please checkout this branch and try to share etc. To see if there are no weird avatar hickups now. |
@rullzer this is great. So we can drop avatar generation once NC 12 has end of life :-) |
core/Controller/AvatarController.php
Outdated
/** | ||
* @NoAdminRequired | ||
* @NoCSRFRequired | ||
* @NoSameSiteCookieRequired |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove this? This is for example required when Collabora is embedding avatars since it runs under a different origin :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question
lib/private/Avatar.php
Outdated
|
||
$hsl = $this->rgbToHsl($rgb[0], $rgb[1], $rgb[2]); | ||
|
||
// Classic formulla to check the brigtness for our eye |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/formulla/formula/
lib/private/Avatar.php
Outdated
* @param double $h Heu in range [0, 1] | ||
* @param double $s Saturation in range [0, 1] | ||
* @param double $l Lightness in range [0, 1] | ||
* @return int[] Array containging r g b in the range [0, 255] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/containging/containing/
lib/private/Avatar.php
Outdated
} | ||
|
||
/** | ||
* @param double $h Heu in range [0, 1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/Heu/Hue/ maybe?
lib/private/Avatar.php
Outdated
@@ -210,4 +230,160 @@ private function getExtension() { | |||
} | |||
throw new NotFoundException; | |||
} | |||
|
|||
private function generateAvatar($userDisplayName, $size) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPDoc on the parameters would be awesome 😄
706ed5b
to
949fdc8
Compare
949fdc8
to
3e2ca98
Compare
3e2ca98
to
2c67928
Compare
Even if no avatar is set we should just generate the image. This to not duplicate the code on all the clients. And only server images from the avtar endpoint. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2c67928
to
8e8fe6b
Compare
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the font use semibold weight and made it a bit better centered, because it was slightly off.
I'm OK with that. This is also pretty nice for the top right menu list drop-down positioning issue we have here and there :) |
I like always having the avatar at the top 👍 |
Discussed with @LukasReschke on IRC and good to get in. |
@rullzer Seems to break the integration tests for sharing :/ See @danxuliu's comment in #6715 (comment) |
I know. I have a patch for that already |
|
Hm, in the past @karlitschek and I discussed this with avatar placeholder in top right and we didn’t really like it as it’s very present and colorful. However it kind of nudges you to set a proper image, so I guess it’s fine after all. :) |
Actually this causes a confusion with new users or installations. Cause in the top right the avatar is shown and not the settings icon, it is not immediately obvious where the settings are: (When you are used to the UI and added a picture, you also know where the settings are.) |
I disagree with you @jancborchardt ... this behaviour is known by the users from so many services ... not only by Nextcloud. To make it crystal clear we could show some arrows with descriptions in the firstrunwizard :) |
If it's known, we don't need a pointer for such an obvious menu in the first run wizard. ;) |
I guess the main problem is, that we don't have an indicator for menus. On github they put for example a little arrow beside the avatar to indicate the menu: |
@LukasReschke as discussed
Even if no avatar is set we should just generate the image. This to not
duplicate the code on all the clients. And only server images from the
avatar endpoint.
Todo:
Future work: