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

Workspace - Nothing happens after pressing ESC key on workspace editor #49869

Closed
2 of 6 tasks
IuliiaHerets opened this issue Sep 27, 2024 · 13 comments
Closed
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering

Comments

@IuliiaHerets
Copy link

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.41-1
Reproducible in staging?: Y
Reproducible in production?: N
Email or phone of affected tester (no customers): applausetester+kh2591@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Account settings > Workspaces.
  3. Click on any workspace.
  4. Press ESC key.

Expected Result:

App will return to Workspaces list.

Actual Result:

Nothing happens after pressing ESC key on workspace editor.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

View all open jobs on GitHub

@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Sep 27, 2024
Copy link

melvin-bot bot commented Sep 27, 2024

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

Copy link

melvin-bot bot commented Sep 27, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Sep 27, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Sep 27, 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.

@IuliiaHerets
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@bondydaa
Copy link
Contributor

I don't think this needs to be a blocker and I'm not actually sure if that is a useful UX pattern to have.

@bondydaa bondydaa removed the DeployBlockerCash This issue or pull request should block deployment label Sep 27, 2024
@bondydaa
Copy link
Contributor

bondydaa commented Sep 27, 2024

started a discussion here (internal slack) https://expensify.slack.com/archives/C03U7DCU4/p1727472828047069

@bondydaa bondydaa added Daily KSv2 and removed Hourly KSv2 labels Sep 27, 2024
@Nodebrute
Copy link
Contributor

Nodebrute commented Sep 28, 2024

@bondydaa The problem is that we can’t close any RHP (Right-Hand Panel) using the Escape key. This feature used to work in our app and it's a regression from this PR

On production:

Screen.Recording.2024-09-28.at.5.58.40.AM.mov

@bernhardoj
Copy link
Contributor

bernhardoj commented Sep 28, 2024

Edited by proposal-police: This proposal was edited at 2024-09-28 05:06:59 UTC.

Proposal

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

Pressing ESC doesn't close RHP/Full screen navigator.

What is the root cause of that problem?

The ESC shortcut is overridden by the SearchRouter shortcut here.

useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ESCAPE, () => {
closeSearchRouter();
clearUserQuery();
});

The SearchRouter is added to the AuthScreens which is available app wide.

Because of that, the shortcut here to close RHP doesn't work anymore.

const unsubscribeEscapeKey = KeyboardShortcut.subscribe(
shortcutConfig.shortcutKey,
() => {
if (modal.current.willAlertModalBecomeVisible) {
return;
}
if (modal.current.disableDismissOnEscape) {
return;
}
Navigation.dismissModal();
},

This somehow happens after #49185 where we migrate from withOnyx to useOnyx. Before migration, the SearchRouter shortcut is subscribed first, followed by the AuthScreen shortcut. The reason the SearchRouter shortcut still works is that we enable bubbling in the AuthScreen shortcut.

After the migration, the AuthScreen shortcut is subscribed first, followed by the SearchRouter shortcut. So, pressing ESC will trigger the SearchRouter shortcut.

Even though this happens after #49185, I'd say the root cause is coming from the initial PR that adds the SearchRouter.

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

In SearchRouter, only enable the shortcut when visible.

useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ESCAPE, () => {
closeSearchRouter();
clearUserQuery();
});

useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ESCAPE, () => {
    closeSearchRouter();
    clearUserQuery();
}, {isActive: isSearchRouterDisplayed});

const [userSearchQuery, setUserSearchQuery] = useState<SearchQueryJSON | undefined>(undefined);

However, I noticed that we only clear the query when closing the modal using ESC, but the query state stays if we close it by simply clicking outside the modal. To solve this, instead of clearing the query inside the shortcut, we can clear it when the modal closes.

onModalHide={clearUserQuery}

@IuliiaHerets
Copy link
Author

@bondydaa @muttmuure This issue happens to all RHP

20240928_061855.mp4

Copy link

melvin-bot bot commented Sep 30, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

@bondydaa
Copy link
Contributor

looks like the offending PR was reverted here #49185 (comment) / #49922

Looks @IuliiaHerets can you retest when you have a moment and confirm?

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 30, 2024
@bondydaa
Copy link
Contributor

bondydaa commented Oct 2, 2024

just tested myself and see the esc key working as expected again on RHP and as described to go back from workspace settings. closing.

@bondydaa bondydaa closed this as completed Oct 2, 2024
@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2024
Copy link

melvin-bot bot commented Oct 3, 2024

⚠️ Looks like this issue was linked to a Deploy Blocker here

If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

If a regression has occurred and you are the assigned CM follow the instructions here.

If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

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. Daily KSv2 Engineering
Projects
None yet
Development

No branches or pull requests

5 participants