From 55843193dcb914c0f6d226298179e18a5373c644 Mon Sep 17 00:00:00 2001 From: pihart Date: Wed, 2 Jun 2021 20:12:26 -0700 Subject: [PATCH 1/2] Action.Help is now Action.Bindings **WARNING:** CANNOT change the value from `help` to `keyboard` or `bindings` because existing localStore keymaps will be broken. See https://github.com/cjquines/qboard/issues/114 for a solution to this inflexibility --- src/components/Stylebar.tsx | 2 +- src/lib/action.ts | 2 +- src/lib/keyboard.ts | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/Stylebar.tsx b/src/components/Stylebar.tsx index aed575b6..98861314 100644 --- a/src/components/Stylebar.tsx +++ b/src/components/Stylebar.tsx @@ -23,7 +23,7 @@ const Stylebar = (props: { const otherActions = [ Action.Copy, Action.Paste, - Action.Help, + Action.Bindings, !isFullscreen ? Action.EnterFullScreen : Action.ExitFullScreen, ]; diff --git a/src/lib/action.ts b/src/lib/action.ts index f0ee2849..ef84b6ac 100644 --- a/src/lib/action.ts +++ b/src/lib/action.ts @@ -54,7 +54,7 @@ export enum Action { HalfFilled = "halfFilled", Filled = "filled", - Help = "help", + Bindings = "help", ResetStyles = "resetStyles", FullScreen = "fullScreen", EnterFullScreen = "enterFullScreen", diff --git a/src/lib/keyboard.ts b/src/lib/keyboard.ts index 522be38f..0a9f83ea 100644 --- a/src/lib/keyboard.ts +++ b/src/lib/keyboard.ts @@ -42,10 +42,10 @@ export const defaultKeys: KeyMap = { "ctrl + x": Action.Cut, "ctrl + c": Action.Copy, - "1": Action.Help, - "0": Action.Help, - "/": Action.Help, - "shift + /": Action.Help, + "1": Action.Bindings, + "0": Action.Bindings, + "/": Action.Bindings, + "shift + /": Action.Bindings, }; export default class KeyboardHandler { @@ -75,12 +75,12 @@ export default class KeyboardHandler { // for backwards compatibility, ensure help is bound if ( - Object.values(this.keyMap).every((action) => action !== Action.Help) + Object.values(this.keyMap).every((action) => action !== Action.Bindings) ) { - this.bind("0", Action.Help); - this.bind("1", Action.Help); - this.bind("/", Action.Help); - this.bind("shift + /", Action.Help); + this.bind("0", Action.Bindings); + this.bind("1", Action.Bindings); + this.bind("/", Action.Bindings); + this.bind("shift + /", Action.Bindings); } } } From 818101ccf1f33551004e7739e2af5d60ac6de5ba Mon Sep 17 00:00:00 2001 From: pihart Date: Wed, 2 Jun 2021 20:12:40 -0700 Subject: [PATCH 2/2] New Bindings action should have keyboard icon --- src/components/Icon.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Icon.tsx b/src/components/Icon.tsx index 8a7e9176..1dc23168 100644 --- a/src/components/Icon.tsx +++ b/src/components/Icon.tsx @@ -37,7 +37,7 @@ const Icon: Record & Record = { duplicate: fasIcon("clone"), - help: fasIcon("question"), + help: fasIcon("keyboard"), fullScreen: fasIcon("expand"), enterFullScreen: fasIcon("expand"), exitFullScreen: fasIcon("compress"),