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-01-04] [$1000] IOS - Emoji chopped off from top in workspace name #26044

Closed
1 of 6 tasks
kbecciv opened this issue Aug 27, 2023 · 118 comments
Closed
1 of 6 tasks
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

@kbecciv
Copy link

kbecciv commented Aug 27, 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 settings-> Workspaces
  2. Click New Workspace -> Click Settings
  3. Rename with “:vertical_traffic_light::vertical_traffic_light::vertical_traffic_light::vertical_traffic_light:” -> Click Save

Expected Result:

Emoji with some height is being chopped off from top

Actual Result:

🚦 Emoji shouldn’t be chopped off

💥 Please note, this seems to be device-specific and will likely only affect smaller phones (for example, the issue was reproduced on an iPhone 11)💥

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.57.5
Reproducible in staging?: n/a
Reproducible in production?: n/a
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

Image from iOS (2)

Image from iOS (1)

Expensify/Expensify Issue URL:
Issue reported by: @DinalJivani
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692310024902729

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0119f528f80030b332
  • Upwork Job ID: 1696626363709296640
  • Last Price Increase: 2023-09-19
Issue OwnerCurrent Issue Owner: @johncschuster
@kbecciv kbecciv added Daily KSv2 Needs Reproduction Reproducible steps needed Bug Something is broken. Auto assigns a BugZero manager. labels Aug 27, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 27, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 27, 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

@DinalJivani
Copy link

@johncschuster
I am able to reproduce this issue on iPhone 11 iOS/Native App.
Not sure for about other devices though...

@johncschuster
Copy link
Contributor

Thanks for calling that out, @DinalJivani! I've updated the OP to indicate that this might be device-specific.

@johncschuster johncschuster added the External Added to denote the issue can be worked on by a contributor label Aug 29, 2023
@melvin-bot melvin-bot bot changed the title IOS - Emoji chopped off from top in workspace name [$1000] IOS - Emoji chopped off from top in workspace name Aug 29, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

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

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

melvin-bot bot commented Aug 29, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Aug 29, 2023

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

@dantastisk
Copy link
Contributor

Proposal

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

The 🚦-emoji is cut-off when used in the name of a workspace.

What is the root cause of that problem?

The root cause of the problem is the styles.textHeadline being applied to the element. The style combines variables.fontSizeXLarge with variables.lineHeightXXLarge, which causes the clipping as the line-height is simply not large enough for the font size. This happens everywhere that styles.textHeadline is used. Another example can be seen with the user displayname as can be seen here:

Screenshot of user page

8E2A30BF-D3A1-40D4-A370-994F9B76C2BF

The style gets applied here:

<Text
numberOfLines={1}
style={[styles.textHeadline, styles.alignSelfCenter, styles.pre]}
>
{policy.name}
</Text>

The style:
https://github.com/Expensify/App/blob/96a0db1aa2e239530f926b9bf62951f3c3408918/src/styles/styles.js#L382C1-L388

The variables in question:

fontSizeXLarge: 22,

lineHeightXXLarge: getValueUsingPixelRatio(27, 32),

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

A clean and simple fix is to change styles.textHeadline.lineHeight from variables.lineHeightXXLarge to variables.lineHeightXXXLarge. This ensures that it gets fixed everywhere and looks perfect as shown in the screenshots below.

Screenshot of workspace with fix

1E2265DA-0EA0-4A43-A3ED-E26478595943

Screenshot of user page with fix

0E4AFC78-BDAC-43AA-B2AE-07B54EB0B9D0

What alternative solutions did you explore? (Optional)

Alternative solutions include introducing a new style specifically for where styles.textHeadline is used and emojis might appear.

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

neonbhai commented Sep 2, 2023

Proposal

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

Emoji chopped off from top in workspace name

What is the root cause of that problem?

The 🚦 emoji in iOS is one of the tallest emojis and the headline Text elements that have to render it do not have enough lineHeight
This happens because the fontSize (referenced from variables.fontSizeXLarge and is hardcoded 22) is mismatched with lineHeight (referenced by variables.lineHeightXXLarge and calculated by:

lineHeightXXLarge: getValueUsingPixelRatio(27, 32),

function getValueUsingPixelRatio(defaultValue: number, maxValue: number): number {
return PixelRatio.getFontScale() * defaultValue > maxValue ? maxValue : defaultValue * PixelRatio.getFontScale();
}

which is a function)

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

We should these modifiations to the Headline lineheight.

Solution 1:

We should add a parameter to textheadline that would conditionally increase the fontsize if the parameter is true:

textHeadline: (shouldBeTall) = {
    ...headlineFont,
    ...whiteSpace.preWrap,
    color: themeColors.heading,
    fontSize: variables.fontSizeXLarge,

    //lineHeight conditionally set:
    lineHeight: shouldBeTall ? variables.lineHeightXXXLarge : variables.lineHeightXXLarge,
},

Solution 2:

We should add a CSS style called textHeadlineTall and increase the lineHeight in it:

textHeadline: {
    ...headlineFont,
    ...whiteSpace.preWrap,
    color: themeColors.heading,
    fontSize: variables.fontSizeXLarge,
    lineHeight: variables.lineHeightXXXLarge, // <--- lineHeight increased
},

This style should be applied to:

This is the cleaner approach and allows us to handpick where we need the Tall Headline (since the other pages DownloadAppModal.js, PDFInfoMessage.js, FeatureList.js, SaveTheWorldPage.js, JustSignedInModal.js, have hardcoded content in-app that doesn't need this)

What alternative solutions did you explore? (Optional)

xx

@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

@johncschuster, @fedirjh Huh... This is 4 days overdue. Who can take care of this?

@fedirjh
Copy link
Contributor

fedirjh commented Sep 5, 2023

Hey @neonbhai, @dantastisk Does this bug affect other emojis ? or it's just that specific emoji? to me, it seems like an emoji-device-specific edge case.

The proposed changes do not really make sense to me, They will affect other platforms and may cause different regression.

@johncschuster This bug seems to be an emoji/device-specific case, and it's an extremely edge case, I suggest we do nothing here.

@melvin-bot melvin-bot bot removed the Overdue label Sep 5, 2023
@dantastisk
Copy link
Contributor

@fedirjh It affects quite a few tall emojis. Also the issue gets increasingly worse as text size is decreased on the device and affects text too on the lower settings, especially letters with accents (see the Á in the screenshots below).

As for potential regressions, I've checked everywhere that the textHeadLine style is used, and my proposal doesn't seem to break anything. On the contrary it actually fixes the issue in other places as well (like the user displayname and the participant details in a report).

This is with the lowest text size setting:
BC7E3E6E-01E6-45A0-BCFD-565CD2D60F31

Same settings with the proposed fix:
28071255-9257-4564-9FB5-B92C7B371A70

@fedirjh
Copy link
Contributor

fedirjh commented Sep 5, 2023

especially letters with accents (see the Á in the screenshots below).

@dantastisk what device have you tested on?

This is what I get on iPhone 11

Screenshot 2023-09-05 at 4 29 48 PM

@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

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

@dantastisk
Copy link
Contributor

@dantastisk what device have you tested on?

The screenshots are from a physical iPhone XS.

I was not able to reproduce the bug on a simulated iPhone, initially, but I realize now, that this is because the bug is related to the device text size setting (in Settings -> Accessibility -> Display & Text Size -> Larger Text). As far as I can tell, the chopping only happens when this is set to the 3rd tick or lower, worsening as the text size is decreased.

image

I do not know how common it is to adjust these settings and what the policy is for supporting this, but this makes it seem like it should be supported:

/**
* Calculate the fontSize, lineHeight and padding when the device font size is changed, In most cases users do not change their device font size so PixelRatio.getFontScale() = 1 and this
* method always returns the defaultValue (first param). When the device font size increases/decreases, the PixelRatio.getFontScale() value increases/decreases as well.
* This means that if you have text and its 'fontSize' is 19, the device font size changed to the 5th level on the iOS slider and the actual fontSize is 19 * PixelRatio.getFontScale()
* = 19 * 1.11 = 21.09. Since we are disallowing font scaling we need to calculate it manually. We calculate it with: PixelRatio.getFontScale() * defaultValue > maxValue ? maxValue :
* defaultValue * PixelRatio getFontScale() This means that the fontSize is increased/decreased when the device font size changes up to maxValue (second param)
*/
function getValueUsingPixelRatio(defaultValue: number, maxValue: number): number {
return PixelRatio.getFontScale() * defaultValue > maxValue ? maxValue : defaultValue * PixelRatio.getFontScale();
}

@DinalJivani
Copy link

@dantastisk

I checked this Text size thing, default selection will be 3rd tick, When we go for larger size it actually works fine, But when you go to smallest size it chopped the emoji even more... Adding video for same below.

RPReplay_Final1694002465.mp4

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

@johncschuster, @fedirjh Eep! 4 days overdue now. Issues have feelings too...

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

melvin-bot bot commented Sep 11, 2023

@johncschuster, @fedirjh Eep! 4 days overdue now. Issues have feelings too...

@johncschuster
Copy link
Contributor

johncschuster commented Sep 12, 2023

@johncschuster This bug seems to be an emoji/device-specific case, and it's an extremely edge case, I suggest we do nothing here.

@fedirjh sorry I missed this comment! I'm a bit torn. Yes, I agree that part of this behavior seems a bit device-specific, but the Universal Font Size setting in iOS's Accessibility features might make this behavior more common. We can't really know how many of our users have increased the font size on their device, so we have no way of knowing how many people might be affected by this.

@Expensify/design, what are your thoughts on fixing this behavior? I kinda feel like we should fix it to ensure all folks are seeing New Expensify as we intend it to be seen.

Copy link

melvin-bot bot commented Dec 28, 2023

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

Copy link

melvin-bot bot commented Dec 28, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.18-8 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-01-04. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

  • @fedirjh requires payment (Needs manual offer from BZ)
  • @rezkiy37 does not require payment (Contractor)
  • @DinalJivani requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Dec 28, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@fedirjh] The PR that introduced the bug has been identified. Link to the PR:
  • [@fedirjh] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@fedirjh] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@fedirjh] Determine if we should create a regression test for this bug.
  • [@fedirjh] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@johncschuster / @stephanieelliott] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jan 4, 2024
@stephanieelliott stephanieelliott removed their assignment Jan 4, 2024
@johncschuster
Copy link
Contributor

Looks like I need to manually create the Upwork job since it wasn't automatically created. We were just discussing a new process for this today. I'll follow the process there and get this paid out.

@melvin-bot melvin-bot bot added the Overdue label Jan 8, 2024
Copy link

melvin-bot bot commented Jan 8, 2024

@johncschuster, @arosiclair, @fedirjh, @rezkiy37 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@johncschuster
Copy link
Contributor

johncschuster commented Jan 8, 2024

Payment Summary

@fedirjh requires payment by manual request of $1000
@rezkiy37 does not require payment (Contractor)
@DinalJivani - bug reporter - requires payment of $50 via Upwork

@melvin-bot melvin-bot bot removed the Overdue label Jan 8, 2024
@situchan
Copy link
Contributor

situchan commented Jan 8, 2024

There was regression

@johncschuster johncschuster reopened this Jan 8, 2024
@DinalJivani
Copy link

@johncschuster
Can you please create Upwork job and send me offer?

@melvin-bot melvin-bot bot added the Overdue label Jan 11, 2024
Copy link

melvin-bot bot commented Jan 12, 2024

@johncschuster, @arosiclair, @fedirjh, @rezkiy37 Whoops! This issue is 2 days overdue. Let's get this updated quick!

Copy link

melvin-bot bot commented Jan 16, 2024

@johncschuster, @arosiclair, @fedirjh, @rezkiy37 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@johncschuster
Copy link
Contributor

@DinalJivani, I invited you to the Upwork job. Can you please accept that so I can issue payment for the bug report?

@melvin-bot melvin-bot bot removed the Overdue label Jan 16, 2024
@DinalJivani
Copy link

@johncschuster
You sent offer for $50 instead of $250. This is old bug report.

@fedirjh
Copy link
Contributor

fedirjh commented Jan 16, 2024

@johncschuster Could you please invite me as well? I am already ineligible for the manual requests.

@DinalJivani
Copy link

@johncschuster
I had just accepted offer. Please approve $250 reporting bonus.

Thanks

@melvin-bot melvin-bot bot added the Overdue label Jan 18, 2024
@johncschuster
Copy link
Contributor

You sent offer for $50 instead of $250. This is old bug report.

@DinalJivani sorry about that. I just double-checked when the reporting bonus change was made, and I see it was August 30, while this was reported on August 17th. I've issued the corrected amount of $250.

@melvin-bot melvin-bot bot removed the Overdue label Jan 23, 2024
@johncschuster
Copy link
Contributor

@johncschuster Could you please invite me as well? I am already ineligible for the manual requests.

Sure thing, @fedirjh, I'll invite you now.

@fedirjh
Copy link
Contributor

fedirjh commented Jan 23, 2024

@johncschuster Thank you accepted.

@johncschuster
Copy link
Contributor

Payment has been issued! Thanks everyone!

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
None yet
Development

No branches or pull requests