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.29k stars 2.72k forks source link

[$250] [HOLD for payment 2024-08-07] [HOLD for payment 2024-08-05] Room - System message for clearing room description is copied differently #45522

Closed lanitochka17 closed 3 weeks ago

lanitochka17 commented 1 month 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: 9.0.7-4 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4728014 Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to FAB > Start chat > Room
  3. Create a room
  4. Click on the report header
  5. Click Room description
  6. Enter description and save it
  7. Click Room description again
  8. Clear description and save it
  9. Go back to room chat
  10. Right click on "set the room description to:" system message > Copy to clipboard
  11. Paste the content in the composer

Expected Result:

The copied content should be consistent with the room description system message

Actual Result:

The room description system message is "set the room description to: " The copied content is "cleared the room description"

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/4763fc8e-ec8c-4a18-8e65-957a5109bcaf

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01db9b6412780cbcba
  • Upwork Job ID: 1821275096672049251
  • Last Price Increase: 2024-08-07
melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @alexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

lanitochka17 commented 1 month ago

@alexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

FitseTLT commented 1 month ago

Proposal

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

Room - System message for clearing room description is copied differently

What is the root cause of that problem?

For UPDATE_ROOM_DESCRIPTION type report action, there is an inconsistency between how the report action is displayed as in here https://github.com/Expensify/App/blob/1465a9294f5ff357fb30f55c1e90df791c73cd29/src/pages/home/report/ReportActionItem.tsx#L652-L653 and how text is copied to clipboard https://github.com/Expensify/App/blob/1465a9294f5ff357fb30f55c1e90df791c73cd29/src/pages/home/report/ContextMenu/ContextMenuActions.tsx#L366-L367

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

We need to copy to clipboard same as we are displaying the UPDATE_ROOM_DESCRIPTION type report action as in here https://github.com/Expensify/App/blob/1465a9294f5ff357fb30f55c1e90df791c73cd29/src/pages/home/report/ReportActionItem.tsx#L652-L653 by adding condition for UPDATE_ROOM_DESCRIPTION type report action here https://github.com/Expensify/App/blob/1465a9294f5ff357fb30f55c1e90df791c73cd29/src/pages/home/report/ContextMenu/ContextMenuActions.tsx#L420-L421

else if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.UPDATE_ROOM_DESCRIPTION) {
                    const originalMessage = ReportActionsUtils.getOriginalMessage(reportAction);

                    const message = `${Localize.translateLocal('roomChangeLog.updateRoomDescription')} ${(originalMessage as OriginalMessageChangeLog)?.description}`;

                    Clipboard.setString(message);
}

What alternative solutions did you explore? (Optional)

We can also alternatively change what we are diplaying in ReportActionItem to be the same as the cleared .. message , which is the same as the value we use to copy to clipboard now as in here https://github.com/Expensify/App/blob/1465a9294f5ff357fb30f55c1e90df791c73cd29/src/pages/home/report/ContextMenu/ContextMenuActions.tsx#L366-L367

so we can set the message to it here https://github.com/Expensify/App/blob/1465a9294f5ff357fb30f55c1e90df791c73cd29/src/pages/home/report/ReportActionItem.tsx#L651-L653

nkdengineer commented 1 month ago

Proposal

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

The room description system message is "set the room description to: " The copied content is "cleared the room description"

What is the root cause of that problem?

We always display the message set the room description to: in LHN and report action even we clear the description.

https://github.com/Expensify/App/blob/52b8fddcda6177b4bf4aa9a803853a1b2670daef/src/pages/home/report/ReportActionItem.tsx#L652-L655

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

We should display the cleared message like the message that is returned by BE if the description is empty

Screenshot 2024-07-17 at 14 02 51
  1. Create a new translation key for cleared message
  2. Create a util to get the update description message
function getUpdateRoomDescriptionMessage(reportAction: ReportAction): string {
    const originalMessage = getOriginalMessage(reportAction) as OriginalMessageChangeLog;
    if (originalMessage.description) {
        return `${Localize.translateLocal('roomChangeLog.updateRoomDescription')} ${originalMessage?.description}`;
    }

    return Localize.translateLocal('roomChangeLog.clearRoomDescription');
}
  1. Use this function here to get the action message to display in report screen and LHN
const message = ReportActionsUtils.getUpdateRoomDescriptionMessage(action);

https://github.com/Expensify/App/blob/52b8fddcda6177b4bf4aa9a803853a1b2670daef/src/pages/home/report/ReportActionItem.tsx#L652-L655

result.alternateText = `${lastActorDisplayName} ${ReportActionsUtils.getUpdateRoomDescriptionMessage(lastAction)};

https://github.com/Expensify/App/blob/52b8fddcda6177b4bf4aa9a803853a1b2670daef/src/libs/SidebarUtils.ts#L424-L428

OPTIONAL: We can also add the case for update room description in context menu action. So the copied message can be translated

https://github.com/Expensify/App/blob/52b8fddcda6177b4bf4aa9a803853a1b2670daef/src/pages/home/report/ContextMenu/ContextMenuActions.tsx#L364

What alternative solutions did you explore? (Optional)

NA

alexpensify commented 1 month ago

Other GHs have been a priority, I'll review soon

melvin-bot[bot] commented 1 month ago

Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

melvin-bot[bot] commented 1 month ago

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

alexpensify commented 1 month ago

@hungvu193 - can you review if one of these proposals will fix this problem? Thanks!

hungvu193 commented 1 month ago

Sure thing. I'll review today

hungvu193 commented 1 month ago

I lean toward to @nkdengineer 's proposal here. We should display clear the room description instead of unformatted message.

🎀 👀 🎀 C+ reviewed

melvin-bot[bot] commented 1 month ago

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

hungvu193 commented 1 month ago

@kavimuru Please wait for this PR then re-test this again.

melvin-bot[bot] commented 1 month ago

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] commented 1 month ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.13-4 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-08-05. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 1 month ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

melvin-bot[bot] commented 1 month ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.14-6 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-08-07. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 1 month ago

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

alexpensify commented 1 month ago

Noted that the payment date is on August 7

melvin-bot[bot] commented 4 weeks ago

Payment Summary

Upwork Job

BugZero Checklist (@alexpensify)

melvin-bot[bot] commented 4 weeks ago

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

melvin-bot[bot] commented 4 weeks ago

Current assignee @hungvu193 is eligible for the External assigner, not assigning anyone new.

alexpensify commented 4 weeks ago

@nkdengineer - please accept the invite in Upwork and I can complete the payment process - Thanks!

https://github.com/Expensify/App/issues/45522#issuecomment-2274038463

hungvu193 commented 4 weeks ago

Regression test:

  1. Go to staging.new.expensify.com
  2. Go to FAB > Start chat > Room
  3. Create a room
  4. Click on the report header
  5. Click Room description
  6. Enter the description and save it
  7. Click Room description again
  8. Clear description and save it
  9. Go back to room chat
  10. Right-click on the system message and choose copy.
  11. Paste it into composer and verify it has correct content.

Do we 👍 or 👎 ?

alexpensify commented 3 weeks ago

There is no update; waiting for @nkdengineer to accept the Upwork invite before I can close this GH.

alexpensify commented 3 weeks ago

No update

nkdengineer commented 3 weeks ago

@alexpensify I accepted the offer, thanks

alexpensify commented 3 weeks ago

I'm all set here. I've completed the payment process in Upwork. I'll return later this week to complete the regression test.

https://github.com/Expensify/App/issues/45522#issuecomment-2274038463

JmillsExpensify commented 3 weeks ago

$250 approved for @hungvu193