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 on #21219] [$2000] Assign Task- The header "from" field shows "Fro..." instead of " From username/email id" #24339

Closed
1 of 6 tasks
lanitochka17 opened this issue Aug 9, 2023 · 195 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Monthly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Aug 9, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

  1. Launch app
  2. Tap Fab plus button
  3. Tap assign task
  4. Enter any title and description
  5. Tap next
  6. Tap "assignee" to assign task to yourself
  7. Tap Share somewhere to select email id in this specific format
    Eg- [email protected]
    [email protected]
    Use a email id+ 4 letter word specifically like "five", " Life" to reproduce bug.
  8. Tap confirm task
  9. In task conversation page, note header "from" field

Expected Result:

In task conversation page, the header "from" field must show user name/ email id of contact which is selected for " Share somewhere "

Actual Result:

In task conversation page, the header "from" field shows "Fro..." instead of " From username/email id"

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.52.1

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Notes/Photos/Videos: Any additional supporting documentation

Bug6159239_after_plus_4letter_email_use.mp4
Bug6159239_2nd_4_letter_id.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~013e6bf0d4c8e7ce65
  • Upwork Job ID: 1689725638138093568
  • Last Price Increase: 2023-10-20
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 2023

Triggered auto assignment to @garrettmknight (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@pradeepmdk
Copy link
Contributor

pradeepmdk commented Aug 10, 2023

Proposal

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

Assign Task- The header "from" field shows "Fro..." instead of " From username/email id"

What is the root cause of that problem?

In React Native, the Text component does not automatically take the full available space within its parent container by default. This behavior is different from web-based HTML elements, where elements such as <div> automatically take the full width of their parent container.

The reason why the Text component doesn't take full space is because of its inherent behavior as a text-rendering component. The width of the Text component is determined by the size of its content, and it will wrap to the next line if the content exceeds the available width. The default width of a Text component is essentially based on the width required to display its content without overflowing.
android textbreakstrategy explanation here and here

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

If we want the Text component to take full space or expand to fill the available width of its parent container, we need to explicitly specify a width style for the Text component or use flexbox properties to control its dimensions.

 1) using flexbox `flex:1`

style={[styles.optionAlternateText]}

need add flex1
parent also need flex1
pressableStyles={[styles.alignSelfStart, styles.mw100]}

updated correct #24339 (comment)

  1. when styles.alignSelfStart its will not take full space. so that in android its not take up the full space.
    the problem is android only so we can create a platform based style file like this under styles/HeaderViewStyle
    index.js
    index.android.js

index.js we can add styles.alignSelfStart and styles.mw100
in index.android.js we don't need that so we can declare an empty style on that. or in android apply styles.alignSelfStart and styles.w100 so that it will take full space.

<ParentNavigationSubtitle
parentNavigationSubtitleData={parentNavigationSubtitleData}
parentReportID={props.report.parentReportID}
pressableStyles={[styles.alignSelfStart, styles.mw100]}
/>

in Pressable style

pressableStyles={headerViewStyle.pressableStyles}

headerViewStyle import basic of platform-based so in android pressableStyles return empty style sheet.

What alternative solutions did you explore? (Optional)

@garrettmknight garrettmknight added the External Added to denote the issue can be worked on by a contributor label Aug 10, 2023
@melvin-bot melvin-bot bot changed the title Assign Task- The header "from" field shows "Fro..." instead of " From username/email id" [$1000] Assign Task- The header "from" field shows "Fro..." instead of " From username/email id" Aug 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 10, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 10, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 10, 2023

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

@gzqyl
Copy link

gzqyl commented Aug 11, 2023

Proposal

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

Assign Task- The header "from" field shows "Fro..." instead of " From username/email id"

What is the root cause of that problem?

the root cause I had finally found, it is the issue on Android when layout the text content, if there's space in strings, then it will auto break to the new line when wrap, wrap means it has more than one line, and we setmaxlines = 1, then it will wrap, and will break at the space position, that's why we see it ellipsis at From..., as after "From" there's a space char.

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

replace the space char with unicode will solve this issue, and it will have no regression issues on other platforms as the layout does not change, and we just "escaped space char with unicode", I tested it, it works on mobile both, and web desktop.
For safely without any other issue on Android when there's some special chars make it unexpected break to new line, we could escape the string with unicode '\u200D'.
use unicode '\u00A0' no-break space replace the space char we need to have, ie, 'From ' to be 'From\u00A0', tell the os not to beak, we add '\u200D' before special chars, tell the os it will join, while not break to a new line.
The key to solve this issue is that we use the unicode features, to keep the display text same and let the os know how to do.
after we replace the white space ' ' with unicode '\u00A0', on Android, there maybe still some issue for some special chars, so we could map the string to chars, then check the char, if it is a white space, we use '\u00A0' replace it, if it is out of '/[a-zA-Z\d]/' test, we think it maybe a special char, then we add '\u200D' before it, for the normal text '/[a-zA-Z\d]/' just keep it as it is.

Optional Solution

use View layout on Android with platform specific, but it is not the real root cause solved solution, I preferred the unicode solution, text content will display to user same as before, but the issue on Android will disappear. The unicode does the magic.
Screenshot_1691739162

@melvin-bot
Copy link

melvin-bot bot commented Aug 11, 2023

📣 @gzqyl! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@gzqyl
Copy link

gzqyl commented Aug 11, 2023

Contributor details
Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~01e99782a01937e92c

just find that @foxmail.com can not be added slack channel, so I use google mail as a replace.

@melvin-bot melvin-bot bot added the Overdue label Aug 11, 2023
@gzqyl
Copy link

gzqyl commented Aug 12, 2023

I have already checked out branch, and will merge the latest main branch when I PR, hope this issue assign to me.

@pradeepmdk
Copy link
Contributor

@gzqyl don't create PR until assign you

1 similar comment
@pradeepmdk
Copy link
Contributor

@gzqyl don't create PR until assign you

@gzqyl
Copy link

gzqyl commented Aug 12, 2023

@pradeepmdk thanks for your reminding, I will not create PR, just save the solution at local branch, so that I can watch other issues, and when the issue assigned to me, I can quickly checkout the branch to fix the issue.

@abdulrahuman5196
Copy link
Contributor

Reviewing now

@melvin-bot melvin-bot bot removed the Overdue label Aug 13, 2023
@abdulrahuman5196
Copy link
Contributor

On @pradeepmdk 's proposal here, I agree that flex might be the right path to go, but the solution is not working for me.

Screenshot 2023-08-13 at 2 13 18 PM

@abdulrahuman5196
Copy link
Contributor

@gzqyl On your proposal here #24339 (comment), we would need to know what change you are expecting to make explained as per our contributing guidelines to review the proposal - https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md

@pradeepmdk
Copy link
Contributor

pradeepmdk commented Aug 13, 2023

@abdulrahuman5196 for me its working let's add my code here

App/src/components/ParentNavigationSubtitle.js
Screenshot 2023-08-13 at 4 51 28 PM

App/src/pages/home/HeaderView.js

Screenshot 2023-08-13 at 4 44 06 PM

Result
before flex1
Screenshot 2023-08-13 at 5 19 04 PM

after flex1

Screenshot 2023-08-13 at 5 19 52 PM

@melvin-bot
Copy link

melvin-bot bot commented Aug 17, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Aug 17, 2023
@garrettmknight
Copy link
Contributor

@abdulrahuman5196 can you review?

@melvin-bot melvin-bot bot removed the Overdue label Aug 17, 2023
@garrettmknight
Copy link
Contributor

Still holding on #21219

@melvin-bot melvin-bot bot removed the Overdue label Feb 5, 2024
@garrettmknight
Copy link
Contributor

Still holding on #21219

@garrettmknight garrettmknight added Monthly KSv2 and removed Monthly KSv2 Weekly KSv2 labels Feb 9, 2024
@garrettmknight
Copy link
Contributor

Dropping to monthly in line with the issue we're holding on.

@garrettmknight
Copy link
Contributor

Still holding

@garrettmknight
Copy link
Contributor

Updating to Future in VIP-VSB along with other task issues. Still on hold for the linked issue.

@melvin-bot melvin-bot bot added the Overdue label Apr 26, 2024
@garrettmknight
Copy link
Contributor

Still holding on #21219

@melvin-bot melvin-bot bot removed the Overdue label Apr 29, 2024
@melvin-bot melvin-bot bot added the Overdue label May 30, 2024
@garrettmknight
Copy link
Contributor

Still holding on #21219

@melvin-bot melvin-bot bot removed the Overdue label May 30, 2024
@melvin-bot melvin-bot bot added the Overdue label Jul 1, 2024
@garrettmknight
Copy link
Contributor

Still holding on #21219

@melvin-bot melvin-bot bot removed the Overdue label Jul 1, 2024
@melvin-bot melvin-bot bot added the Overdue label Aug 1, 2024
@garrettmknight
Copy link
Contributor

Still holding on #21219

@melvin-bot melvin-bot bot removed the Overdue label Aug 5, 2024
@WikusKriek
Copy link
Contributor

@garrettmknight @situchan
This issue is more than a year old, is it maybe worth trying one of the following?
Im not sure if #21219 is getting any closer to being resolved.

There are two good solutions to this problem:

One using TextLink

        <Text
            style={[styles.optionAlternateText]}
            accessibilityLabel={translate('threads.parentNavigationSummary', {reportName, workspaceName})}
            role={CONST.ROLE.LINK}
            numberOfLines={1}
            textBreakStrategy="highQuality"
        >
            {!!reportName && (
                <>
                    <Text style={[styles.optionAlternateText, styles.textLabelSupporting]}>{`${translate('threads.from')} `}</Text>
                    <TextLink
                        onPress={() => {
                            const parentAction = ReportActionsUtils.getReportAction(parentReportID, parentReportActionID ?? '-1');
                            const isVisibleAction = ReportActionsUtils.shouldReportActionBeVisible(parentAction, parentAction?.reportActionID ?? '-1');
                            // Pop the thread report screen before navigating to the chat report.
                            Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID));
                            if (isVisibleAction && !isOffline) {
                                // Pop the chat report screen before navigating to the linked report action.
                                Navigation.goBack(ROUTES.REPORT_WITH_ID.getRoute(parentReportID, parentReportActionID));
                            }
                        }}
                        style={[styles.optionAlternateText, styles.textLabelSupporting, styles.link]}
                    >
                        {reportName || (workspaceName ? `${translate('threads.in')} ${workspaceName}` : '')}
                    </TextLink>
                </>
            )}
        </Text>
    );
}

Here is the branch: https://github.com/WikusKriek/App/tree/24339-textlink
And the other using FlexRow and Flex1:

The below style needs styles.flex1

style={[styles.optionAlternateText]}

And HeaderView needs styles.flexRow:

pressableStyles={[styles.alignSelfStart, styles.mw100]}

Here is the branch: https://github.com/WikusKriek/App/tree/24339-flexRow

@garrettmknight
Copy link
Contributor

Reviewing this, I actually think this issue is such a low priority consistency issue that we can probably close now and reopen only if it's reported as a bug by an actual user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Monthly KSv2
Projects
No open projects
Development

No branches or pull requests