Skip to content
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

[HOLD for payment 2024-11-13] [$250] Workspace - In android, WS report displays double spacing before&after user name/id #51409

Open
2 of 8 tasks
lanitochka17 opened this issue Oct 24, 2024 · 21 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 24, 2024

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.53-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team

Action Performed:

  1. Launch site in both mweb and hybrid app
  2. Tap profile icon -- workspaces -- workspace
  3. Tap invite- members
  4. Invite users with email id and user name
  5. Navigate to LHN and note the their workspace chat

Expected Result:

In android and mweb, the LHN text should displayed in same manner

Actual Result:

In android, there is double space before& after email id and user name on Workspace chat text in LHN but in mweb, single space only displayed

Workaround:

Unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

edit

chrome-edit

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021849941675546725686
  • Upwork Job ID: 1849941675546725686
  • Last Price Increase: 2024-10-25
  • Automatic offers:
    • ishpaul777 | Reviewer | 104654129
    • huult | Contributor | 104654130
Issue OwnerCurrent Issue Owner: @ishpaul777
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 24, 2024
Copy link

melvin-bot bot commented Oct 24, 2024

Triggered auto assignment to @sakluger (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
Copy link
Author

@sakluger 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

@sakluger
Copy link
Contributor

This feels like a pretty small bug, I'm going to set the price at $125. Feel free to let me know if you disgree.

@sakluger sakluger added the External Added to denote the issue can be worked on by a contributor label Oct 25, 2024
@melvin-bot melvin-bot bot changed the title Workspace - In android, WS report displays double spacing before&after user name/id [$250] Workspace - In android, WS report displays double spacing before&after user name/id Oct 25, 2024
Copy link

melvin-bot bot commented Oct 25, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 25, 2024
Copy link

melvin-bot bot commented Oct 25, 2024

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

@shahinyan11
Copy link

Edited by proposal-police: This proposal was edited at 2024-10-24 14:00:30 UTC.

Proposal

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

Workspace - In android, WS report displays double spacing before&after user name/id

What is the root cause of that problem?

There are spaces at the beginning or end of translations here and we add additional spaces during usage here

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

Remove spaces from this translations

  beginningOfChatHistoryPolicyExpenseChatPartOne: 'This is where',
  beginningOfChatHistoryPolicyExpenseChatPartTwo: 'will submit expenses to',
  beginningOfChatHistoryPolicyExpenseChatPartThree: 'workspace. Just use the + button.',

What alternative solutions did you explore? (Optional)

Do not add spaces on usage here

`${welcomeMessage.phrase1}${ReportUtils.getDisplayNameForParticipant(report?.ownerAccountID)}${welcomeMessage.phrase2}${ReportUtils.getPolicyName(
                report,
            )} ${welcomeMessage.phrase3}`

@huult
Copy link
Contributor

huult commented Oct 27, 2024

Proposal

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

WS report displays double spacing before&after user name/id

What is the root cause of that problem?

The welcome message text contains an extra space because welcomeMessage.phrase1 and welcomeMessage.phrase2 in getWelcomeMessage include spaces. As a result, the newly created string retains an extra space.

For getWelcomeMessage, we have 2 issue related extra space.

  1. The welcome message text L552 contains extra spaces because welcomeMessage.phrase1 and welcomeMessage.phrase2 n the translation include spaces.

App/src/languages/en.ts

Lines 674 to 675 in 652d2ff

beginningOfChatHistoryPolicyExpenseChatPartOne: 'This is where ',
beginningOfChatHistoryPolicyExpenseChatPartTwo: ' will submit expenses to ',

welcomeMessage.phrase1 = Localize.translateLocal('reportActionsView.beginningOfChatHistoryPolicyExpenseChatPartOne');
welcomeMessage.phrase2 = Localize.translateLocal('reportActionsView.beginningOfChatHistoryPolicyExpenseChatPartTwo');
welcomeMessage.phrase3 = Localize.translateLocal('reportActionsView.beginningOfChatHistoryPolicyExpenseChatPartThree');
welcomeMessage.messageText = `${welcomeMessage.phrase1} ${ReportUtils.getDisplayNameForParticipant(report?.ownerAccountID)} ${welcomeMessage.phrase2} ${ReportUtils.getPolicyName(

2 The welcome message text L596 if welcome message phrase1 that is beginningOfChatHistory

beginningOfChatHistory: 'This chat is with ',

welcomeMessage.phrase1 = Localize.translateLocal('reportActionsView.beginningOfChatHistory');

welcomeMessage.messageText = displayNamesWithTooltips.length ? `${welcomeMessage.phrase1} ${displayNamesWithTooltipsText}` : '';

For getRoomWelcomeMessage, we still have issue related extra space if welcome message phrase1 beginningOfArchivedRoomPartOne and beginningOfChatHistoryUserRoomPartOne

beginningOfArchivedRoomPartOne: 'You missed the party in ',

beginningOfChatHistoryUserRoomPartOne: 'This chat room is for anything ',

welcomeMessage.phrase1 = Localize.translateLocal('reportActionsView.beginningOfArchivedRoomPartOne');

welcomeMessage.phrase1 = Localize.translateLocal('reportActionsView.beginningOfChatHistoryUserRoomPartOne');

welcomeMessage.messageText = `${welcomeMessage.phrase1} ${welcomeMessage.showReportName ? ReportUtils.getReportName(report) : ''} ${welcomeMessage.phrase2 ?? ''}`;

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

To resolve this issue, we should create a function to remove extra spaces because there are many cases where the translation text includes spaces, while some translations do not. We shouldn't remove spaces from welcomeMessage.messageText, because we need to handle cases where welcomeMessage.phrase1 contains a space and cases where it does not. The code example would look something like this:

src/libs/SidebarUtils.ts#534
+        function ensureSingleSpacing(text: string) {
+                return text.replace(/\s+/g, ' ').trim();
+        }
src/libs/SidebarUtils.ts#552
-        welcomeMessage.messageText = `${welcomeMessage.phrase1} ${ReportUtils.getDisplayNameForParticipant(report?.ownerAccountID)} ${welcomeMessage.phrase2} ${ReportUtils.getPolicyName(
-                report,
-            )} ${welcomeMessage.phrase3}`;

+        welcomeMessage.messageText = ensureSingleSpacing(
+                `${welcomeMessage.phrase1} ${ReportUtils.getDisplayNameForParticipant(report?.ownerAccountID)} ${welcomeMessage.phrase2} ${ReportUtils.getPolicyName(report)} ${
+                        welcomeMessage.phrase3
+                }`,
+        );

src/libs/SidebarUtils.ts#602
-    welcomeMessage.messageText = displayNamesWithTooltips.length ? `${welcomeMessage.phrase1} ${displayNamesWithTooltipsText}` : '';
+    welcomeMessage.messageText = displayNamesWithTooltips.length ? ensureSingleSpacing(`${welcomeMessage.phrase1} ${displayNamesWithTooltipsText}`) : '';

src/libs/SidebarUtils.ts#644
-    welcomeMessage.messageText = `${welcomeMessage.phrase1} ${welcomeMessage.showReportName ? ReportUtils.getReportName(report) : ''} ${welcomeMessage.phrase2 ?? ''}`;
+    welcomeMessage.messageText = ensureSingleSpacing(`${welcomeMessage.phrase1} ${welcomeMessage.showReportName ? ReportUtils.getReportName(report) : ''} ${welcomeMessage.phrase2 ?? ''}`);

Copy link

melvin-bot bot commented Oct 29, 2024

@sakluger, @ishpaul777 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Oct 29, 2024
@ishpaul777
Copy link
Contributor

I'll review in few hours

@melvin-bot melvin-bot bot removed the Overdue label Oct 29, 2024
@ishpaul777
Copy link
Contributor

Proposal from @huult is complete and fixes all such double spacing issues hollistically. lets assign them!

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Oct 29, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 30, 2024
Copy link

melvin-bot bot commented Oct 30, 2024

📣 @ishpaul777 🎉 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

Copy link

melvin-bot bot commented Oct 30, 2024

📣 @huult 🎉 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 📖

@huult
Copy link
Contributor

huult commented Oct 30, 2024

Thank you all. I will create a PR within 24 hours

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Oct 30, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Oct 30, 2024
@melvin-bot melvin-bot bot changed the title [$250] Workspace - In android, WS report displays double spacing before&after user name/id [HOLD for payment 2024-11-13] [$250] Workspace - In android, WS report displays double spacing before&after user name/id Nov 6, 2024
Copy link

melvin-bot bot commented Nov 6, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 6, 2024
Copy link

melvin-bot bot commented Nov 6, 2024

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

If no regressions arise, payment will be issued on 2024-11-13. 🎊

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

Copy link

melvin-bot bot commented Nov 6, 2024

@ishpaul777 @sakluger The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 12, 2024
@sakluger
Copy link
Contributor

Hey @ishpaul777 please make sure to finish the BZ checklist before the payment date tomorrow.

@sakluger
Copy link
Contributor

Summarizing payment on this issue:

Contributor: @huult $250, paid via Upwork
Contributor+: @ishpaul777 $250, will pay via Upwork once BZ checklist is done

@ishpaul777
Copy link
Contributor

i'll fill out first thing tmrw 🙇

@sakluger
Copy link
Contributor

@ishpaul777 any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
Development

No branches or pull requests

6 participants