Skip to content

Remove hotkey scope from useListenClickOutside #11098

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

Merged

Conversation

bosiraphael
Copy link
Contributor

The old useListenClickOutside API allowed us to pass a hotkeyScope as a parameter, the click outside was triggered only if the current hotkey scope matched the parameter. We don't want this anymore. This fixes a few bugs related to hotkey scopes inside the side panel.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR simplifies click-outside detection by removing hotkey scope functionality from the useListenClickOutside hook, addressing bugs related to side panel interactions.

  • Removed hotkeyScope parameter and associated logic from packages/twenty-front/src/modules/ui/utilities/pointer-event/hooks/useListenClickOutside.ts
  • Removed internalHotkeysEnabledScopesState dependency for cleaner click-outside detection
  • Updated CommandMenuContainer.tsx to remove AppHotkeyScope.CommandMenuOpen parameter
  • Click-outside events now trigger regardless of current hotkey scope state

2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -1,7 +1,6 @@
import React, { useEffect } from 'react';
import { useRecoilCallback } from 'recoil';

import { internalHotkeysEnabledScopesState } from '@/ui/utilities/hotkey/states/internal/internalHotkeysEnabledScopesState';
import { useClickOustideListenerStates } from '@/ui/utilities/pointer-event/hooks/useClickOustideListenerStates';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: typo in import path: 'useClickOustideListenerStates' should be 'useClickOutsideListenerStates'

@charlesBochet charlesBochet merged commit 3328998 into main Mar 21, 2025
29 checks passed
@charlesBochet charlesBochet deleted the r--remove-hotkey-scope-from-useListenClickOutside branch March 21, 2025 15:28
ijreilly pushed a commit that referenced this pull request Mar 24, 2025
The old `useListenClickOutside` API allowed us to pass a hotkeyScope as
a parameter, the click outside was triggered only if the current hotkey
scope matched the parameter. We don't want this anymore. This fixes a
few bugs related to hotkey scopes inside the side panel.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants