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-06-28] [$250] Distance - "Center" button has no hover and press effect #43058

Closed
6 tasks done
lanitochka17 opened this issue Jun 4, 2024 · 52 comments
Closed
6 tasks done
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 Jun 4, 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: 1.4-79-3
Reproducible in staging?: Y
Reproducible in production?: N
**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):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation:

Issue found when executing PR #40759

Action Performed:

Precondition:

  • App location permission is allowed
  1. Go to staging.new.expensify.com
  2. Go to FAB > Submit expense > Distance
  3. Hover over "Center" button
  4. Click on the "Center" button

Expected Result:

There should be hover and press effect on the button when hovering over and pressing on the button

Actual Result:

"Center" button has no hover and press effect

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

Bug6501921_1717526328081.bandicam_2024-06-05_02-12-52-626.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ba9155072ebd3afb
  • Upwork Job ID: 1798088916367302656
  • Last Price Increase: 2024-06-04
  • Automatic offers:
    • jjcoffee | Reviewer | 102678374
Issue OwnerCurrent Issue Owner: @adelekennedy
@lanitochka17 lanitochka17 added DeployBlockerCash This issue or pull request should block deployment DeployBlocker Indicates it should block deploying the API labels Jun 4, 2024
Copy link

melvin-bot bot commented Jun 4, 2024

Triggered auto assignment to @marcochavezf (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link
Contributor

github-actions bot commented Jun 4, 2024

👋 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.

@lanitochka17
Copy link
Author

@marcochavezf FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@marcochavezf
Copy link
Contributor

There's no center button in production:

Screenshot 2024-06-04 at 2 20 12 p m

I don't think this is a deploy blocker, but I will make it external

@marcochavezf marcochavezf added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor and removed DeployBlockerCash This issue or pull request should block deployment Engineering Hourly KSv2 DeployBlocker Indicates it should block deploying the API labels Jun 4, 2024
@melvin-bot melvin-bot bot changed the title Distance - "Center" button has no hover and press effect [$250] Distance - "Center" button has no hover and press effect Jun 4, 2024
Copy link

melvin-bot bot commented Jun 4, 2024

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

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

melvin-bot bot commented Jun 4, 2024

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

Copy link

melvin-bot bot commented Jun 4, 2024

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

@eucool
Copy link
Contributor

eucool commented Jun 4, 2024

Proposal

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

No hover / press effect for centre button.

What is the root cause of that problem?

We do not pass hoverStyle and pressStyle props for pressablewithoutfeedback:

function PressableWithoutFeedback(
{pressStyle, hoverStyle, focusStyle, screenReaderActiveStyle, shouldUseHapticsOnPress, shouldUseHapticsOnLongPress = false, ...rest}: PressableProps,

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

We should pass pressStyle for native file and both hoverStyle and pressStyle for the website file:

The exact values of hover and press styles needs to be discussed with the design team

What alternative solutions did you explore? (Optional)

@etCoderDysto
Copy link
Contributor

etCoderDysto commented Jun 4, 2024

Proposal

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

"Center" button has no hover and press effect

What is the root cause of that problem?

The root cause is that we are not checking hover state here and the website extension file too and we are not applying hover effect when hover state is true.

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

We should change this component to a call back function that returns a component here and the website file too. And apply theme.iconMenuHovered or theme.iconHovered to the icons fill property when hovered is true.

{({hovered}) => (
                            <View style={styles.primaryMediumIcon}>
                                <Icon
                                    width={variables.iconSizeNormal}
                                    height={variables.iconSizeNormal}
                                    src={Expensicons.Crosshair}
                                    fill={hovered ? theme.iconMenuHovered : theme.icon}
                                />
                            </View>
                        )}

The hover color can be decided based on the design choice.
I don't think there is a need to apply press effect since the press action is immediately followed by a feedback of map navigating to center.

What alternative solutions did you explore? (Optional)

Result:

Screen.Recording.2024-06-04.at.11.44.02.at.night.mp4

Copy link

melvin-bot bot commented Jun 4, 2024

📣 @etCoderDysto! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@truph01
Copy link
Contributor

truph01 commented Jun 4, 2024

Proposal

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

"Center" button has no hover and press effect

What is the root cause of that problem?

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

  • We should use PressableWithFeedback with prop hoverDimmingValue (based on design) instead and we should apply the change in both .web and .native file.

  • We use the similar logic in a lot of pages, for example InitialSettingsPage:

    <Tooltip text={translate('statusPage.status')}>
    <PressableWithFeedback

What alternative solutions did you explore? (Optional)

  • NA

Video

Screen.Recording.2024-06-06.at.18.04.21.mov

@kaushiktd
Copy link
Contributor

kaushiktd commented Jun 5, 2024

Proposal

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

Distance - "Center" button has no hover and press effect

What is the root cause of that problem?

You have just placed an Icon inside the PressableWithoutFeedback component without checking its hover and press (active) states. This is the primary root cause of the issues.

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

To address this issue, you should modify the PressableWithoutFeedback component in the MapView.website.tsx and MapView.tsx files. Check the hover and active states for the component, ensuring the Icon's fill parameter reflects these states to display different colors. for that you need to add below condition here.

fill={hovered || pressed ? theme.iconMenuHovered : theme.icon}

Additionally, add a hover stylesheet to the View component inside PressableWithoutFeedback to make it hoverable here. This will ensure the component properly responds to user interactions.

(hovered || pressed) && StyleUtils.getButtonBackgroundColorStyle(getButtonState(hovered, pressed))

You need to encapsulate the child component of PressableWithoutFeedback with hover and press states, as shown below:

{({ hovered, pressed }) => (
  // Child component goes here..
)}

What alternative solutions did you explore? (Optional)

You can also use the hoverStyle to activate the hover state. However, for this, you need to use the PressableWithFeedback component instead of the PressableWithoutFeedback component. Replace the existing code with below mentioned:

<PressableWithFeedback
    accessibilityRole={CONST.ROLE.BUTTON}
    onPress={centerMap}
    accessibilityLabel={translate('common.center')}
    style={styles.primaryMediumIcon}
    hoverDimmingValue={0.9}
    pressDimmingValue={0.7}
>
    {({ hovered }) => (
        <Icon
            width={variables.iconSizeNormal}
            height={variables.iconSizeNormal}
            src={Expensicons.Crosshair}
            fill={hovered ? theme.iconMenuHovered : theme.icon}
        />
    )}
</PressableWithFeedback>
Recording for Press(Active) and Hover State
Screen.Recording.2024-06-05.at.12.33.01.PM.mov

Copy link

melvin-bot bot commented Jun 5, 2024

⚠️ Invalid email. Please make sure to create an Expensify account with this email first here.

@truph01
Copy link
Contributor

truph01 commented Jun 11, 2024

@marcochavezf @shawnborton what is the expected hover and press value we should use in this case? Should we use the same values as the "Status" and the "Share code" button below:

image

@jjcoffee
Copy link
Contributor

@truph01 I think it makes sense to use the same values as those button, but just so everyone can see could you attach a screenshot (or video) showing how the center button would look with those values?

@truph01
Copy link
Contributor

truph01 commented Jun 12, 2024

@jjcoffee Here is how it looks like in the PR now:

output.mp4

@jjcoffee
Copy link
Contributor

@Expensify/design Any strong feelings on using the values from here, resulting in this? Looks fine to me, but just want to get a confirmation before we go ahead!

@shawnborton
Copy link
Contributor

Can we use the same :hover and :active values from these buttons in Troubleshoot?
CleanShot 2024-06-12 at 15 42 41@2x

They seem to be correct at least from my perspective.

@dannymcclain
Copy link
Contributor

@shawnborton this is what we have in Figma for the icon buttons, does this look right to you?

image

@shawnborton
Copy link
Contributor

Indeed, that looks correct!

@Krishna2323
Copy link
Contributor

Krishna2323 commented Jun 20, 2024

@marcochavezf @jjcoffee, I see that the PR is using my solution. Even though I had informed you about the consistency issues when using the PressableWithFeedback instead of the Button component, my proposal wasn't selected, and it was decided to use PressableWithFeedback. But now we are using the Button component. I feel that this is unfair. Please correct me if I'm wrong. Thanks

Also it will remain consistent with other similar buttons used in the app without defining props like hoverDimmingValue, pressDimmingValue.

but for the scope of this issue and for a straightforward solution let's just use PressableWithFeedback with hoverDimmingValue for now :)

We already use Button for the previous and next buttons in the attachment carousel.

Edit: I suggested to use the Button component because it was already being used to render icon buttons. The correct solution was to use Button component which is also confirmed by @shawnborton here.

Copy link

melvin-bot bot commented Jun 20, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@mountiny
Copy link
Contributor

There was a regression from the PR #44074 so we should have a penalty on the payment

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jun 21, 2024
@melvin-bot melvin-bot bot changed the title [$250] Distance - "Center" button has no hover and press effect [HOLD for payment 2024-06-28] [$250] Distance - "Center" button has no hover and press effect Jun 21, 2024
Copy link

melvin-bot bot commented Jun 21, 2024

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jun 21, 2024
Copy link

melvin-bot bot commented Jun 21, 2024

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

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

Copy link

melvin-bot bot commented Jun 21, 2024

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:

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

@jjcoffee
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: fix add center button and blue dot #40759
  • 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/40759/files#r1654477558
  • 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: N/A
  • Determine if we should create a regression test for this bug. Yes
  • 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.

Regression Test Proposal

  1. Go to FAB > Submit expense > Distance
  2. Hover over "Center" button and verify that the button style changes
  3. Tap and hold on the "Center" button and verify that the button style changes

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jun 28, 2024
@adelekennedy
Copy link

@marcochavezf to review the regression test proposal above, also changing the total price to $125 for the regression

@adelekennedy
Copy link

adelekennedy commented Jul 1, 2024

Payouts due:

@truph01 will you share your upwork profile with em so I can extend a manual offer?

@truph01
Copy link
Contributor

truph01 commented Jul 1, 2024

@adelekennedy
Copy link

@adelekennedy
Copy link

offer sent @truph01

@truph01
Copy link
Contributor

truph01 commented Jul 2, 2024

@adelekennedy Accepted thanks!

@adelekennedy
Copy link

Payments made! Closing

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