Repository navigation
Workspace - Nothing happens after pressing ESC key on workspace editor #49869
Description
Activity
- addedDeployBlockerCashThis issue or pull request should block deploymentThis issue or pull request should block deploymentBugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on Sep 27, 2024 Triggered auto assignment to @bondydaa (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.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.github-actions commented
on Sep 27, 2024 on Sep 27, 2024 – with GitHub ActionsContributorMore actions👋 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:
- Identify the pull request that introduced this issue and revert it.
- Find someone who can quickly fix the issue.
- Fix the issue yourself.
We think that this bug might be related to #wave-collect - Release 1
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.
- removedDeployBlockerCashThis issue or pull request should block deploymentThis issue or pull request should block deployment
on Sep 27, 2024 started a discussion here (internal slack) https://expensify.slack.com/archives/C03U7DCU4/p1727472828047069
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.
App/src/components/Search/SearchRouter/SearchRouter.tsx
Lines 62 to 65 in 71db3f1
useKeyboardShortcut(CONST.KEYBOARD_SHORTCUTS.ESCAPE, () => { closeSearchRouter(); clearUserQuery(); }); The SearchRouter is added to the AuthScreens which is available app wide.
<SearchRouter /> Because of that, the shortcut here to close RHP doesn't work anymore.
App/src/libs/Navigation/AppNavigator/AuthScreens.tsx
Lines 308 to 320 in 71db3f1
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.
App/src/components/Search/SearchRouter/SearchRouter.tsx
Lines 62 to 65 in 71db3f1
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}@bondydaa @muttmuure This issue happens to all RHP
20240928_061855.mp4
⚠️ Looks like this issue was linked to a Deploy Blocker hereIf 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.
looks like the offending PR was reverted here #49185 (comment) / #49922
Looks @IuliiaHerets can you retest when you have a moment and confirm?
just tested myself and see the esc key working as expected again on RHP and as described to go back from workspace settings. closing.
⚠️ Looks like this issue was linked to a Deploy Blocker hereIf 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.
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:
Expected Result:
App will return to Workspaces list.
Actual Result:
Nothing happens after pressing ESC key on workspace editor.
Workaround:
Unknown
Platforms:
Screenshots/Videos
View all open jobs on GitHub