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-09-25] [Search v2.1][$250] The “Enter” key on the search page randomly opens the workspace switcher or the RHP #49080

Closed
1 of 6 tasks
m-natarajan opened this issue Sep 12, 2024 · 19 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Sep 12, 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: 9.0.33-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: @suneox
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1726117464938269

Action Performed:

  1. Go to the search page
  2. Click Enter
  3. Observe the workspace switcher opens
  4. Click out of the workspace switcher
  5. Click Chats
  6. Click Expenses
  7. Click Outstanding
  8. Click Enter
  9. Observe the RHP opens.

Expected Result:

The workspace switcher or the RHP does not open when clicking Enter on the search page.

Actual Result:

The workspace switcher and RHP open when clicking Enter

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

Screen.Recording.2024-09-12.at.02.49.56.mp4

View all open jobs on GitHub

Recording.539.mp4
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021834395341977846523
  • Upwork Job ID: 1834395341977846523
  • Last Price Increase: 2024-09-13
  • Automatic offers:
    • ikevin127 | Reviewer | 103975534
Issue OwnerCurrent Issue Owner: @ikevin127
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 12, 2024
Copy link

melvin-bot bot commented Sep 12, 2024

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

@suneox
Copy link
Contributor

suneox commented Sep 12, 2024

I think the expected behavior at step 6 is that the report detail page should not be shown, due to the lack of context to select which expense from the list.

@trjExpensify
Copy link
Contributor

Hm, I'm not sure about this actually. Why would we open anything at all when Enter is clicked? We don't do that on other pages. @luacmartins am I missing something on why the Enter key is opening the workspace switcher here?

@luacmartins
Copy link
Contributor

My best guess is that we have focus trap on some button and we're triggering that onPress behavior when pressing enter

@trjExpensify trjExpensify changed the title The behavior of the “Enter” key is inconsistent on the search expenses screen. The “Enter” key on the search page randomly opens the workspace switcher or the RHP Sep 13, 2024
@trjExpensify
Copy link
Contributor

Yeah, so I think the expected behaviour here is that the workspace switcher nor the expense RHP opens when you randomly click Enter on the search page.

@trjExpensify trjExpensify added the External Added to denote the issue can be worked on by a contributor label Sep 13, 2024
@melvin-bot melvin-bot bot changed the title The “Enter” key on the search page randomly opens the workspace switcher or the RHP [$250] The “Enter” key on the search page randomly opens the workspace switcher or the RHP Sep 13, 2024
Copy link

melvin-bot bot commented Sep 13, 2024

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

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

melvin-bot bot commented Sep 13, 2024

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

@luacmartins luacmartins self-assigned this Sep 13, 2024
@bernhardoj
Copy link
Contributor

bernhardoj commented Sep 13, 2024

Edited by proposal-police: This proposal was edited at 2024-09-14 16:33:40 UTC.

Proposal

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

Pressing enter while on the search page opens the workspace switcher page.

What is the root cause of that problem?

When we open the search page, the focus trap for the search bottom tab screen is activated which will focus on the workspace switcher page. So, pressing enter will open the ws switcher page. But actually, we have a code to disable the focus trap for bottom tab screens.

const isActive = useMemo(() => {
if (typeof focusTrapSettings?.active !== 'undefined') {
return focusTrapSettings.active;
}
// Focus trap can't be active on bottom tab screens because it would block access to the tab bar.
if (BOTTOM_TAB_SCREENS.find((screen) => screen === route.name)) {
return false;
}

However, the bottom tab screens don't include the search bottom tab screen yet.

const BOTTOM_TAB_SCREENS = [SCREENS.HOME, SCREENS.SETTINGS.ROOT, NAVIGATORS.BOTTOM_TAB_NAVIGATOR];

After fixing the above issue, we still have another issue where pressing Enter will open the report RHP in Expenses and Invoices tab. That's because the "View" action button has a ppressOnEnter enabled which enabled the enter shortcut for the button.

if (action === CONST.SEARCH.ACTION_TYPES.VIEW || shouldUseViewAction) {
return isLargeScreenWidth ? (
<Button
text={translate(actionTranslationsMap[CONST.SEARCH.ACTION_TYPES.VIEW])}
onPress={goToItem}
small
pressOnEnter

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

Add the search bottom tab screen to the list.

const BOTTOM_TAB_SCREENS = [SCREENS.HOME, SCREENS.SETTINGS.ROOT, NAVIGATORS.BOTTOM_TAB_NAVIGATOR, SCREENS.SEARCH.BOTTOM_TAB];

Remove pressOnEnter from the action button.

if (action === CONST.SEARCH.ACTION_TYPES.VIEW || shouldUseViewAction) {
return isLargeScreenWidth ? (
<Button
text={translate(actionTranslationsMap[CONST.SEARCH.ACTION_TYPES.VIEW])}
onPress={goToItem}
small
pressOnEnter
style={[styles.w100]}
innerStyles={buttonInnerStyles}
link={isChildListItem}
shouldUseDefaultHover={!isChildListItem}
/>
) : null;
}
if (action === CONST.SEARCH.ACTION_TYPES.REVIEW) {
return (
<Button
text={text}
onPress={goToItem}
small
pressOnEnter
style={[styles.w100]}
innerStyles={buttonInnerStyles}
/>
);

@ikevin127
Copy link
Contributor

@bernhardoj Thanks for your proposal. While your solution does seem to fix the fact that Enter opens the workspace switcher, we're still left with the issue of the RHP opening (see video below).

Screen.Recording.2024-09-13.at.20.02.51.mov

@bernhardoj
Copy link
Contributor

Oh, I was trying to repro it on the Chats type but no success. Turns out it's reproducible on the Expenses and Invoices tab. Updated my proposal!

@ikevin127
Copy link
Contributor

🎉 Thanks for the update! @bernhardoj's updated proposal looks good to me - the RCA is correct and the updated solution fixes the issue according to the Expected result 👍

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Sep 14, 2024

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

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

melvin-bot bot commented Sep 15, 2024

📣 @ikevin127 🎉 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

@bernhardoj
Copy link
Contributor

PR is ready

cc: @ikevin127

@ikevin127
Copy link
Contributor

⚠️ Automation failed here -> this should be on [HOLD for Payment 2024-09-25] according to today's production deploy from Deploy Checklist: New Expensify 2024-09-17 which was shipped to production today.

cc @trjExpensify

@trjExpensify trjExpensify changed the title [$250] The “Enter” key on the search page randomly opens the workspace switcher or the RHP [HOLD for Payment 2024-09-25] [$250] The “Enter” key on the search page randomly opens the workspace switcher or the RHP Sep 18, 2024
@trjExpensify trjExpensify added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Sep 18, 2024
@trjExpensify
Copy link
Contributor

Thanks!

@luacmartins luacmartins changed the title [HOLD for Payment 2024-09-25] [$250] The “Enter” key on the search page randomly opens the workspace switcher or the RHP [HOLD for Payment 2024-09-25] [Search v2.1][$250] The “Enter” key on the search page randomly opens the workspace switcher or the RHP Sep 19, 2024
@trjExpensify
Copy link
Contributor

Payment summary as follows:

Closing!

@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. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
Status: Done
Development

No branches or pull requests

7 participants