Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-1801] improvement: open shortcut guide using `shift+/` key combination. (#5000)

Prateek Shourya78e040597100
diff --git a/web/core/components/command-palette/command-palette.tsx b/web/core/components/command-palette/command-palette.tsx
index c5aa94d839..acb1701d21 100644
--- a/web/core/components/command-palette/command-palette.tsx
+++ b/web/core/components/command-palette/command-palette.tsx
@@ -139,11 +139,6 @@ export const CommandPalette: FC = observer(() => {
description: "Create a new issue in the current project",
action: () => toggleCreateIssueModal(true),
},
- h: {
- title: "Show shortcuts",
- description: "Show all the available shortcuts",
- action: () => toggleShortcutModal(true),
- },
},
workspace: {
p: {
@@ -199,16 +194,22 @@ export const CommandPalette: FC = observer(() => {
const handleKeyDown = useCallback(
(e: KeyboardEvent) => {
- const { key, ctrlKey, metaKey, altKey } = e;
+ const { key, ctrlKey, metaKey, altKey, shiftKey } = e;
if (!key) return;
const keyPressed = key.toLowerCase();
const cmdClicked = ctrlKey || metaKey;
+ const shiftClicked = shiftKey;
if (cmdClicked && keyPressed === "k" && !isAnyModalOpen) {
e.preventDefault();
toggleCommandPaletteModal(true);
}
+
+ if (shiftClicked && (keyPressed === "?" || keyPressed === "/") && !isAnyModalOpen) {
+ e.preventDefault();
+ toggleShortcutModal(true);
+ }
// if on input, textarea or editor, don't do anything
if (
e.target instanceof HTMLTextAreaElement ||
diff --git a/web/core/components/command-palette/shortcuts-modal/commands-list.tsx b/web/core/components/command-palette/shortcuts-modal/commands-list.tsx
index d121f247a0..e72e92e0b9 100644
--- a/web/core/components/command-palette/shortcuts-modal/commands-list.tsx
+++ b/web/core/components/command-palette/shortcuts-modal/commands-list.tsx
@@ -29,7 +29,7 @@ export const ShortcutCommandsList: React.FC<Props> = (props) => {
{ keys: "V", description: "Create view" },
{ keys: "D", description: "Create page" },
{ keys: "Delete", description: "Bulk delete issues" },
- { keys: "H", description: "Open shortcuts guide" },
+ { keys: "Shift,/", description: "Open shortcuts guide" },
{
keys: platform === "MacOS" ? "Ctrl,control,C" : "Ctrl,Alt,C",
description: "Copy issue URL from the issue details page",