Repository navigation
[HOLD on #21219] [$2000] Assign Task- The header "from" field shows "Fro..." instead of " From username/email id" #24339
Description
Activity
- addedDailyKSv2KSv2BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on Aug 9, 2023 Triggered auto assignment to @garrettmknight (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.Bug0 Triage Checklist (Main S/O)
- This "bug" occurs on a supported platform (ensure
Platformsin 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
- This "bug" occurs on a supported platform (ensure
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
Textcomponent 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
Textcomponent doesn't take full space is because of its inherent behavior as a text-rendering component. The width of theTextcomponent 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 aTextcomponent is essentially based on the width required to display its content without overflowing.
android textbreakstrategy explanation here and hereWhat 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
App/src/pages/home/HeaderView.js
Line 196 in 8d84c23
pressableStyles={[styles.alignSelfStart, styles.mw100]}
updated correct #24339 (comment)- when
styles.alignSelfStartits 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 understyles/HeaderViewStyle
index.js
index.android.js
index.js we can add
styles.alignSelfStartandstyles.mw100
in index.android.js we don't need that so we can declare an empty style on that. or in android applystyles.alignSelfStartandstyles.w100so that it will take full space.App/src/pages/home/HeaderView.js
Lines 193 to 197 in 1139e7c
<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
pressableStylesreturn empty style sheet.What alternative solutions did you explore? (Optional)
- when
- addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on Aug 10, 2023 - 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"[/+]on Aug 10, 2023 Job added to Upwork: https://www.upwork.com/jobs/~013e6bf0d4c8e7ce65
- addedHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributors
on Aug 10, 2023 Current assignee @garrettmknight is eligible for the External assigner, not assigning anyone new.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (
External)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.

📣 @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:- 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.
- 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.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.

Format:
Contributor details Your Expensify account email: <REPLACE EMAIL HERE> Upwork Profile Link: <REPLACE LINK HERE>259 remaining items
Load more actionsStill holding on #21219
Still holding on #21219
Still holding on #21219
Still holding on #21219
@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:
App/src/pages/home/HeaderView.tsx
Line 215 in 93dc1c9
pressableStyles={[styles.alignSelfStart, styles.mw100]} Here is the branch: https://github.com/WikusKriek/App/tree/24339-flexRow
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.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsFUTURE
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Eg- jaihanumanblog+hgfd@gmail.com
vincenzoddragon+five@gmail.com
Use a email id+ 4 letter word specifically like "five", " Life" to reproduce bug.
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?
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