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-04-05] [Simplified Collect][Taxes] - Tax rate editor is not auto-focused #38836

Closed
6 tasks done
kbecciv opened this issue Mar 22, 2024 · 20 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 Engineering

Comments

@kbecciv
Copy link

kbecciv commented Mar 22, 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: 1.4.56-0
Reproducible in staging?: y
Reproducible in production?: n
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • User is admin of Collect workspace.
  1. Go to staging.new.expensify.com.
  2. Go to Profile > Workspaces > Collect workspace.
  3. Go to Taxes.
  4. Add a tax rate.
  5. Click on the tax rate added in Step 4.
  6. Click Value.

Expected Result:

The tax rate editor will be auto-focused.

Actual Result:

The tax rate editor is not auto-focused.

Workaround:

n/a

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

Bug6423420_1711127534361.20240323_011019.mp4

View all open jobs on GitHub

@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Mar 22, 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.

@kbecciv
Copy link
Author

kbecciv commented Mar 22, 2024

We think that this bug might be related to #wave-control

Copy link

melvin-bot bot commented Mar 22, 2024

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

@kosmydel
Copy link
Contributor

This PR addresses this issue.

@abbasifaizan70
Copy link

abbasifaizan70 commented Mar 22, 2024

Re-stated Problem:
The auto-focus feature on the tax rate editor is not functioning as expected. When a user clicks on the tax rate value, the input field should automatically gain focus, but it currently does not.

Root Cause:
The issue likely stems from the ref (inputCallbackRef) not being properly forwarded to the native input element within the AmountForm component. The useAutoFocusInput hook seems to be intended for this purpose, but if the child component does not correctly implement forwardRef or does not pass the ref down to the actual DOM element, the focus method will not be triggered.

Proposed Solution:
Ensure that the AmountForm component (or whichever component is wrapped by InputWrapper) properly implements the forwarding of refs using React.forwardRef and useImperativeHandle. Here's an outline of changes:

Modify the AmountForm component to accept a ref and use useImperativeHandle to forward this ref to the actual input element.
Ensure the inputCallbackRef is passed to the InputWrapper and consequently to the AmountForm.
Confirm that the lifecycle of the component aligns with when the auto-focus should be triggered, possibly using the useEffect hook if necessary.

Pseudo-code Example:

// AmountForm component
const AmountForm = React.forwardRef((props, ref) => {
  const inputRef = React.useRef();
  React.useImperativeHandle(ref, () => ({
    focus: () => {
      inputRef.current.focus();
    },
  }));

  return <input ref={inputRef} {...props} />;
});

// Usage in ValuePage
<InputWrapper
  InputComponent={AmountForm}
  ref={inputCallbackRef}
  // ...other props
/>

Alternatives Explored:
An alternative solution might be to manually trigger the focus on the input element via a side effect when the component mounts or updates, without using useAutoFocusInput, but this would be less reusable and might not align with the existing design patterns in the codebase.

Contributor details
Your Expensify account email: abbasi.faizan1997@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/faizanabbasi70

Copy link

melvin-bot bot commented Mar 22, 2024

📣 @abbasifaizan70! 📣
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>

Copy link

melvin-bot bot commented Mar 22, 2024

⚠️ Missing/invalid email or upwork profile link. Please make sure you add both your Expensify email and Upwork profile link in the format specified.

1 similar comment
Copy link

melvin-bot bot commented Mar 22, 2024

⚠️ Missing/invalid email or upwork profile link. Please make sure you add both your Expensify email and Upwork profile link in the format specified.

@abbasifaizan70
Copy link

⚠️ Missing/invalid email or upwork profile link. Please make sure you add both your Expensify email and Upwork profile link in the format specified.

Contributor details
Your Expensify account email: abbasi.faizan1997@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/faizanabbasi70

Copy link

melvin-bot bot commented Mar 22, 2024

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@luacmartins
Copy link
Contributor

Demoting to NAB

@luacmartins
Copy link
Contributor

I can take this since it's part of Simplified Collect

@luacmartins luacmartins added Daily KSv2 Monthly KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 Daily KSv2 Monthly KSv2 labels Mar 22, 2024
@luacmartins luacmartins changed the title Taxes - Tax rate editor is not auto-focused [Simplified Collect][Taxes] - Tax rate editor is not auto-focused Mar 22, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 Weekly KSv2 labels Mar 22, 2024
@melvin-bot melvin-bot bot changed the title [Simplified Collect][Taxes] - Tax rate editor is not auto-focused [HOLD for payment 2024-04-05] [Simplified Collect][Taxes] - Tax rate editor is not auto-focused Mar 29, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 29, 2024
Copy link

melvin-bot bot commented Mar 29, 2024

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

Copy link

melvin-bot bot commented Mar 29, 2024

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

Copy link

melvin-bot bot commented Apr 5, 2024

Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.

@luacmartins luacmartins added the Bug Something is broken. Auto assigns a BugZero manager. label Apr 5, 2024
Copy link

melvin-bot bot commented Apr 5, 2024

Triggered auto assignment to @sonialiap (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Apr 5, 2024
@luacmartins
Copy link
Contributor

@sonialiap could you please assist with payment since @s77rt reviewed the linked PR?

@melvin-bot melvin-bot bot added the Overdue label Apr 8, 2024
@sonialiap
Copy link
Contributor

All looks good, processing payment

@s77rt $500 - offer sent

@melvin-bot melvin-bot bot removed the Overdue label Apr 8, 2024
@s77rt
Copy link
Contributor

s77rt commented Apr 8, 2024

@sonialiap Accepted! Thanks!

@sonialiap
Copy link
Contributor

Paid ✔️

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
Projects
No open projects
Archived in project
Development

No branches or pull requests

7 participants