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][$1000] Web- Preferences - The recent mode description is truncated in Spanish preference #17509

Closed
1 of 6 tasks
kbecciv opened this issue Apr 17, 2023 · 70 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. 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 Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Apr 17, 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. Go to Web chrome
  2. Change language to Spanish
  3. Go to preferences and mode
  4. See that the description is truncated at the end

Expected Result:

The recent description should not be truncated at the end and should be shown in two lines

Actual Result:

The recent description is truncated at the end

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.0.0

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

spanish-2023-04-16_10.36.32.mp4

image (33)

Expensify/Expensify Issue URL:

Issue reported by: @avi-shek-jha

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1681621048024679

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01decf2433726a790f
  • Upwork Job ID: 1648665877492830208
  • Last Price Increase: 2023-05-03
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Apr 17, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

MelvinBot commented Apr 17, 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

@allroundexperts
Copy link
Contributor

Proposal

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

Web- Preferences - The recent mode description is truncated in Spanish preference

What is the root cause of that problem?

The root cause of this issue is that we're setting alternateTextMaxLines property to undefined in the OptionList item object. This can be seen here. Setting this to undefined causes the default value of this prop to be equal to 1. Thus the OptionRow component is only showing 1 line for the alternate text. This can be verified here.

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

We can set alternateTextMaxLines property to be 2 here. However, after looking at the commits against this line, it looks like this might cause the Android app to crash. As such, I think we need to add this to web only.

What alternative solutions did you explore? (Optional)

We can also make the default value of maxLines to be undefinedinstead of 1. This can be done by changing this line to:

...lodashGet(this.props.option, 'alternateTextMaxLines') && {numberOfLines: lodashGet(this.props.option, 'alternateTextMaxLines')}

We'll also need to change this line to:

lodashGet(this.props.option, 'alternateTextMaxLines') === 1 ? styles.pre : styles.preWrap

@flaviadefaria flaviadefaria added the External Added to denote the issue can be worked on by a contributor label Apr 19, 2023
@melvin-bot melvin-bot bot changed the title Web- Preferences - The recent mode description is truncated in Spanish preference [$1000] Web- Preferences - The recent mode description is truncated in Spanish preference Apr 19, 2023
@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

@MelvinBot
Copy link

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

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

Proposal

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

The recent mode description is truncated in Spanish preference

What is the root cause of that problem?

Option of priorityModes have property alternateTextMaxLines is undefined.

alternateTextMaxLines: undefined,

Then, style white-space: "pre" is applied. So that when text description is too long it will be truncated.
const alternateTextStyle = StyleUtils.combineStyles(textStyle, styles.optionAlternateText, styles.textLabelSupporting, this.props.style,

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

Change alternateTextMaxLines to 2

alternateTextMaxLines: undefined,

What alternative solutions did you explore? (Optional)

NA

Result

Screencast.from.18-04-2023.16.53.06.webm

@MelvinBot
Copy link

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

@bernhardoj
Copy link
Contributor

As @allroundexperts mentioned and this comment #15130 (comment), numberOfLines 0 with lineHeight style will throw an error on Android, but this only happens on our fork. It could be means that something missed when we are upgrading the react native. I think we should investigate that.

@s77rt
Copy link
Contributor

s77rt commented Apr 20, 2023

@dukenv0307 Thanks for the proposal. Your RCA seems about right. But I think the fix can be improved. We want alternateTextMaxLines to take as many lines as needed and not just limited to 2.

@allroundexperts
Copy link
Contributor

@s77rt Any feedback on my proposal?

@s77rt
Copy link
Contributor

s77rt commented Apr 20, 2023

@bernhardoj Right, this is a regression from #15130 (bdf2820). We should have kept alternateTextMaxLines set to 0 not to restrict the number of lines. Setting alternateTextMaxLines to undefined is basically the same as setting it to 1 since we use lodashGet here where we fallback to 1.

cc @priyeshshah11 @aimane-chnaif @roryabraham

@s77rt
Copy link
Contributor

s77rt commented Apr 20, 2023

@allroundexperts Oh so sorry, I didn't see the proposal it was before Help Wanted label. I used to only review proposals below that 😅 Checking now...

@s77rt
Copy link
Contributor

s77rt commented Apr 20, 2023

@allroundexperts Thanks for the proposal. I agree with you on the RCA. But I don't think setting alternateTextMaxLines to 2 will crash the App, will it? If not then that would be our backup plan.

We can't really keep running from fixing the RN bug especially since it only happens on our fork (based on @bernhardoj comment). What I'm looking for here is to be able to set alternateTextMaxLines back to 0 and fix the Android crash.

@aimane-chnaif
Copy link
Contributor

What I'm looking for here is to be able to set alternateTextMaxLines back to 0 and fix the Android crash.

Agreed this is permanent solution. We had to set this as emergency on that PR to upgrade RN version asap.

@dukenv0307
Copy link
Contributor

dukenv0307 commented Apr 20, 2023

@s77rt I think if we want to improve alternateTextMaxLines we need to set value to it in OptionRow depend on this.props.option.alternateText and width of wrap content

@allroundexperts
Copy link
Contributor

@s77rt Why isn't our fork up to date with the upstream? Do we want to fix this by cherry-picking the upstream commit that fixes this?

@s77rt
Copy link
Contributor

s77rt commented Apr 20, 2023

@dukenv0307 We want to set it to 0 and fix the Android crash.

@s77rt
Copy link
Contributor

s77rt commented Apr 20, 2023

@allroundexperts I think the bug only exists on our fork and not on RN. I'm not sure if this was ever a bug upstream that was fixed or it's just a bug that was introduced in our fork.

@dukenv0307
Copy link
Contributor

dukenv0307 commented Apr 21, 2023

@s77rt I tried to test this bug in main branch of my fork after sync fork. I used correctly version RN and then it crashed in Android when set alternateTextMaxLines to 0, but it's not happen when I reverted version RN to v0.71.2-alpha.0

@s77rt
Copy link
Contributor

s77rt commented Apr 21, 2023

@dukenv0307 Thanks for the confirmation. Do you have any suggestion on how we can fix the Android crash?

@dukenv0307
Copy link
Contributor

dukenv0307 commented Apr 21, 2023

@s77rt I think the root problem of the Android crash is this PR when apply numberOfLines and maximumNumberOfLines props on iOS and Android in new version RN

@marcochavezf
Copy link
Contributor

On hold

@melvin-bot melvin-bot bot removed the Overdue label Jul 7, 2023
@melvin-bot melvin-bot bot added the Overdue label Jul 17, 2023
@marcochavezf
Copy link
Contributor

Still on hold

@melvin-bot melvin-bot bot removed the Overdue label Jul 17, 2023
@melvin-bot melvin-bot bot added the Overdue label Jul 25, 2023
@marcochavezf
Copy link
Contributor

Still on hold

@melvin-bot melvin-bot bot removed the Overdue label Jul 25, 2023
@melvin-bot melvin-bot bot added the Overdue label Aug 3, 2023
@marcochavezf
Copy link
Contributor

Still on hold

@melvin-bot melvin-bot bot removed the Overdue label Aug 4, 2023
@aimane-chnaif
Copy link
Contributor

This is fixed in #18507

@s77rt
Copy link
Contributor

s77rt commented Aug 4, 2023

@marcochavezf @flaviadefaria This seems fixed already. I think we can close this? or pay the bug reporter and close

@melvin-bot melvin-bot bot added the Overdue label Aug 14, 2023
@marcochavezf
Copy link
Contributor

Do you know by chance if this issue was reported in another GH issue?

@melvin-bot melvin-bot bot removed the Overdue label Aug 14, 2023
@aimane-chnaif
Copy link
Contributor

This was a regression from RN upgrade v0.71.2-alpha.3 in #15130 which used our own forked RN.
And fixed by another RN upgrade 0.72.1 in #18507 which deprecated our own forked RN.

@melvin-bot melvin-bot bot added the Overdue label Aug 23, 2023
@s77rt
Copy link
Contributor

s77rt commented Aug 23, 2023

Can we close this?

@melvin-bot melvin-bot bot removed the Overdue label Aug 23, 2023
@avi-shek-jha
Copy link

Will I get paid for this?

@melvin-bot melvin-bot bot added the Overdue label Sep 1, 2023
@flaviadefaria
Copy link
Contributor

Yes let's close this.
@avi-shek-jha no you won't get paid for this one as this was spotted and fixed in a different issue.

@melvin-bot melvin-bot bot removed the Overdue label Sep 1, 2023
@avi-shek-jha
Copy link

This is fixed in #18507

@flaviadefaria I see that the other issue was created after my issue. So I guess, I should be the initial reporter for this issue. Thanks.

@flaviadefaria
Copy link
Contributor

Hmm, but my understanding is that this was fixed not based on your report that's why there should be no payment. If it were based on your report then you would get paid.

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. 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 Weekly KSv2
Projects
None yet
Development

No branches or pull requests