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 305057] [Track Tax] - Selection highlight remains at previous default tax rate when the default rate changes #37419

Closed
6 tasks done
izarutskaya opened this issue Feb 28, 2024 · 10 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Weekly KSv2

Comments

@izarutskaya
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Found when validating PR : #36784

Version Number: v1.4.44-7
Reproducible in staging?: Y
Reproducible in production?: Y
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause-Internal Team

Action Performed:

Precondition:

  • User is an employee of Collect workspace.
  • The Collect workspace has some tax options.
  1. [Employee] Go to workspace chat.
  2. [Employee] Open request money page > Manual.
  3. [Employee] Enter amount and proceed to confirmation page.
  4. [Employee] Click Show more > Tax rate.
  5. [Admin] On Old Dot, change the default workspace tax rate.

Expected Result:

The selection highlight will move when the default tax rate changes.

Actual Result:

The selection highlight remains at the previous default tax rate when the default rate changes.

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

Bug6395231_1709112005217.bandicam_2024-02-28_03-18-56-373.mp4

View all open jobs on GitHub

@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 28, 2024
Copy link

melvin-bot bot commented Feb 28, 2024

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

@izarutskaya
Copy link
Author

@slafortune 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.

@izarutskaya
Copy link
Author

We think that this bug might be related to #wave6-collect-submitters
CC @greg-schroeder

@Krishna2323
Copy link
Contributor

Krishna2323 commented Feb 28, 2024

Proposal

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

Tax - Selection highlight remains at previous default tax rate when the default rate changes

What is the root cause of that problem?

We don't have any logic to update the focus index when initiallyFocusedOptionKey gets updated. We already update the initiallyFocusedOptionKey when default tax rate changes.

const selectedOptionKey = lodashGet(_.filter(lodashGet(sections, '[0].data', []), (policyTag) => policyTag.searchText === selectedTag)[0], 'keyForList');

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

We need to implement a logic to update the focusedIndex when initiallyFocusedOptionKey gets changed.

Example:

    const prevInitialKey = usePrevious(props.initiallyFocusedOptionKey);
    useEffect(() => {
        if (prevInitialKey === props.initiallyFocusedOptionKey) {
            return;
        }
        const indexOfInitiallyFocusedOption = _.findIndex(allOptions, (option) => option.keyForList === props.initiallyFocusedOptionKey);
        setFocusedIndex(indexOfInitiallyFocusedOption);
    }, [props.initiallyFocusedOptionKey, allOptions, prevInitialKey]);

We can also add a flag to only run above useEffect in specific cases like this.

Result

update_tax_highlight.mp4

@MonilBhavsar
Copy link
Contributor

Feature is WIP, so we can put this HOLD until we finish the implementation as it is being rolled out in phases https://github.com/Expensify/Expensify/issues/305057

@slafortune slafortune changed the title Tax - Selection highlight remains at previous default tax rate when the default rate changes [HOLD 305057]Tax - Selection highlight remains at previous default tax rate when the default rate changes Feb 29, 2024
@slafortune
Copy link
Contributor

I'll move this to weekly in the meantime.

@slafortune slafortune added Weekly KSv2 and removed Daily KSv2 labels Feb 29, 2024
@melvin-bot melvin-bot bot added the Overdue label Mar 11, 2024
@slafortune
Copy link
Contributor

PR is being reviewed - 33927

@melvin-bot melvin-bot bot removed the Overdue label Mar 13, 2024
@slafortune
Copy link
Contributor

Still on hold

@slafortune
Copy link
Contributor

Still on hold

@trjExpensify trjExpensify changed the title [HOLD 305057]Tax - Selection highlight remains at previous default tax rate when the default rate changes [HOLD 305057] [Track Tax] - Selection highlight remains at previous default tax rate when the default rate changes Apr 4, 2024
@trjExpensify
Copy link
Contributor

The likelihood of someone running into this is in practice is so unlikely. You'd have to be creating an expense and pausing on the tax input selector exactly at the time someone on the workspace settings edits the default. @MonilBhavsar if you haven't easily solved this in a PR that's coming for Track Tax, I'd close this.

@melvin-bot melvin-bot bot added the Overdue label Apr 5, 2024
@melvin-bot melvin-bot bot removed the Overdue label Apr 9, 2024
@github-project-automation github-project-automation bot moved this from Polish to Done in [#whatsnext] #wave-collect Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Weekly KSv2
Projects
No open projects
Archived in project
Development

No branches or pull requests

5 participants