Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.54k stars 2.88k forks source link

[$250] [CVP] Replace the mention in the task preview with the assigned user's avatar #48409

Closed trjExpensify closed 1 month ago

trjExpensify commented 2 months ago

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: v9.0.27-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @trjExpensify Slack conversation: https://expensify.slack.com/archives/C07HPDRELLD/p1725028109496029 (Internal)

Action Performed:

  1. Sign-up on NewDot with a new account
  2. Choose an onboarding intent (i.e "Get paid back by my employer")
  3. Complete the onboarding steps
  4. Navigate to the Concierge DM to view the onboarding tasks created

Actual Result:

Assigned tasks include a mention of the assigned user in the task preview, but it makes it very difficult to avoid navigating to the assigned user's profile when clicking the task.

https://github.com/user-attachments/assets/14a29fd9-b33b-4450-9aa5-37b8d97105c3

Expected Result:

This is working as expected, but we want to change all assigned task previews to:

CleanShot 2024-08-30 at 11 13 55@2x

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround? Yes, click the right caret.

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

See above in-line.

View all open jobs on GitHub

CC: @Expensify/design @JmillsExpensify @anmurali @danielrvidal @puneetlath

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c485c16de75a6534
  • Upwork Job ID: 1830665670183169524
  • Last Price Increase: 2024-09-02
  • Automatic offers:
    • dukenv0307 | Reviewer | 103801280
    • dominictb | Contributor | 103801282
Issue OwnerCurrent Issue Owner: @zanyrenney
melvin-bot[bot] commented 2 months ago

Triggered auto assignment to @zanyrenney (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

melvin-bot[bot] commented 2 months ago

Triggered auto assignment to @dannymcclain (Design), see these Stack Overflow questions for more details.

dannymcclain commented 2 months ago

Also just for added clarity: this should be a global change to all tasks (not just the onboarding tasks).

trjExpensify commented 2 months ago

Yep, all tasks!

bernhardoj commented 2 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Show assignee avatar instead of the email for task preview.

What is the root cause of that problem?

New redesign.

What changes do you think we should make in order to solve the problem?

In TaskPreview,

  1. Get the assignee avatar

    const [assigneeAvatar] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetails => personalDetails?.[taskAssigneeAccountID]?.avatar});
  2. Replace the assignee mention with the avatar + task title https://github.com/Expensify/App/blob/e60b8210a1f5a2471d8aa9d84d0e461774b791d6/src/components/ReportActionItem/TaskPreview.tsx#L113

    {taskAssigneeAccountID > 0 && <Avatar
    containerStyles={[styles.mr2, styles.taskCheckboxWrapper]}
    source={assigneeAvatar}
    size={CONST.AVATAR_SIZE.SUBSCRIPT}
    avatarID={taskAssigneeAccountID}
    type={CONST.ICON_TYPE_AVATAR}
    />}
    <Text style={styles.flex1}>{taskTitle}</Text>
image
melvin-bot[bot] commented 2 months ago

Job added to Upwork: https://www.upwork.com/jobs/~01c485c16de75a6534

melvin-bot[bot] commented 2 months ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 (External)

dominictb commented 2 months ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Assigned tasks include a mention of the assigned user in the task preview, but it makes it very difficult to avoid navigating to the assigned user's profile when clicking the task.

What is the root cause of that problem?

When the task has assignee we'll render the mention

https://github.com/Expensify/App/blob/2c041292660d1d3b04cb2e19a72b56d16e70ef52/src/components/ReportActionItem/TaskPreview.tsx#L76-L77

What changes do you think we should make in order to solve the problem?

We should render the avatar when taskAssigneeAccountID>0 instead of mention and preserve the task preview style (strike through when task is done)

    const [avatar] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {selector: personalDetails => personalDetails?.[taskAssigneeAccountID]?.avatar});
    const htmlForTaskPreview = `<comment>${taskTitle}</comment>`;
...
                    {taskAssigneeAccountID > 0 && <Avatar
    containerStyles={[styles.mr2]}
    source={avatar}
    size={CONST.AVATAR_SIZE.SUBSCRIPT}
    avatarID={taskAssigneeAccountID}
    type={CONST.ICON_TYPE_AVATAR}
/>}
                    <RenderHTML html={isTaskCompleted ? `<completed-task>${htmlForTaskPreview}</completed-task>` : htmlForTaskPreview} />

since the taskTitle is just the plain text, so we can use taskTitle instead of htmlForTaskPreview

What alternative solutions did you explore? (Optional)

None

Result

Screenshot 2024-09-03 at 11 04 46
dukenv0307 commented 2 months ago

@dominictb's proposal LGTM. We should keep the completed task style

πŸŽ€πŸ‘€πŸŽ€ C+ reviewed

melvin-bot[bot] commented 2 months ago

Triggered auto assignment to @blimpich, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] commented 2 months ago

πŸ“£ @dukenv0307 πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] commented 2 months ago

πŸ“£ @dominictb πŸŽ‰ An offer has been automatically sent to your Upwork account for the Contributor role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Keep in mind: Code of Conduct | Contributing πŸ“–

dominictb commented 1 month ago

@zanyrenney This hit production but not sure when, no deploy message in PR https://github.com/Expensify/App/pull/48552.

blimpich commented 1 month ago

@zanyrenney This hit production but not sure when, no deploy message in PR https://github.com/Expensify/App/pull/48552.

Strange. Sorry about that @dominictb. @zanyrenney looks like this is ready for payment.

melvin-bot[bot] commented 1 month ago

@dannymcclain, @blimpich, @zanyrenney, @dukenv0307, @dominictb Eep! 4 days overdue now. Issues have feelings too...

dukenv0307 commented 1 month ago

@zanyrenney we should process payment. Thanks

zanyrenney commented 1 month ago

payment summary

paid $250 πŸ“£ @dukenv0307 πŸŽ‰ via UW. paid $250 πŸ“£ @dominictb πŸŽ‰ via UW.