Skip to content

[HOLD on #21219] [$2000] Assign Task- The header "from" field shows "Fro..." instead of " From username/email id" #24339

Description

@lanitochka17

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:

  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- jaihanumanblog+hgfd@gmail.com
    vincenzoddragon+five@gmail.com
    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

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 9, 2023
  2. melvin-bot commented on Aug 9, 2023

    @melvin-bot

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

  3. melvin-bot commented on Aug 9, 2023

    @melvin-bot

    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
  4. pradeepmdk commented on Aug 10, 2023

    @pradeepmdk
    Contributor

    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)

  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 10, 2023
  6. 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
  7. melvin-bot commented on Aug 10, 2023

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 10, 2023
  9. melvin-bot commented on Aug 10, 2023

    @melvin-bot

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

  10. melvin-bot commented on Aug 10, 2023

    @melvin-bot

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

  11. gzqyl commented on Aug 11, 2023

    @gzqyl

    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

  12. melvin-bot commented on Aug 11, 2023

    @melvin-bot

    📣 @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>
    
  13. 259 remaining items

  14. garrettmknight commented on Apr 29, 2024

    @garrettmknight
    Contributor

    Still holding on #21219

  15. garrettmknight commented on May 30, 2024

    @garrettmknight
    Contributor

    Still holding on #21219

  16. garrettmknight commented on Jul 1, 2024

    @garrettmknight
    Contributor

    Still holding on #21219

  17. garrettmknight commented on Aug 5, 2024

    @garrettmknight
    Contributor

    Still holding on #21219

  18. WikusKriek commented on Aug 11, 2024

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

  19. garrettmknight commented on Aug 13, 2024

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsMonthlyKSv2

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions