Skip to content

Commit c74d7fe

Browse files
authored
Fix hotkey scope in settings (#12387)
Too many conflicts on hotkey scopes (e.g. we still had the issue on the graphql playground). Let's disable all shortcuts in settings.
1 parent c7139cb commit c74d7fe

File tree

3 files changed

+6
-67
lines changed

3 files changed

+6
-67
lines changed

packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsx

Lines changed: 5 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import { getRecordIndexIdFromObjectNamePluralAndViewId } from '@/object-record/u
3232
import { AppBasePath } from '@/types/AppBasePath';
3333
import { AppPath } from '@/types/AppPath';
3434
import { PageHotkeyScope } from '@/types/PageHotkeyScope';
35-
import { SettingsPath } from '@/types/SettingsPath';
3635
import { useSetHotkeyScope } from '@/ui/utilities/hotkey/hooks/useSetHotkeyScope';
3736
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
3837
import { isDefined } from 'twenty-shared/utils';
@@ -152,27 +151,12 @@ export const PageChangeEffect = () => {
152151
break;
153152
}
154153
case isMatchingLocation(location, AppPath.RecordShowPage): {
155-
setHotkeyScope(PageHotkeyScope.CompanyShowPage, {
154+
setHotkeyScope(PageHotkeyScope.RecordShowPage, {
156155
goto: true,
157156
keyboardShortcutMenu: true,
158157
});
159158
break;
160159
}
161-
case isMatchingLocation(location, AppPath.OpportunitiesPage): {
162-
setHotkeyScope(PageHotkeyScope.OpportunitiesPage, {
163-
goto: true,
164-
keyboardShortcutMenu: true,
165-
});
166-
break;
167-
}
168-
case isMatchingLocation(location, AppPath.TasksPage): {
169-
setHotkeyScope(PageHotkeyScope.TaskPage, {
170-
goto: true,
171-
keyboardShortcutMenu: true,
172-
});
173-
break;
174-
}
175-
176160
case isMatchingLocation(location, AppPath.SignInUp): {
177161
setHotkeyScope(PageHotkeyScope.SignInUp);
178162
break;
@@ -201,47 +185,12 @@ export const PageChangeEffect = () => {
201185
setHotkeyScope(PageHotkeyScope.PlanRequired);
202186
break;
203187
}
204-
case isMatchingLocation(
205-
location,
206-
SettingsPath.ProfilePage,
207-
AppBasePath.Settings,
208-
): {
209-
setHotkeyScope(PageHotkeyScope.ProfilePage, {
210-
goto: true,
211-
keyboardShortcutMenu: true,
212-
});
213-
break;
214-
}
215-
case isMatchingLocation(
216-
location,
217-
SettingsPath.Domain,
218-
AppBasePath.Settings,
219-
): {
220-
setHotkeyScope(PageHotkeyScope.Settings, {
221-
goto: false,
222-
keyboardShortcutMenu: true,
223-
});
224-
break;
225-
}
226-
case isMatchingLocation(
227-
location,
228-
SettingsPath.RestPlayground,
229-
AppBasePath.Settings,
230-
): {
188+
case location.pathname.startsWith(AppBasePath.Settings): {
231189
setHotkeyScope(PageHotkeyScope.Settings, {
232190
goto: false,
233-
keyboardShortcutMenu: true,
234-
});
235-
break;
236-
}
237-
case isMatchingLocation(
238-
location,
239-
SettingsPath.WorkspaceMembersPage,
240-
AppBasePath.Settings,
241-
): {
242-
setHotkeyScope(PageHotkeyScope.WorkspaceMemberPage, {
243-
goto: true,
244-
keyboardShortcutMenu: true,
191+
keyboardShortcutMenu: false,
192+
commandMenu: false,
193+
commandMenuOpen: false,
245194
});
246195
break;
247196
}

packages/twenty-front/src/modules/types/PageHotkeyScope.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,5 @@ export enum PageHotkeyScope {
66
InviteTeam = 'invite-team',
77
SyncEmail = 'sync-email',
88
PlanRequired = 'plan-required',
9-
ShowPage = 'show-page',
10-
PersonShowPage = 'person-show-page',
11-
CompanyShowPage = 'company-show-page',
12-
CompaniesPage = 'companies-page',
13-
PeoplePage = 'people-page',
14-
OpportunitiesPage = 'opportunities-page',
15-
ProfilePage = 'profile-page',
16-
WorkspaceMemberPage = 'workspace-member-page',
17-
TaskPage = 'task-page',
9+
RecordShowPage = 'record-show-page',
1810
}

packages/twenty-front/src/modules/ui/layout/hooks/__tests__/useShowAuthModal.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ const testCases = [
4545
{ loc: AppPath.PlanRequiredSuccess, res: true },
4646

4747
{ loc: AppPath.Index, res: false },
48-
{ loc: AppPath.TasksPage, res: false },
49-
{ loc: AppPath.OpportunitiesPage, res: false },
5048
{ loc: AppPath.RecordIndexPage, res: false },
5149
{ loc: AppPath.RecordShowPage, res: false },
5250
{ loc: AppPath.SettingsCatchAll, res: false },

0 commit comments

Comments
 (0)