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-12-05] [$250] Onbording - Onboarding input is grayed out when select auto suggested name #51523

Closed
1 of 8 tasks
lanitochka17 opened this issue Oct 26, 2024 · 72 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

@lanitochka17
Copy link

lanitochka17 commented Oct 26, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.54
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Login with new user
  3. When onboarding modal opens select Something else
  4. Start typing until auto suggested name appears
  5. Select the suggested name

Expected Result:

Selected name should be black

Actual Result:

Name input is grayed out when select auto suggested name

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6645812_1729877258457.Recording__4337.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021851668566536953494
  • Upwork Job ID: 1851668566536953494
  • Last Price Increase: 2024-11-06
  • Automatic offers:
    • klajdipaja | Contributor | 104956195
Issue OwnerCurrent Issue Owner: @JmillsExpensify
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 26, 2024
Copy link

melvin-bot bot commented Oct 26, 2024

Triggered auto assignment to @JmillsExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added the Overdue label Oct 28, 2024
@JmillsExpensify
Copy link

Opening up to the community.

@melvin-bot melvin-bot bot removed the Overdue label Oct 30, 2024
@JmillsExpensify JmillsExpensify added External Added to denote the issue can be worked on by a contributor Overdue labels Oct 30, 2024
@melvin-bot melvin-bot bot changed the title Onbording - Onboarding input is grayed out when select auto suggested name [$250] Onbording - Onboarding input is grayed out when select auto suggested name Oct 30, 2024
Copy link

melvin-bot bot commented Oct 30, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 30, 2024
Copy link

melvin-bot bot commented Oct 30, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Oct 30, 2024
@Shahidullah-Muffakir
Copy link
Contributor

Proposal

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

Selected auto-suggested name or last name appears grayed out in the input field, returning to black only after the user modifies the text.

What is the root cause of that problem?

The root cause is that browser's default auto-fill/auto-suggest styling is overriding our custom text color styles

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

We should add the WebkitTextFillColor:theme.text to our baseTextInput styles
Here:

App/src/styles/index.ts

Lines 1226 to 1235 in aa6401d

baseTextInput: {
...FontUtils.fontFamily.platform.EXP_NEUE,
fontSize: variables.fontSizeNormal,
lineHeight: variables.lineHeightXLarge,
color: theme.text,
paddingTop: 23,
paddingBottom: 8,
paddingLeft: 0,
borderWidth: 0,
},

@Shahidullah-Muffakir
Copy link
Contributor

Screen.20Recording.202024-10-31.20at.206.mp4

@s77rt
Copy link
Contributor

s77rt commented Oct 31, 2024

Not able to reproduce

Screen.Recording.2024-10-31.at.8.55.00.AM.mov

@s77rt
Copy link
Contributor

s77rt commented Oct 31, 2024

@Shahidullah-Muffakir Were you able to reproduce the bug? Any additional required steps?

@klajdipaja
Copy link
Contributor

klajdipaja commented Oct 31, 2024

Edited by proposal-police: This proposal was edited at 2024-11-05 13:30:54 UTC.

Proposal

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

Input fields on the onboarding page (name and last name) have grayish color after the user loges in to expensify.
To reproduce this bug I had to set the theme in my MacOS to Light in addition to the steps by the reporter.

What is the root cause of that problem?

The root cause is that the global autofill-input styles that we apply in the ThemeProvier.tsx in this block:

useEffect(() => {
DomUtils.addCSS(DomUtils.getAutofilledInputStyle(theme.text), 'autofill-input');
}, [theme.text]);

The login page initiates a ThemeProvider with a static override in Dark mode and after the user is logged in the main ThemeProvider in App.tsx should be based on the system mode as Light.

The ThemeProvider does change to Light mode as we can see from all the styles that change in the main page. The problem is that since we are adding the styles in the ThemeProvider itself the styles that are added globally are of the latest mounted ThemeProvider and turnes out the last one is with a static override theme.

The render logic goes as below:

  1. Main ThemeProvider (system)
  2. Main ThemeProvider (system) Adds Autofill CSS
  3. SignIn ThemeProvider (dark)
  4. SignIn ThemeProvider (dark) Adds Autofill CSS
  5. SignIn ThemeProvider (dark) is removed
    Now components will use the Main ThemeProvider (system) with light theme but the Autofill CSS is still from dark theme of the SignIn ThemeProvider.

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

The useEffect is not consistent with the way we use themes and should not be in the ThemeProvider but in a child component of it that has access to the useTheme context so that it can be rendered based on the updated theme from the ThemeProvider that wraps it.

I have tested it in ThemeStylesProvider.tsx and it works perfectly.

What alternative solutions did you explore? (Optional)

@Shahidullah-Muffakir
Copy link
Contributor

@s77rt Yes, I was able to reproduce the bug in both Safari and Chrome.
Note: The issue does not occur if we refresh the page.

Safar:

Screen.20Recording.202024-10-31.20at.205.mp4

macOS Chrome:

Screen.20Recording.202024-10-31.20at.205-2.mp4

@s77rt
Copy link
Contributor

s77rt commented Oct 31, 2024

@Shahidullah-Muffakir Thanks for the confirmation. Regarding the proposal, your RCA does not look correct as we do apply our custom auto-fill styles and seeing that it works on refresh confirms it.

@s77rt
Copy link
Contributor

s77rt commented Oct 31, 2024

@klajdipaja Thanks for the proposal. Can you please elaborate on the RCA? Is it the double call to DomUtils.addCSS that causes the bug? It's not clear why the bug occurs given that the styles are overwritten

@klajdipaja
Copy link
Contributor

@s77rt the double call is not the issue. It's the fact the we are loading these styles in the ThemeProvider and that opens the app up for race conditions when there are multiple ThemeProviders in the app. I added some console.log in the ThemeProvider and noticed that the last render of the provider has a staticThemePreference passed to it as DARK which is only done in the SignInPage.tsx: <ThemeProvider theme={CONST.THEME.DARK}> making it so that the latest styles added are actually for DARK mode.

@s77rt
Copy link
Contributor

s77rt commented Oct 31, 2024

@klajdipaja Is it that the useEffect that runs last in ThemeProvider has the wrong theme? (staticThemePreference) If so, why this does not happen when we login with an existing account?

Screenshot 2024-10-31 at 6 43 13 PM

@klajdipaja
Copy link
Contributor

klajdipaja commented Nov 1, 2024

@s77rt

Is it that the useEffect that runs last in ThemeProvider has the wrong theme? (staticThemePreference)

Yes, that's right. Which is then loading the global style with text color gray which is for dark mode.
This in my case happens for both login types (new and existing user) which I see by checking the style that is loaded in inspect element. Search for it in inspect element by id="autofill-input". In both cases for me I see the text color set to #E7ECE9.

Check this screenshots:
Screenshot 2024-11-01 at 11 30 34 AM
Screenshot 2024-11-01 at 11 32 00 AM

@s77rt
Copy link
Contributor

s77rt commented Nov 1, 2024

@klajdipaja I'm still having trouble reproducing this. Is there some additional steps that I'm missing?

Screenshot 2024-11-01 at 2 46 58 PM

@klajdipaja
Copy link
Contributor

@s77rt I can reproduce this all the time if I have the System->Appearance settings of my macOS set to Light.

@s77rt
Copy link
Contributor

s77rt commented Nov 1, 2024

@klajdipaja Ah I see. Now i can reproduce. Isn't the ThemeProvider supposed to re-render when the theme changed?

@klajdipaja
Copy link
Contributor

@s77rt It should re-render. That's what I am experiencing in a test I just did now

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

Copy link

melvin-bot bot commented Nov 23, 2024

@JmillsExpensify @francoisl @s77rt @klajdipaja this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

@klajdipaja
Copy link
Contributor

Will prepare the PR on Monday

Copy link

melvin-bot bot commented Nov 25, 2024

@JmillsExpensify, @francoisl, @s77rt, @klajdipaja Whoops! This issue is 2 days overdue. Let's get this updated quick!

@klajdipaja
Copy link
Contributor

@s77rt PR is ready for review

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 28, 2024
@melvin-bot melvin-bot bot changed the title [$250] Onbording - Onboarding input is grayed out when select auto suggested name [HOLD for payment 2024-12-05] [$250] Onbording - Onboarding input is grayed out when select auto suggested name Nov 28, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 28, 2024
Copy link

melvin-bot bot commented Nov 28, 2024

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

Copy link

melvin-bot bot commented Nov 28, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.67-9 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-12-05. 🎊

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

Copy link

melvin-bot bot commented Nov 28, 2024

@s77rt @JmillsExpensify @s77rt The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@s77rt
Copy link
Contributor

s77rt commented Dec 1, 2024

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on both staging and production
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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: [TS migration] Migrate 'App.js' file to TypeScript #35242 (comment)

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: n/a

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Bug requires regression test: Yes

Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

  • System theme is light

Test:

  1. Login with a new user
  2. After the onboarding modal is displayed, select "Something else"
  3. Start typing in the first name field until auto suggested names appear
  4. Select any suggested name
  5. Verify that the suggested name font color is dark and the name is readable

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Dec 5, 2024
@JmillsExpensify
Copy link

Payment summary:

@melvin-bot melvin-bot bot removed the Overdue label Dec 9, 2024
@JmillsExpensify
Copy link

Contributor paid via Upwork, regression test created, and remaining payments are via New Expensify. Closing this one!

@garrettmknight
Copy link
Contributor

Payment summary:

@JmillsExpensify
Copy link

$250 approved for @s77rt

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

9 participants