-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Payment due date 7/30][$250] Remove "Upload photo" step for users who are adding a group image for the first time #42868
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01b0f3bb834f330c4f |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Remove "Upload photo" step for users who are adding a image for the first time What is the root cause of that problem?if the avatar having the default image then it means its the first time , thus we can enabled the 3 dot menu if the default image is shown What changes do you think we should make in order to solve the problem?
const openPickerRef = useRef<OpenPicker | null>(null);
{({openPicker}) => {
openPickerRef.current = openPicker;
if (isUsingDefaultAvatar) {
openPickerRef.current?.({
onPicked: showAvatarCropModal,
});
return;
} to clean the code more we can put the function inside the onSelect of the POCScreen.Recording.2024-05-30.at.11.23.30.PM.movoptional
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Remove "Upload photo" step for users who are adding a image for the first time What is the root cause of that problem?New feat What changes do you think we should make in order to solve the problem?We can accept a new prop in if (shouldSkipUploadPhotoPrompt && isMenuVisible) {
setIsMenuVisible(false);
openPicker({
onPicked: showAvatarCropModal,
});
return null;
} Apart from the prop we also need to check for App/src/components/AvatarWithImagePicker.tsx Line 369 in 6e230e9
We can also use What alternative solutions did you explore? (Optional) |
Proposal Updated
|
Proposal updatedfixed the rerendering issue |
ProposalPlease re-state the problem that we are trying to solve in this issue.Remove "Upload photo" step for users who are adding a group image for the first time What is the root cause of that problem?NA - New feature What changes do you think we should make in order to solve the problem?We already have the Attachment Picker setup here App/src/components/AvatarWithImagePicker.tsx Line 368 in 29148f6
Upload Photo and three menu options.
We shouldn't distrub the existing implementation as it is wrapped with The optiomal Solution is to updated the The change follows as below <View style={styles.w100}>
<AttachmentModal
headerTitle={headerTitle}
source={previewSource}
originalFileName={originalFileName}
fallbackSource={fallbackIcon}
maybeIcon={isUsingDefaultAvatar}
>
{({show}) => (
<AttachmentPicker type={CONST.ATTACHMENT_PICKER_TYPE.IMAGE}>
{({openPicker}) => {
const menuItems = createMenuItems(openPicker);
// If the current avatar isn't a default avatar and we are not overriding this behavior allow the "View Photo" option
if (!shouldDisableViewPhoto && !isUsingDefaultAvatar) {
menuItems.push({
icon: Expensicons.Eye,
text: translate('avatarWithImagePicker.viewPhoto'),
onSelected: () => {
if (typeof onViewPhotoPress !== 'function') {
show();
return;
}
onViewPhotoPress();
},
});
}
return (
<>
<OfflineWithFeedback
errors={errors}
errorRowStyles={errorRowStyles}
onClose={onErrorClose}
>
<Tooltip
shouldRender={!disabled}
text={translate('avatarWithImagePicker.editImage')}
>
<PressableWithoutFeedback
onPress={() => {
if (isUsingDefaultAvatar) {
openPicker({
onPicked: showAvatarCropModal,
});
return;
}
if (disabled && enablePreview && onViewPhotoPress) {
onViewPhotoPress();
return;
}
setIsMenuVisible((prev) => !prev);
}}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.IMAGEBUTTON}
accessibilityLabel={translate('avatarWithImagePicker.editImage')}
disabled={isAvatarCropModalOpen || (disabled && !enablePreview)}
disabledStyle={disabledStyle}
style={[styles.pRelative, avatarStyle, type === CONST.ICON_TYPE_AVATAR && styles.alignSelfCenter]}
ref={anchorRef}
>
<OfflineWithFeedback pendingAction={pendingAction}>
{source ? (
<Avatar
containerStyles={avatarStyle}
imageStyles={[avatarStyle, styles.alignSelfCenter]}
source={source}
avatarID={avatarID}
fallbackIcon={fallbackIcon}
size={size}
type={type}
/>
) : (
<DefaultAvatar />
)}
</OfflineWithFeedback>
{!disabled && (
<View style={StyleSheet.flatten([styles.smallEditIcon, styles.smallAvatarEditIcon, editIconStyle])}>
<Icon
src={editIcon}
width={variables.iconSizeSmall}
height={variables.iconSizeSmall}
fill={theme.icon}
/>
</View>
)}
</PressableWithoutFeedback>
</Tooltip>
</OfflineWithFeedback>
<PopoverMenu
isVisible={isMenuVisible}
onClose={() => setIsMenuVisible(false)}
onItemSelected={(item, index) => {
setIsMenuVisible(false);
// In order for the file picker to open dynamically, the click
// function must be called from within an event handler that was initiated
// by the user on Safari.
if (index === 0 && Browser.isSafari()) {
openPicker({
onPicked: showAvatarCropModal,
});
}
}}
menuItems={menuItems}
anchorPosition={shouldUseStyleUtilityForAnchorPosition ? styles.popoverMenuOffset(windowWidth) : popoverPosition}
anchorAlignment={{horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT, vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP}}
withoutOverlay
anchorRef={anchorRef}
/>
</>
);
}}
</AttachmentPicker>
)}
</AttachmentModal>
</View> What alternative solutions did you explore? (Optional)NA Kapture.2024-05-31.at.03.06.08.mp4 |
@mollfpr Whoops! This issue is 2 days overdue. Let's get this updated quick! |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
What alternative solutions did you explore? (Optional)
|
@mollfpr Eep! 4 days overdue now. Issues have feelings too... |
@mollfpr Huh... This is 4 days overdue. Who can take care of this? |
Will take a look at this in the morning! |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
The ref function solution seems promising, but I think it will be hard to follow where the ref gonna be used. Considering the ref is used outside the @b4s36t4 I tried your solution, but I got this error when trying to apply it. @Krishna2323 I got this error Screen.Recording.2024-06-07.at.19.36.56.mp4 |
@mollfpr Sorry, I might've missed checking it on web. The solution for that error is instead of wrapping the Updated code as follows.
|
@b4s36t4 It's working now. Although, I'm curious if we can just move the |
Yea I also thought the same, but thought it won't be feasible but I'm open to it. Do you want me to take a look at that approach as well @mollfpr ? |
@b4s36t4 Yeah, let's try it. |
Sure, I'll check and update you soon. |
@mollfpr I add the alternative solution that will use expose the |
@mollfpr I have tested the solution you suggested, it's working same expected. |
@b4s36t4 could you update your proposal with the new implementation? @jamesdeanexpensify I think we need to add the BZ label here. |
@mollfpr I did updated can you verify again please? |
Just a heads up - I'm going to be ooo until June 24th. I'm not going to assign anyone new but if you need a new BZ teammate for any reason please feel free to ask for one to be assigned here. |
I have checked our component that uses As I said, it's good to give attention to the performance issue but currently, we don't block any use of the inline function and it is used all over the place. Also, @tienifr if you can show the measurement for the performance issue between the two solutions that would be a huge consideration. |
Friendly bump @nkuoch |
Let's go with @b4s36t4 |
📣 @b4s36t4 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
update for Melvin - working on PR #44702 |
1 similar comment
update for Melvin - working on PR #44702 |
@Christinadobrzyn we waiting for the fix from @b4s36t4. It not much and I can finish the review after the update. |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
Just checking in on this - The PR is merged but we might have some deploy blockers? |
No, it's not related to this PR. It is deployed to prod as well, but I'm not sure why Melvin didn't give any message here. |
@Christinadobrzyn As per this comment #44702 (comment) this pr did hit the product on the 23rd which I feel is the starting day of the regression period. I don't know maybe because of deploy-blocker messages melvin didn't add the review messages here. Can you update the details here so that it won't be missed? Thanks! |
Thanks, @b4s36t4 - I'll add the payment details, as this should be paid today/tomorrow. Payouts due:
It's a new feature but do we want a regression test for this? |
I'm down with the regression test.
Also, requested the payment in ND. |
$250 approved for @mollfpr |
@Christinadobrzyn here's my profile - https://www.upwork.com/freelancers/~018f450a49ceab36aa. I have also accepted the offer sent by melvin when I got assigned to the issue. |
Regression test - https://github.com/Expensify/Expensify/issues/416898 Paid out based on this payment summary - #42868 (comment) Closing! |
Coming from this Slack thread, the first time you go to add a picture to a group chat, we add an extra (unnecessary) click/tap on "Upload photo":
Recommendation: When it's your first time adding a photo to a group chat, skip the "Upload photo" step and go straight to the step with the three options. Video of how it currently looks below.
RPReplay_Final1717037990.1.mov
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: