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-03-07] [$500] Web - IOU - I can't navigate using the "Tab" key #36513

Closed
1 of 6 tasks
lanitochka17 opened this issue Feb 14, 2024 · 24 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Feb 14, 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.41.1
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: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Open FAB > Request money
  2. Select manual, enter a value and click "Next"
  3. Select a workspace chat
  4. Press the "Tab" key

Expected Result:

I should be able to use it

Actual Result:

I can't navigate using the "Tab" key. It works in task request flow

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

Bug6379431_1707920607011.bandicam_2024-02-14_05-45-36-762.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0144e80c4837a63c84
  • Upwork Job ID: 1757791324532207616
  • Last Price Increase: 2024-02-14
  • Automatic offers:
    • cubuspl42 | Reviewer | 0
    • bernhardoj | Contributor | 0
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Feb 14, 2024
@melvin-bot melvin-bot bot changed the title Web - IOU - I can't navigate using the "Tab" key [$500] Web - IOU - I can't navigate using the "Tab" key Feb 14, 2024
Copy link

melvin-bot bot commented Feb 14, 2024

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

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

melvin-bot bot commented Feb 14, 2024

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

Copy link

melvin-bot bot commented Feb 14, 2024

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

@lanitochka17
Copy link
Author

We think that this bug might be related to #vip-vsp
CC @quinthar

@bernhardoj
Copy link
Contributor

Proposal

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

Can't navigate using the TAB key on the money request page.

What is the root cause of that problem?

In #35154, we intentionally disable the TAB to "fix" #26326.

useEffect(() => {
const handler = (event) => {
if (event.code !== CONST.KEYBOARD_SHORTCUTS.TAB.shortcutKey) {
return;
}
event.preventDefault();
event.stopPropagation();
};
KeyDownPressListener.addKeyDownPressListener(handler);
return () => KeyDownPressListener.removeKeyDownPressListener(handler);
}, []);

But this affected all money request page, including participant and confirmation page.

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

We should unregister the tab listener when the screen is out focus. We can use useFocusEffect to achieve it.

useFocusEffect(
    useCallback(() => {
        const handler = (event) => {
            if (event.code !== CONST.KEYBOARD_SHORTCUTS.TAB.shortcutKey) {
                return;
            }
            event.preventDefault();
            event.stopPropagation();
        };
        KeyDownPressListener.addKeyDownPressListener(handler);

        return () => KeyDownPressListener.removeKeyDownPressListener(handler);
}, []));

What alternative solutions did you explore? (Optional)

This isn't the best solution, but just in case. We can store the navigation focus state to a ref and return early if the page is not focused anymore.

@cubuspl42
Copy link
Contributor

@bernhardoj

Just to confirm, does your solution keep #26326 fixed?

@damadoko
Copy link

Proposal

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

Can not navigate by tab key in request money page.

What is the root cause of that problem?

Since #35154 to fix #26326

useEffect(() => {
const handler = (event) => {
if (event.code !== CONST.KEYBOARD_SHORTCUTS.TAB.shortcutKey) {
return;
}
event.preventDefault();
event.stopPropagation();
};
KeyDownPressListener.addKeyDownPressListener(handler);
return () => KeyDownPressListener.removeKeyDownPressListener(handler);
}, []);

This change disable all tab actions in request money page (which wrapped by IOURequestStartPage component)

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

  1. Revert above code to get back normal behaviors.
  2. Set css attribute: visibility: hidden to not-active TopTab.Screen, all focusable child of that element will not tab(able) anymore.
<TopTab.Screen name={CONST.TAB_REQUEST.MANUAL}>
  {({navigation}) => {
    const state = navigation.getState();
    if (state?.index === 0) return <IOURequestStepAmount route={route} />;

    return (
        <View style={visibility.hidden}>
           <IOURequestStepAmount route={route} />;
         </View>
     );
}}

What alternative solutions did you explore? (Optional)

Above solution need to change all TopTab.Screen implementation. I think about more generic solution which make changes in OnyxTabNavigator's children:

{React.Children.map(children, (child, i) => {
  if (!React.isValidElement(child) || child.type !== TopTab.Screen || !isFunction(child.props.children)) {
    return child;
  }

  return React.cloneElement(child, {
    children: (props) => {
      const state = props?.navigation?.getState();
      if (state.index === i) {
        return child.props.children(props);
      }
      return <View style={visibility.hidden}>{child.props.children(props)}</View>;
    },
  });
})}

Copy link

melvin-bot bot commented Feb 15, 2024

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

@damadoko
Copy link

Contributor details
Your Expensify account email: damadoko1@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~012cb272a7b7771f06

Copy link

melvin-bot bot commented Feb 15, 2024

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

@bernhardoj
Copy link
Contributor

@cubuspl42 yes

@cubuspl42
Copy link
Contributor

@damadoko I'm confused by the behavior of the discussed tab component (TopTab.Navigator). Is the content of non-active tabs actually rendered to the DOM tree?

@damadoko
Copy link

@cubuspl42 yes, it actually render non-active tabs to the DOM tree as #26326 (comment) mentioned. This bug only happens with TopTab.Navigator.
The original #26326 included 2 different issues:

  1. When press tab, focus is moved, the whole tab navigator elements move too.
  2. When press tab, focus can move out of RHP. (Seem like we try to address it here [$500] Improve Tab Navigation & Accessibility #36476)

@melvin-bot melvin-bot bot added the Overdue label Feb 19, 2024
@cubuspl42
Copy link
Contributor

I decided to approve the proposal by @bernhardoj.

Both proposals suggested to keep the useEffect block introduced by #35154. I believe it's cleaner to improve its behavior than to introduce another solution for dealing with the "Tab" key (namely CSS visibility property).

C+ reviewed 🎀 👀 🎀

Copy link

melvin-bot bot commented Feb 19, 2024

Triggered auto assignment to @mountiny, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 19, 2024
Copy link

melvin-bot bot commented Feb 19, 2024

📣 @cubuspl42 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Feb 19, 2024

📣 @bernhardoj 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@iwiznia iwiznia removed the External Added to denote the issue can be worked on by a contributor label Feb 19, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @cubuspl42

@alexpensify
Copy link
Contributor

alexpensify commented Feb 28, 2024

Update: The PR is waiting for @mountiny's review but I'll try to find a replacement. I think you are offline.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Feb 29, 2024
@melvin-bot melvin-bot bot changed the title [$500] Web - IOU - I can't navigate using the "Tab" key [HOLD for payment 2024-03-07] [$500] Web - IOU - I can't navigate using the "Tab" key Feb 29, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 29, 2024
Copy link

melvin-bot bot commented Feb 29, 2024

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

Copy link

melvin-bot bot commented Feb 29, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.45-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-03-07. 🎊

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

Copy link

melvin-bot bot commented Feb 29, 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:

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

@alexpensify
Copy link
Contributor

Awesome, looks like automation kicked in here.


Heads up, I will be offline until Tuesday, March 5, 2024. I will not be actively watching over this GitHub during that period. If anything urgent is needed here, please ask for help in the Open Source Slack Room-- thanks!

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Mar 7, 2024
@alexpensify
Copy link
Contributor

Alright, I've completed the payment summary here:

#36513 (comment)

For this Upwork Job:

https://www.upwork.com/jobs/~0144e80c4837a63c84


Closing - Everyone has been paid via Upwork.

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
Projects
None yet
Development

No branches or pull requests

7 participants