feat: allow users to change user created workspace room avatar#72446
Conversation
…orkspaceOverviewPage
…-66883-65210/edit-room-avatar git commit --no-edit :wq
|
@samranahm Can you update this to use |
|
Fair point, I'll update it shortly along with system message. |
|
For the system message, it's going to be a new report action of type |
|
Also now the command accepts another parameter |
|
Got it |
|
Regarding permission, only room participants who are also workspace members can change the avatar, so for example if you invited someone to a room but they are not a a workspace member then they shouldn't see the option to change the avatar. This is also to align with room description changes. Let me know if you have any questions |
|
That is indeed a practical solution. I'll update this PR ASAP. |
|
@s77rt can you confirm if BE is now accepting |
|
Not yet, the relevant PRs are not merged yet |
|
Alright, I have updated the name here. |
|
Small update regarding permission: auditors can't change the avatar (even though they are effectively policy members and even if they are participants in the room) |
|
BE PR hit production couple of hours ago so you should be able to test Edit: Ah actually we are waiting on another PR too |
|
Waiting for Web-Expensify, will push the system message right after it. |
eh2077
left a comment
There was a problem hiding this comment.
I think we need to build optimistic system message for changing room avatar, right?
| /** The name associated with avatar */ | ||
| name?: string; |
There was a problem hiding this comment.
@eh2077 When we upload the avatar offline and refresh the page we get workspace default icon and that default icon should be workspace name's first letter but it's fallBack workspace building icon. So we are passing workspace name to get correct workspace icon.
…e text from report
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
|
@eh2077 PR ready, please take a look. |
| onyxMethod: Onyx.METHOD.MERGE, | ||
| key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, | ||
| value: { | ||
| [optimisticAction.reportActionID]: {pendingAction: null}, |
There was a problem hiding this comment.
Need to clear pending action from failureData too?
There was a problem hiding this comment.
Agree, we should clear pending action from failureData too.
| text: avatarUrl ? `changed room avatar` : 'removed the room avatar', | ||
| html: avatarUrl ? `<muted-text>changed room avatar</muted-text>` : '<muted-text>removed the room avatar</muted-text>', |
There was a problem hiding this comment.
I think this should be fine as translateLocal is deprecated.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-10-31.at.11.55.05.PM.movAndroid: mWeb ChromeScreen.Recording.2025-10-31.at.11.53.44.PM.moviOS: HybridAppScreen.Recording.2025-10-31.at.11.53.20.PM.moviOS: mWeb SafariScreen.Recording.2025-10-31.at.11.48.00.PM.movMacOS: Chrome / SafariScreen.Recording.2025-10-31.at.11.41.24.PM.movMacOS: DesktopScreen.Recording.2025-10-31.at.11.56.55.PM.mov |
|
@Beamanator This turned out to be a pretty deep one. If appropriate, maybe we could consider increasing the bounty? |
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 9.2.42-0 🚀
|
| if (isUserCreatedPolicyRoom(report)) { | ||
| return { | ||
| source: report?.avatarUrl ? getFullSizeAvatar(report.avatarUrl, 0) : undefined, | ||
| headerTitle: getReportName(report), | ||
| isWorkspaceAvatar: false, | ||
| }; | ||
| } |
There was a problem hiding this comment.
@samranahm these lines might be related to the deployment blocker. Can you take a look please? Thanks
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.2.42-11 🚀
|
| errors={report.errorFields?.avatar ?? null} | ||
| errorRowStyles={styles.mt6} | ||
| onErrorClose={() => clearAvatarErrors(report.reportID)} | ||
| style={[styles.w100, styles.mb3, styles.alignItemsStart, styles.sectionMenuItemTopDescription]} |
There was a problem hiding this comment.
Adding styles.sectionMenuItemTopDescription caused this alignment issue: #76647. That style seemed unnecessary so we have remove that in this PR: #77394
More details in this proposal: #76647 (comment)
Explanation of Change
Workspace member was not able to edit the room avatar, this PR introduce
AvatarWithImagePickerinRoomHeaderAvatarsto let non anonymous user to change room avatar.Fixed Issues
$ #65210
PROPOSAL: #65210 (comment)
Tests
Precondition:
[Admin]
changed the room avatarremoved the room avatarYou: removed the room avatar[Workspace member]
[Non Workspace member]
[An Auditor]
Offline tests
changed the room avatarremoved the room avatarQA Steps
Same as test
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android.native.mp4
Android: mWeb Chrome
Android.mWeb.chrome.mp4
iOS: Native
iOS: mWeb Safari
IOS.mWeb.safari.mp4
MacOS: Chrome / Safari
macOS.chrome.mp4
MacOS: Desktop
Desktop.mp4