The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Fix right drawer not capture keys conflicting with app shortcuts
Charles Bochetfffb8c99cbcc
diff --git a/front/src/modules/comments/components/RightDrawerComments.tsx b/front/src/modules/comments/components/RightDrawerComments.tsxindex 804477f8b0a..eab5a97b7b9 100644--- a/front/src/modules/comments/components/RightDrawerComments.tsx+++ b/front/src/modules/comments/components/RightDrawerComments.tsx@@ -1,6 +1,8 @@import { useRecoilState } from 'recoil';import { CommentThreadForDrawer } from '@/comments/types/CommentThreadForDrawer';+import { useHotkeysScopeOnMountOnly } from '@/hotkeys/hooks/useHotkeysScopeOnMountOnly';+import { InternalHotkeysScope } from '@/hotkeys/types/internal/InternalHotkeysScope';import { RightDrawerBody } from '@/ui/layout/right-drawer/components/RightDrawerBody';import { RightDrawerPage } from '@/ui/layout/right-drawer/components/RightDrawerPage';import { RightDrawerTopBar } from '@/ui/layout/right-drawer/components/RightDrawerTopBar';@@ -15,6 +17,10 @@ import { CommentThread } from './CommentThread';export function RightDrawerComments() {const [commentableEntityArray] = useRecoilState(commentableEntityArrayState);+ useHotkeysScopeOnMountOnly({+ scope: InternalHotkeysScope.RightDrawer,+ customScopes: { goto: false, 'command-menu': true },+ });const { data: queryResult } = useGetCommentThreadsByTargetsQuery({variables: {diff --git a/front/src/modules/comments/components/RightDrawerCreateCommentThread.tsx b/front/src/modules/comments/components/RightDrawerCreateCommentThread.tsxindex d099851a487..78e497dc5f8 100644--- a/front/src/modules/comments/components/RightDrawerCreateCommentThread.tsx+++ b/front/src/modules/comments/components/RightDrawerCreateCommentThread.tsx@@ -1,3 +1,5 @@+import { useHotkeysScopeOnMountOnly } from '@/hotkeys/hooks/useHotkeysScopeOnMountOnly';+import { InternalHotkeysScope } from '@/hotkeys/types/internal/InternalHotkeysScope';import { RightDrawerBody } from '@/ui/layout/right-drawer/components/RightDrawerBody';import { RightDrawerPage } from '@/ui/layout/right-drawer/components/RightDrawerPage';import { RightDrawerTopBar } from '@/ui/layout/right-drawer/components/RightDrawerTopBar';@@ -5,6 +7,10 @@ import { RightDrawerTopBar } from '@/ui/layout/right-drawer/components/RightDrawimport { CommentThreadCreateMode } from './CommentThreadCreateMode';export function RightDrawerCreateCommentThread() {+ useHotkeysScopeOnMountOnly({+ scope: InternalHotkeysScope.RightDrawer,+ customScopes: { goto: false, 'command-menu': true },+ });return (<RightDrawerPage><RightDrawerTopBar title="New comment" />