Skip to content

[WAITING ON SOBIT - CHECKLIST] [$250] Selected row in onboarding modal should not get :hover style #44055

Closed

Description

@m-natarajan

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.86-0
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
Expensify/Expensify Issue URL:
Issue reported by: @shawnborton
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1718816345646859

Action Performed:

  1. Sign up for a new account
  2. In the onboarding modal, select an option
  3. Hover over the selected option

Expected Result:

Selected row should not get a hover style

Actual Result:

Selected row changes BG color on hover

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

CleanShot.2024-06-28.at.16.12.11.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ffaa9b43dacb7a8a
  • Upwork Job ID: 1806378179434309152
  • Last Price Increase: 2024-07-04
  • Automatic offers:
    • truph01 | Contributor | 103133129
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 20, 2024
  2. melvin-bot commented on Jun 20, 2024

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (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.

  3. truph01 commented on Jun 20, 2024

    @truph01
    Contributor

    Proposal

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

    • Selected row in onboarding modal should not get :hover style

    What is the root cause of that problem?

    • We always display the hover style if the item is hovered without considering if it is selected or not:
      isHovered && interactive && !pressed && styles.hoveredComponentBG,

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

    • We should remove:

    isHovered && interactive && !pressed && styles.hoveredComponentBG,

    which used to fix issue.

    • Then fix that issue by adding
                            hoverAndPressStyle={[styles.hoveredComponentBG]}
    

    to:

    <MenuItemWithTopDescription

       <MenuItem hoverAndPressStyle={props.hoverAndPressStyle ?? styles.hoveredComponentBG ...
    
                focused: isSelected,
                style: [styles.purposeMenuItem],
                hoverAndPressStyle: [styles.hoveredComponentBG]
    

    to fix our main issue.

    What alternative solutions did you explore? (Optional)

                                            isHovered && interactive && !focused && !pressed && styles.hoveredComponentBG,
    

    then add:

        focused: isSelected
    

    to:

  4. neonbhai commented on Jun 20, 2024

    @neonbhai
    Contributor

    Proposal

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

    Onboarding modal uses incorrect row hover style when hovering over the options

    What is the root cause of that problem?

    There are two problems:

    • The hoverStyle is being passed incorrectly here

    • The MenuItem styles here applied in the wrong order.

      Current order applies hover style after the active button style giving us this behavior:

      Video (hover applied after active style)
      Screen.Recording.2024-06-20.at.12.14.03.PM.mp4

    Additionally:

    This order effectively prevents us from seeing the pressed style for menuItem as defined here:

    App/src/styles/utils/index.ts

    Lines 1320 to 1321 in 7561439

    case CONST.BUTTON_STATES.PRESSED:
    return {backgroundColor: theme.buttonPressedBG};

    Which gives us this tactile feedback when pressing:

    Video
    Screen.Recording.2024-06-20.at.12.17.43.PM.mov

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

    • change this line to:

      hoverAndPressStyle: [styles.hoveredComponentBG],
    • Move this style:

      StyleUtils.getButtonBackgroundColorStyle(getButtonState(focused || isHovered, pressed, success, disabled, interactive), true),

      after this line:
      !focused && (isHovered || pressed) && hoverAndPressStyle,

      --  StyleUtils.getButtonBackgroundColorStyle(getButtonState(focused || isHovered, pressed, success, disabled, interactive), true),
          ...(Array.isArray(wrapperStyle) ? wrapperStyle : [wrapperStyle]),
          !focused && (isHovered || pressed) && hoverAndPressStyle,
      ++  StyleUtils.getButtonBackgroundColorStyle(getButtonState(focused || isHovered, pressed, success, disabled, interactive), true),

    Alternatively

    If we don't want feedback on active press we can add a check for !isMenuItem here

  5. truph01 commented on Jun 20, 2024

    @truph01
    Contributor
  6. melvin-bot commented on Jun 25, 2024

    @melvin-bot

    @shawnborton, @mallenexpensify Eep! 4 days overdue now. Issues have feelings too...

  7. shawnborton commented on Jun 25, 2024

    @shawnborton
    Contributor

    @mallenexpensify can you please review this when you get a moment? Thanks!

  8. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jun 27, 2024
  9. changed the title [-]Onboarding modal uses incorrect row hover style when hovering over the options[/-] [+][$250] Onboarding modal uses incorrect row hover style when hovering over the options[/+] on Jun 27, 2024
  10. melvin-bot commented on Jun 27, 2024

    @melvin-bot
  11. 64 remaining items

  12. mallenexpensify commented on Aug 1, 2024

    @mallenexpensify
    Contributor

    @jliexpensify I'm off til Monday afternoon, can you help with payment here? Thx

  13. jliexpensify commented on Aug 1, 2024

    @jliexpensify
    Contributor

    Payment Summary

    Waiting on checklist

  14. jliexpensify commented on Aug 3, 2024

    @jliexpensify
    Contributor

    Paid and job closed. @sobitneupane bump for checklist!

  15. changed the title [-][HOLD for payment 2024-08-02] [$250] Selected row in onboarding modal should not get :hover style[/-] [+][WAITING ON SOBIT - CHECKLIST] [$250] Selected row in onboarding modal should not get :hover style[/+] on Aug 3, 2024
  16. sobitneupane commented on Aug 5, 2024

    @sobitneupane
    Contributor

    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:

    • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:

    #43987

    • [@sobitneupane] 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/43987/files#r1703875086

    • [@sobitneupane] 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:

    I don't think any new update is required.

    • [@sobitneupane] Determine if we should create a regression test for this bug.

    Yes.

    • [@sobitneupane] 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.

    #44055 (comment)

  17. sobitneupane commented on Aug 5, 2024

    @sobitneupane
    Contributor

    Regression Test Proposal

    1. Sign up for a new account
    2. In the onboarding modal, select an option
    3. Hover over the selected option
    4. Verify that the selected option does not get hover style.

    Do we agree 👍 or 👎

  18. melvin-bot commented on Aug 5, 2024

    @melvin-bot

    @shawnborton, @mallenexpensify, @sobitneupane, @jliexpensify, @marcaaron, @truph01 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  19. marcaaron commented on Aug 6, 2024

    @marcaaron
    Contributor
  20. mallenexpensify commented on Aug 7, 2024

    @mallenexpensify
    Contributor
  21. garrettmknight commented on Sep 2, 2024

    @garrettmknight
    Contributor

    $250 approved for @sobitneupane based on this summary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions