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 2023-08-01] [$1000] IOS - The text below the input flickers upon typing the first character #22583

Closed
1 of 6 tasks
kbecciv opened this issue Jul 10, 2023 · 34 comments
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 Jul 10, 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. Login to ND
  2. Go to settings > Security > Close account
  3. Type a message
  4. Observe flickering of the text (Please type your default contact method...)

Expected Result:

The text below the input should not flicker when typing the first character

Actual Result:

The text below the input flickers when typing the first character

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.37-7
Reproducible in staging?: y
Reproducible in production?: y
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

RPReplay_Final1688985350.mov
RPReplay_Final1689017306.MP4

Expensify/Expensify Issue URL:
Issue reported by: @aman-atg
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688995973983469

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01aade6c9bc04abd1e
  • Upwork Job ID: 1679245439165247488
  • Last Price Increase: 2023-07-12
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 10, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 10, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 10, 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

@ahmdshrif
Copy link
Contributor

ahmdshrif commented Jul 10, 2023

Proposal

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

hat the text input's height changes when we enter text into it.

What is the root cause of that problem?

The current implementation of the auto grow text input calculates the input height by rendering text outside the screen, measuring its height, and setting it as the height of the text input. However, there is an issue where the minimum height is not properly handled in iOS. The height property overrides the minHeight property, which results in the input height potentially becoming smaller than the specified minHeight.

The root cause of this problem is the missing check for the minimum height when setting the input height. The current implementation only checks if the calculated height is greater than the maxHeight, but it doesn't consider the case where the calculated height is less than the minHeight.

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

we need to check in autoGrowHeightInputContainer furnction if the high is less the min hight we will set hight to minHight .

  autoGrowHeightInputContainer: (textInputHeight, maxHeight) => {
        const minHeight= variables.componentSizeLarge;
        let height = textInputHeight;
        if (height >= maxHeight) {
            height = maxHeight;
        } else if (height <= minHeight){
            height = minHeight;
        }
        return{
            height,
            minHeight,
        }
    }

What alternative solutions did you explore? (Optional)

N/A

Result :

Simulator.Screen.Recording.-.iPhone.14.-.2023-07-11.at.00.20.29.mp4

@dhairyasenjaliya
Copy link
Contributor

this looks expected as we discussed here #20904 (comment)

@ahmdshrif
Copy link
Contributor

ahmdshrif commented Jul 10, 2023

@dhairyasenjaliya I don't think it's expected ... The problem arises when the height changes as we start typing, whereas we expect the height to remain consistent when the input is focused and contains only one line. but from comment you mention we expect the text input to change height when we have more than one line.

@dhairyasenjaliya
Copy link
Contributor

ah ok looks different bug than thnx @ahmdshrif

@Tushu17
Copy link
Contributor

Tushu17 commented Jul 11, 2023

Proposal

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

The height of text input changes after typing the first character.

What is the root cause of that problem?

The issue is caused by the height property overriding the minHeight property, leading to the input height potentially becoming smaller than the specified minHeight. The root cause is in the absence of a check for the minimum height when setting the input height.

App/src/styles/styles.js

Lines 862 to 865 in a51f7c7

autoGrowHeightInputContainer: (textInputHeight, maxHeight) => ({
height: textInputHeight >= maxHeight ? maxHeight : textInputHeight,
minHeight: variables.componentSizeLarge,
}),

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

We can ensure that the input height is calculated based on the provided textInputHeight value while considering the constraints of both the minimum height and the maximum height. The Math.min() function is used to ensure that the calculated height does not exceed the maxHeight, the minHeight property is explicitly set to maintain the specified minimum height.

autoGrowHeightInputContainer: (textInputHeight, maxHeight) => ({
        height: Math.min(Math.max(textInputHeight, variables.componentSizeLarge), maxHeight),
        minHeight: variables.componentSizeLarge,
    })

What alternative solutions did you explore? (Optional)

We can use the ternary operator to conditionally set the value of height.

autoGrowHeightInputContainer: (textInputHeight, maxHeight) => {
        const height = textInputHeight < variables.componentSizeLarge ? variables.componentSizeLarge : textInputHeight > maxHeight ? maxHeight : textInputHeight;

        return {
            height,
            minHeight: variables.componentSizeLarge,
        };
    }

Result

Screen.Recording.2023-07-11.at.5.23.49.AM.mov

@melvin-bot melvin-bot bot added the Overdue label Jul 12, 2023
@michaelhaxhiu michaelhaxhiu added the External Added to denote the issue can be worked on by a contributor label Jul 12, 2023
@melvin-bot melvin-bot bot changed the title IOS - The text below the input flickers upon typing the first character [$1000] IOS - The text below the input flickers upon typing the first character Jul 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

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

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

melvin-bot bot commented Jul 12, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

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

@michaelhaxhiu
Copy link
Contributor

Fielding proposals!

@melvin-bot melvin-bot bot removed the Overdue label Jul 12, 2023
@nampham7394
Copy link

Hi,
I found that the height of TextInput's Container View is greater than the mininum height. Just put another condition to set height value is at least minimum height value.
Besides that, getAutoGrowHeightInputStyle function also set height of view to the something value and then I replace it to minimum height (the same value we put above) It works well.

Screen.Recording.2023-07-14.at.12.22.16.mov

@melvin-bot

This comment was marked as resolved.

@nampham7394

This comment was marked as resolved.

@melvin-bot

This comment was marked as resolved.

@melvin-bot melvin-bot bot added the Overdue label Jul 17, 2023
@eVoloshchak
Copy link
Contributor

@ahmdshrif's proposal looks good to me!
All of the proposals are quite similar, so let's proceed with the first one

🎀👀🎀 C+ reviewed!

@melvin-bot
Copy link

melvin-bot bot commented Jul 17, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 18, 2023

📣 @aman-atg We're missing your Upwork ID to automatically send you an offer for the Reporter role.
Once you apply to the Upwork job, your Upwork ID will be stored and you will be automatically hired for future jobs!

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 labels Jul 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

🎯 ⚡️ Woah @eVoloshchak / @ahmdshrif, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @ahmdshrif got assigned: 2023-07-18 00:28:50 Z
  • when the PR got merged: 2023-07-20 00:51:13 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Jul 25, 2023
@melvin-bot melvin-bot bot changed the title [$1000] IOS - The text below the input flickers upon typing the first character [HOLD for payment 2023-08-01] [$1000] IOS - The text below the input flickers upon typing the first character Jul 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.44-2 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 2023-08-01. 🎊

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:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 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:

  • [@eVoloshchak] The PR that introduced the bug has been identified. Link to the PR:
  • [@eVoloshchak] 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:
  • [@eVoloshchak] 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:
  • [@eVoloshchak] Determine if we should create a regression test for this bug.
  • [@eVoloshchak] 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.
  • [@michaelhaxhiu] 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 Overdue and removed Weekly KSv2 labels Jul 31, 2023
@michaelhaxhiu
Copy link
Contributor

michaelhaxhiu commented Aug 2, 2023

Payment summary:

  • External issue reporter @aman-atg $250
  • Contributor that fixed the issue @ahmdshrif $1500
  • Contributor+ that helped on the issue and/or PR @eVoloshchak $1500

@melvin-bot melvin-bot bot removed the Overdue label Aug 2, 2023
@michaelhaxhiu
Copy link
Contributor

michaelhaxhiu commented Aug 2, 2023

@eVoloshchak will you get paid via newDot or Upwork? nvm I see, you get paid via NewDot. Feel free to send the request.

Lastly, can you start on the checklist?

@eVoloshchak
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: Fix for: Editing workspace name to 1to3 characters adding extra line in the optional message when inviting users in Spanish #17878
  • 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: https://github.com/Expensify/App/pull/17878/files#r1282444836
  • 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: This is a simple visual bug, I don't think there are any steps we could do besides automated UI tests
  • Determine if we should create a regression test for this bug.
    Is it easy to test for this bug? Yes
    Is the bug related to an important user flow? No
    Is it an impactful bug? No

    The bug has zero impact on functionality, while being very minor from the UI standpoint, a regression test isn't needed here I think

@michaelhaxhiu
Copy link
Contributor

Nice! I agree w/ your reasoning, no regression test needed

@michaelhaxhiu
Copy link
Contributor

@aman-atg and @ahmdshrif lmk when you accept my Upwork job offer so i can send the payment.

@eVoloshchak
Copy link
Contributor

Requested the payment via NewDot🎉

@JmillsExpensify
Copy link

Reviewed details for @eVoloshchak. These details are accurate based on summary from Business Reviewer and are now approved for payment in NewDot.

@ahmdshrif
Copy link
Contributor

Thanks @michaelhaxhiu I accept the offer.

@aman-atg
Copy link
Contributor

aman-atg commented Aug 3, 2023

@michaelhaxhiu I've accepted the offer, thank you!

@michaelhaxhiu
Copy link
Contributor

all paid

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

10 participants