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-20] [HOLD for payment 2024-12-19] [$250] Search - Approve button becomes green when the held expense is selected via checkbox #53897

Closed
5 of 8 tasks
IuliiaHerets opened this issue Dec 11, 2024 · 35 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Dec 11, 2024

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: 53889
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): applausetester+kh1311020@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  • Add approvals feature is enabled.
  • Admin is the approver.
  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Submit an expense.
  4. Go to transaction thread.
  5. Click on the report header > Hold > Hold the expense.
  6. Go to Search.
  7. Note that Approve button is gray.
  8. Select the expense via checkbox.

Expected Result:

Approve button should remain gray as long as the expense is held.

Actual Result:

Approve button becomes green when the held expense is selected via checkbox.
It turns gray when hovered in selected state.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6690430_1733874805350.hold_search.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021866771543910403509
  • Upwork Job ID: 1866771543910403509
  • Last Price Increase: 2024-12-11
Issue OwnerCurrent Issue Owner: @jayeshmangwani
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Dec 11, 2024
Copy link

melvin-bot bot commented Dec 11, 2024

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

Copy link

melvin-bot bot commented Dec 11, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Dec 11, 2024
Copy link

melvin-bot bot commented Dec 11, 2024

💬 A slack conversation has been started in #expensify-open-source

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Dec 11, 2024
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.

@nkdengineer
Copy link
Contributor

Proposal

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

Approve button becomes green when the held expense is selected via checkbox.
It turns gray when hovered in selected state.

What is the root cause of that problem?

We are setting button style with styles.buttonSuccessHovered if this row is selected here

const buttonInnerStyles = isSelected ? styles.buttonSuccessHovered : {};

even though we have set shouldUseSuccessStyle to false if isOnHold here

shouldUseSuccessStyle={!isOnHold}

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

We should update this condition to show style buttonSuccessHovered when shouldUseSuccessStyle as true

    const buttonInnerStyles = isSelected && shouldUseSuccessStyle ? styles.buttonSuccessHovered : {};

const buttonInnerStyles = isSelected ? styles.buttonSuccessHovered : {};

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@Gonals Gonals added the External Added to denote the issue can be worked on by a contributor label Dec 11, 2024
@melvin-bot melvin-bot bot changed the title Search - Approve button becomes green when the held expense is selected via checkbox [$250] Search - Approve button becomes green when the held expense is selected via checkbox Dec 11, 2024
Copy link

melvin-bot bot commented Dec 11, 2024

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

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

melvin-bot bot commented Dec 11, 2024

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

@jayeshmangwani
Copy link
Contributor

@nkdengineer Your change will also remove the button background. Please check the SS
Screenshot 2024-12-11 at 15 15 56

@bernhardoj
Copy link
Contributor

Proposal

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

The Approve button becomes green even though it's on hold when it's selected.

What is the root cause of that problem?

When the item is selected, we always use the buttonSuccessHovered style even though shouldUseSuccessStyle is false.

const buttonInnerStyles = isSelected ? styles.buttonSuccessHovered : {};
return (
<Button
text={text}
onPress={goToItem}
small
style={[styles.w100]}
innerStyles={buttonInnerStyles}
isLoading={isLoading}
success={shouldUseSuccessStyle}

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

When the item is selected but shouldUseSuccessStyle is false, we should use buttonDefaultHovered, just like the View action.

const buttonInnerStyles = isSelected ? styles.buttonDefaultHovered : {};

const buttonInnerStyles = isSelected ? shouldUseSuccessStyle ? styles.buttonSuccessHovered : styles.buttonDefaultHovered : {};

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A

@Krishna2323
Copy link
Contributor

Proposal

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

Search - Approve button becomes green when the held expense is selected via checkbox

What is the root cause of that problem?

  • When isSelected is true, we always apply buttonSuccessHovered style.
    const buttonInnerStyles = isSelected ? styles.buttonSuccessHovered : {};
    return (
    <Button
    text={text}
    onPress={goToItem}
    small
    style={[styles.w100]}
    innerStyles={buttonInnerStyles}

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

  • We should only apply buttonSuccessHovered when isSelected & shouldUseSuccessStyle both are true and when shouldUseSuccessStyle is false and isSelected is true, we should apply buttonDefaultHovered.
const buttonInnerStyles = isSelected && shouldUseSuccessStyle ? styles.buttonSuccessHovered : isSelected && styles.buttonDefaultHovered;

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?


What alternative solutions did you explore? (Optional)

@jayeshmangwani
Copy link
Contributor

What significant difference is in your Propsoal @Krishna2323 then @bernhardoj 's propsosal ,I have tested it and it worked fine

@jayeshmangwani
Copy link
Contributor

@bernhardoj's proposal has been tested, and it looks good. We can proceed with it.

cc: @Gonals

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Dec 11, 2024

Current assignee @Gonals is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

@Krishna2323

This comment was marked as off-topic.

@jayeshmangwani
Copy link
Contributor

@Krishna2323 Could you provide an example where you think that the above condition might fail?

@Krishna2323
Copy link
Contributor

I apologize for the inconvenience, @jayeshmangwani. I misread the code. The selected proposal works well.

@jayeshmangwani
Copy link
Contributor

No issues, thanks for your proposal 🙌

@melvin-bot melvin-bot bot added the Daily KSv2 label Dec 11, 2024
@ChavdaSachin
Copy link
Contributor

@jayeshmangwani I understand this is a blocker issue but do you mind taking a look at my proposal.
Thank You.

@ChavdaSachin
Copy link
Contributor

ChavdaSachin commented Dec 11, 2024

Result comparison

Please notice button interactiveness

Currently Selected Proposal
Screen.Recording.2024-12-11.at.5.31.28.PM.mov
My Proposal
Screen.Recording.2024-12-11.at.5.29.10.PM.mov

cc. @jayeshmangwani

@luacmartins
Copy link
Contributor

luacmartins commented Dec 11, 2024

btw this was likely a regression from #53117. cc @NJ-2020 @mananjadhav

@luacmartins luacmartins removed the DeployBlockerCash This issue or pull request should block deployment label Dec 12, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Dec 12, 2024
@melvin-bot melvin-bot bot changed the title [$250] Search - Approve button becomes green when the held expense is selected via checkbox [HOLD for payment 2024-12-19] [$250] Search - Approve button becomes green when the held expense is selected via checkbox Dec 12, 2024
Copy link

melvin-bot bot commented Dec 12, 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 Dec 12, 2024
Copy link

melvin-bot bot commented Dec 12, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.74-8 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-19. 🎊

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

Copy link

melvin-bot bot commented Dec 12, 2024

@jayeshmangwani @RachCHopkins @jayeshmangwani 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]

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Dec 13, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-12-19] [$250] Search - Approve button becomes green when the held expense is selected via checkbox [HOLD for payment 2024-12-20] [HOLD for payment 2024-12-19] [$250] Search - Approve button becomes green when the held expense is selected via checkbox Dec 13, 2024
Copy link

melvin-bot bot commented Dec 13, 2024

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

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

Copy link

melvin-bot bot commented Dec 13, 2024

@jayeshmangwani @RachCHopkins @jayeshmangwani 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]

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Dec 18, 2024
@RachCHopkins
Copy link
Contributor

@jayeshmangwani can you complete the checklist so that I can get the payment organised, please?

@jayeshmangwani
Copy link
Contributor

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 (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 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: change report action button bg color if there's held expenses #53117 (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

Regression Test Proposal

Precondition:

  • The approvals feature is enabled.
  • The user is an admin and designated as the approver.

Test:

  1. Go to the Workspace Chat.
  2. Submit an expense.
  3. Open the Transaction Thread for the submitted expense.
  4. Click on the Report Header > Hold > Hold the Expense.
  5. Go to Search.
  6. Verify that the Approve button should appear gray by default.
  7. Verify that After selecting the expense using the checkbox, the Approve button should remain gray as long as the expense status is "Held"

Do we agree 👍 or 👎

@jayeshmangwani
Copy link
Contributor

@RachCHopkins Yes, the checklist is completed! 🙌

@RachCHopkins
Copy link
Contributor

Payment Summary:

  • Contributor: @bernhardoj to be paid $250 NewDot manual request
  • Contributor+: @jayeshmangwani to be paid $250 NewDot manual request

Upwork job here

@RachCHopkins
Copy link
Contributor

Contributors are ready to request payment, there are no contracts to complete, and the Upwork post has been closed.

@bernhardoj
Copy link
Contributor

Requested in ND.

@JmillsExpensify
Copy link

$250 approved for @bernhardoj

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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

10 participants