Skip to content

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

Description

@IuliiaHerets

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

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 27, 2024
  2. melvin-bot commented on Sep 27, 2024

    @melvin-bot

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

  3. melvin-bot commented on Sep 27, 2024

    @melvin-bot

    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.

  4. github-actions commented on Sep 27, 2024

    @github-actions
    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.
  5. IuliiaHerets commented on Sep 27, 2024

    @IuliiaHerets
    Author

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

  6. bondydaa commented on Sep 27, 2024

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

  7. bondydaa commented on Sep 27, 2024

    @bondydaa
    Contributor

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

  8. added and removed on Sep 27, 2024
  9. Nodebrute commented on Sep 28, 2024

    @Nodebrute
    Contributor

    @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
  10. bernhardoj commented on Sep 28, 2024

    @bernhardoj
    Contributor

    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}
    
  11. IuliiaHerets commented on Sep 28, 2024

    @IuliiaHerets
    Author

    @bondydaa @muttmuure This issue happens to all RHP

    20240928_061855.mp4
  12. melvin-bot commented on Sep 30, 2024

    @melvin-bot

    ⚠️ 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.

  13. bondydaa commented on Sep 30, 2024

    @bondydaa
    Contributor

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

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

  14. bondydaa commented on Oct 2, 2024

    @bondydaa
    Contributor

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

  15. melvin-bot commented on Oct 3, 2024

    @melvin-bot

    ⚠️ 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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions