(core) Changing shortcuts for adding and removing rows

Summary:
New shortcuts for removing and adding rows.
For adding a row we now have Mod+(Shift)+Enter
For removing rows we now have Mod+Delete/Mod+Backspace

Before removing rows, the user is prompted to confirm, this prompt
can be dismissed and this setting can be remembered. User needs
to confirm only when using shortcut.

Old shortcuts are still active and shows information about this change.
This information is shown only once, after this shortcuts have default
behavior (zooming).
New users don't see this explanation.

Test Plan: Updated

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3655
This commit is contained in:
Jarosław Sadziński
2022-10-21 12:55:01 +02:00
parent 0a8ce2178a
commit 6460c22a89
21 changed files with 582 additions and 105 deletions

View File

@@ -23,6 +23,10 @@ export interface UserPrefs extends Prefs {
recordSignUpEvent?: boolean;
// Theme-related preferences.
theme?: ThemePrefs;
// List of deprecated warnings user have seen.
seenDeprecatedWarnings?: DeprecationWarning[];
// List of dismissedPopups user have seen.
dismissedPopups?: DismissedPopup[];
}
// A collection of preferences related to a combination of user and org.
@@ -45,3 +49,25 @@ export interface UserOrgPrefs extends Prefs {
}
export type OrgPrefs = Prefs;
/**
* List of all deprecated warnings that user can see and dismiss.
* All of them are marked as seen for new users in FlexServer.ts (welcomeNewUser handler).
* For now we use then to mark which keyboard shortcuts are deprecated, so those keys
* are also used in commandList.js.
*/
export const DeprecationWarning = StringUnion(
'deprecatedInsertRowBefore',
'deprecatedInsertRecordAfter',
'deprecatedDeleteRecords',
);
export type DeprecationWarning = typeof DeprecationWarning.type;
/**
* List of all popups that user can see and dismiss
*/
export const DismissedPopup = StringUnion(
'deleteRecords', // confirmation for deleting records keyboard shortcut
'deleteFields' // confirmation for deleting columns keyboard shortcut
);
export type DismissedPopup = typeof DismissedPopup.type;