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-12-28][$500][Theme Switching] 🐛 Android - Track distance - The inscription in the pop-up window is hardly visible in light mode #33136

Closed
1 of 6 tasks
lanitochka17 opened this issue Dec 15, 2023 · 64 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Dec 15, 2023

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: 1.4.13-0
Reproducible in staging?: Y
Reproducible in production?: N
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

Precondition: user turns on light mode on the app

  1. Open the app
  2. Login with any account
  3. Go to Settings -> Workspaces -> Open any WS -> Reimbursements -> Track distance
  4. Tap on Unit

Expected Result:

The inscription in the pop-up window is good visible

Actual Result:

The inscription in the pop-up window is hardly visible
The same behavior happens with pop-up windows during connecting bank account

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6313771_1702595709864!Screenshot_2023-12-15-00-18-12-83_4f9154176b47c00da84e32064abf1c48

Bug6313771_1702595709846!Screenshot_2023-12-15-00-20-44-89_4f9154176b47c00da84e32064abf1c48

Bug6313771_1702595709845!photo_2023-12-15_01-06-29

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @alexpensify
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ee03b399c3458856
  • Upwork Job ID: 1737582136051163136
  • Last Price Increase: 2023-12-20
@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Dec 15, 2023
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

Copy link

melvin-bot bot commented Dec 15, 2023

Triggered auto assignment to @jasperhuangg (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@jasperhuangg
Copy link
Contributor

@grgia looks like this is related to themes, do you think you could get a fix up?

@roryabraham roryabraham self-assigned this Dec 15, 2023
@jasperhuangg jasperhuangg removed their assignment Dec 15, 2023
@jasperhuangg
Copy link
Contributor

At least for the workspace reimburse view portion of this issue–it seems like the bug is coming from us not passing theme styles into these components:

<TextInput
role={CONST.ROLE.PRESENTATION}
inputID="rate"
containerStyles={[this.props.themeStyles.mt4]}
defaultValue={PolicyUtils.getUnitRateValue(distanceCustomRate, this.props.toLocaleDigit)}
label={this.props.translate('workspace.reimburse.trackDistanceRate')}
aria-label={this.props.translate('workspace.reimburse.trackDistanceRate')}
placeholder={lodashGet(this.props, 'policy.outputCurrency', CONST.CURRENCY.USD)}
autoCompleteType="off"
autoCorrect={false}
inputMode={CONST.INPUT_MODE.DECIMAL}
maxLength={12}
value={this.state.rate}
onChangeText={(value) => this.setState({rate: value})}
/>
<View style={[this.props.themeStyles.mt4]}>
<Picker
value={this.state.unit}
label={this.props.translate('workspace.reimburse.trackDistanceUnit')}
items={this.getUnitItems()}
onInputChange={(value) => this.setState({unit: value})}
/>
</View>

@grgia do you know what styles we're supposed to be passing here?

@grgia
Copy link
Contributor

grgia commented Dec 15, 2023

@jasperhuangg if we pass the {color: theme.textLight} we can make the text white for now on both platforms (or textReversed depending on what this looks like on dark mode)

@neonbhai
Copy link
Contributor

neonbhai commented Dec 15, 2023

Proposal

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

Track distance - The inscription in the pop-up window is hardly visible in light mode

What is the root cause of that problem?

All these errors are because of the Picker component.
We are missing the backgroundColor prop for this component in all places. This did work until now, since by default it takes the dark mode.

The text is hardcoded to be always white here:

items={items.map((item) => ({...item, color: theme.pickerOptionsTextColor}))}

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

We should make sure the BasePicker component gets the right theme here

color: theme.textLight
For Base Picker Background

We should pass the backgroundColor prop for the Picker components:

<Picker
label={translate('addPersonalBankAccountPage.chooseAccountLabel')}
onInputChange={onSelect}
items={options}
placeholder={{
value: '',
label: translate('bankAccount.chooseAnAccount'),
}}
value={selectedPlaidAccountID}
/>

<Picker
value={this.state.unit}
label={this.props.translate('workspace.reimburse.trackDistanceUnit')}
items={this.getUnitItems()}
onInputChange={(value) => this.setState({unit: value})}
/>

<InputWrapper
InputComponent={Picker}
inputID="incorporationType"
label={translate('companyStep.companyType')}
items={_.map(_.keys(CONST.INCORPORATION_TYPES), (key) => ({value: key, label: translate(`companyStep.incorporationTypes.${key}`)}))}
placeholder={{value: '', label: '-'}}
defaultValue={getDefaultStateForField('incorporationType')}
shouldSaveDraft
/>

backgroundColor={theme.componentBG}

Alternatively

We can remove the backgroundColor prop and set it according to theme inside the BasePicker component itself.

@Julesssss
Copy link
Contributor

@neonbhai I like setting this in the base picker, any reason why you made that your alternative solution?

@neonbhai
Copy link
Contributor

any reason why you made that your alternative solution?

@Julesssss Hey, was wondering if it wasn't done already for a reason. Setting it in base picker itself is a cleaner solution!

@grgia grgia changed the title Android - Track distance - The inscription in the pop-up window is hardly visible in light mode [Theme Switching] 🐛 Android - Track distance - The inscription in the pop-up window is hardly visible in light mode Dec 15, 2023
@grgia
Copy link
Contributor

grgia commented Dec 15, 2023

@situchan I agree with that, we should fix those in one PR

@grgia
Copy link
Contributor

grgia commented Dec 15, 2023

@neonbhai @situchan
#16103
Does your proposal work if we remove the dark mode hardcoded background color from this PR? Or do we need to keep that? I'd test locally but my android emulator is completely broken right now

@situchan
Copy link
Contributor

Goin

@neonbhai @situchan #16103 Does your proposal work if we remove the dark mode hardcoded background color from this PR? Or do we need to keep that? I'd test locally but my android emulator is completely broken right now

Will try test, but I think it will depend on system theme.

If we should match with app theme, there should be way to communicate between RN and native so if user preference is updated in RN, it should send to native so that native modals update theme properly.

@grgia
Copy link
Contributor

grgia commented Dec 15, 2023

Will try test, but I think it will depend on system theme.

Thank you, I think if we go this route, we should try to match the theme.

I guess the alternative is using one modal color style on all devices since it only affects android. Let me check with design @situchan

@grgia
Copy link
Contributor

grgia commented Dec 15, 2023

This one specifically has a secondary problem as the text color is being set to text (?) so at least we should pass the correct text color for both themes

@grgia
Copy link
Contributor

grgia commented Dec 15, 2023

@situchan if you're able to test the solution, I think for now if we fix the text color to white so it's at least readable then we can remove the deploy blocker and fix the modals pending the convo in slack.
I've been trying to get my android emulator working but I can't seem to get anything to build without fail, so I am unable to debug this right now.

If @neonbhai's proposal addresses the text color so it works on the 4 cases (OS Dark/Dark, OS Dark/Light OS Light/Dark OS Light/Light), then let's move forward with that- even if the modal remains dark theme on android light

@neonbhai
Copy link
Contributor

neonbhai commented Dec 15, 2023

@grgia having the color as theme.textLight fixes the issue:

Screenshot 2023-12-15 at 10 41 02 PM Screenshot 2023-12-15 at 10 40 29 PM

This will work on all 4 cases since popover color is dark for every case.

cc: @situchan

@situchan
Copy link
Contributor

situchan commented Dec 15, 2023

// We add a text color to prevent white text on white background dropdown items on Windows
items={items.map((item) => ({...item, color: theme.pickerOptionsTextColor}))}

@neonbhai that color was also hardcoded intentionally to fix windows picker issue

@situchan
Copy link
Contributor

I think we should use platform specific code for this.
cc: @grgia

@grgia
Copy link
Contributor

grgia commented Dec 15, 2023

pickerOptionsTextColor: colors.productLight900,

@situchan the pickerOptionsTextColor is set to a light color on light mode

@situchan
Copy link
Contributor

@neonbhai can you share your test branch?

@alexpensify alexpensify added Weekly KSv2 Reviewing Has a PR in review and removed Daily KSv2 labels Dec 20, 2023
@alexpensify
Copy link
Contributor

@neonbhai and @situchan - to prepare for the payment process, please apply for the job here:

https://www.upwork.com/jobs/~01ee03b399c3458856

I'm OOO starting on Friday and want to make sure that this one is ready for payment next week. Thanks!

@neonbhai
Copy link
Contributor

Hi @alexpensify, Thank you! Looks like I'll have to buy upwork connects to apply. Please send an invite if possible!
Upwork profile link here.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Dec 21, 2023
@melvin-bot melvin-bot bot changed the title [$500] [HOLD for payment 2023-12-26] [Theme Switching] 🐛 Android - Track distance - The inscription in the pop-up window is hardly visible in light mode [HOLD for payment 2023-12-28] [$500] [HOLD for payment 2023-12-26] [Theme Switching] 🐛 Android - Track distance - The inscription in the pop-up window is hardly visible in light mode Dec 21, 2023
Copy link

melvin-bot bot commented Dec 21, 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 Dec 21, 2023
Copy link

melvin-bot bot commented Dec 21, 2023

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

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:

  • @neonbhai requires payment (Needs manual offer from BZ)
  • @situchan requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Dec 21, 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:

  • [@situchan] The PR that introduced the bug has been identified. Link to the PR:
  • [@situchan] 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:
  • [@situchan] 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:
  • [@situchan] Determine if we should create a regression test for this bug.
  • [@situchan] 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.
  • [@alexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@alexpensify
Copy link
Contributor

I've confirmed that offers have been sent via Upwork to @situchan and @neonbhai. @situchan please complete the checklist. It looks like the payment date changed to December 28.

Heads up, I'm OOO until January 4, but I will log in on Friday, December 29 to complete this payment process pending no regression.

@melvin-bot melvin-bot bot added Daily KSv2 Monthly KSv2 Overdue and removed Weekly KSv2 labels Dec 25, 2023
@roryabraham roryabraham changed the title [HOLD for payment 2023-12-28] [$500] [HOLD for payment 2023-12-26] [Theme Switching] 🐛 Android - Track distance - The inscription in the pop-up window is hardly visible in light mode [HOLD for payment 2023-12-28][$500][Theme Switching] 🐛 Android - Track distance - The inscription in the pop-up window is hardly visible in light mode Dec 27, 2023
@roryabraham
Copy link
Contributor

Waiting for BZ checklists and payments here, not expecting payments to be complete until 12/29.

@roryabraham roryabraham added Weekly KSv2 and removed Daily KSv2 Monthly KSv2 labels Dec 27, 2023
@melvin-bot melvin-bot bot removed the Overdue label Dec 27, 2023
@alexpensify
Copy link
Contributor

Closing - Thank you everyone for your patience here. I've completed the payment process in Upwork and closed this job. Happy New Year!

@situchan please complete the checklist when you get a chance, thanks!

@situchan
Copy link
Contributor

Happy new year!

We can skip checklist as regression came from theme switching (which won't happen again in the future) and bug was caught by QA team

@alexpensify
Copy link
Contributor

Noted and thank you.

@neonbhai
Copy link
Contributor

Thanks @alexpensify, wishing you a Happy New Year!

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. Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
No open projects
Development

No branches or pull requests

9 participants