# User picture upload button

**URL:** <https://forum.xwiki.org/t/user-picture-upload-button/14042>\
**Category:** Development\
**Tags:** proposal, usability\
**Created:** [February 9, 2024, 2:08pm UTC](https://forum.xwiki.org/t/user-picture-upload-button/14042 "2024-02-09T14:08:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tkrieck](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tkrieck/32/6019_2.png) [@tkrieck](https://forum.xwiki.org/u/tkrieck)\
**Post date:** [February 9, 2024, 2:08pm UTC](https://forum.xwiki.org/t/user-picture-upload-button/14042/1 "2024-02-09T14:08:46Z")

</div>

Hey everyone, as I would like to start contributing code to XWiki I started to work on updating the button that our users go to change their profile photo (the yellowish pencil+photo icon on top of the user picture). A small enough job to get acquainted to the workflow.

This button has some problems like:

- It does not use the IconTheme, the image for the button is hardcoded.
- It is a little bit “hidden”. At least it took me a while to find it on the page.

 ![Screenshot 2024-02-07 at 09.33.46](https://forum.xwiki.org/uploads/default/original/2X/7/73a96163b9795ebee26ebc54e4f47515ae0552fc.png)

So I would like to propose a small change here to the version below:

 ![Screenshot 2024-02-07 at 10.43.34](https://forum.xwiki.org/uploads/default/original/2X/4/4b092f31007f3382d669fb8f01fe8f02db48f1c9.png)

I could also try to use the IconTheme here, but this means I would need to change the AttachmentSelector component, and this could turn in a much bigger task than I can handle alone without dev assistance. It also means that I could break something somewhere else without realizing.

I started a draft PR here, so if you have some suggestions on the code and design, please let me know. Thanks to @CharpentierLucas for the nice introduction on the workflow.

> <https://github.com/xwiki/xwiki-platform/pull/2862>
>
> \# Jira URL
> 
> https://jira.xwiki.org/browse/XWIKI-21833
> 
> \# Changes
> 
> \## Descr…iption
> 
> \* Changes the edit photo icon on the profile picture to a link beneath said photo.
> \* This was done because: 
> \* The current icon is a hardcoded reference to a silk icon.
> \* The current icon is placed in a way that's difficult to see for new users, as it does not follow the standard icon from the IconTheme.
> \* Updated the design of the profile picture to keep it aligned with the profile menu
> \* Removed box shadow and paddings
> 
> \## Clarifications
> 
> \* I started this work because it is small enough so it could be a nice introduction to contributing code to XWiki.
> \* As stated in the description we have hardcoded references to silk icon, I could try to update it to use the IconTheme, however this would need to be changed on the component AttachmentSelector so it's a deeper change.
> 
> \# Screenshots & Video
> 
> \*\*Before\*\*
> \<img width="998" alt="Screenshot 2024-02-07 at 09 33 46" src="https://github.com/xwiki/xwiki-platform/assets/149672322/60334b58-da0a-4fe1-a479-653dc6474815"\>
> 
> \*\*After\*\*
> \<img width="1012" alt="Screenshot 2024-02-07 at 10 43 34" src="https://github.com/xwiki/xwiki-platform/assets/149672322/d3dc17a8-8cd1-4620-b711-5021389e3d5d"\>
> 
> 
> 
> \# Executed Tests
> 
> \<!-- Especially important for regression fixes. 
> Indicate how changes were tested (e.g., what maven commands were run to validate them).
> \--\>
> 
> \# Expected merging strategy
> 
> \* Prefers squash: Yes 
> \* Backport on branches:
> \*

Thank you all for reading

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [February 9, 2024, 2:15pm UTC](https://forum.xwiki.org/t/user-picture-upload-button/14042/2 "2024-02-09T14:15:42Z")

</div>

> [@tkrieck](#):
>
> as I would like to start contributing code to XWiki

Awesome! 🙂

---

<div class="post-metadata">

**Author:** ![surli](https://forum.xwiki.org/user_avatar/forum.xwiki.org/surli/32/2687_2.png) [@surli](https://forum.xwiki.org/u/surli)\
**Post date:** [February 9, 2024, 2:17pm UTC](https://forum.xwiki.org/t/user-picture-upload-button/14042/3 "2024-02-09T14:17:38Z")

</div>

> [@tkrieck](#):
>
> I could also try to use the IconTheme here, but this means I would need to change the AttachmentSelector component, and this could turn in a much bigger task than I can handle alone without dev assistance. It also means that I could break something somewhere else without realizing.

It would be probably better to actually fix the AttachmentSelector: we should have the same pencil icon than we have for editing profile IMO.

Hmmm… having a second thought: the button could be a bit hidden if displayed on top of a picture, so maybe it’s better to provide a link behind it.

And I think it makes sense to fix it once for all.  
I don’t really recall about this part of the code but I can probably look to help if needed.

---

<div class="post-metadata">

**Author:** ![tkrieck](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tkrieck/32/6019_2.png) [@tkrieck](https://forum.xwiki.org/u/tkrieck)\
**Post date:** [October 25, 2024, 11:35am UTC](https://forum.xwiki.org/t/user-picture-upload-button/14042/4 "2024-10-25T11:35:25Z")

</div>

Since the PR was discussed, changed and merged, I am now closing this discussion and marked it as resolved.

Thank you all for your contributions!
