Skip to content

Conversation

seveibar
Copy link
Contributor

Original work by @puskuruk but for some reason github stopped tracking authorship after rebase

@seveibar seveibar changed the title [WIP] Feature: Keyboard Shortcuts (rebased to master) [WIP] Feature: Keyboard Shortcuts (rebased on master) Mar 19, 2020
| {| type: "HEADER_BUTTON_CLICKED", buttonName: string |}
| {| type: "SELECT_TOOL", selectedTool: string |}
| {| type: "SELECT_TOOL", selectedTool: ToolEnum |}
| {| type: "CANCEL" |}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to add new actions here...

{| type: "GO_TO_NEXT_IMAGE" |}

{| type: "GO_TO_PREV_IMAGE" |}

},
"next-image": {
//TODO: { type: "GO_TO_NEXT_IMAGE" }
name: "Next Image"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

each of these should have static actions defined. e.g.

// ... "next-image": { "name": "Next Image", "action": { type: "GO_TO_NEXT_IMAGE" } } // ... 
onShortcutActionDispatched({
type: "SELECT_TOOL",
selectedTool: actionId
})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change this to...

onShortcutActionDispatched(shortcut.action)
@seveibar
Copy link
Contributor Author

seveibar commented Mar 19, 2020

In image-reducer.js you'll want to grab the action for GO_TO_NEXT_IMAGE and GO_TO_PREV_IMAGE and change the state accordingly. It'll look something like this...

//... case "GO_TO_NEXT_IMAGE": return setIn(state, ["selectedImage"], (currentImageIndex + 1) % state.images.length) //...
@puskuruk puskuruk assigned seveibar and unassigned seveibar Mar 24, 2020
@seveibar seveibar merged commit d9bd91f into master Mar 26, 2020
@seveibar seveibar deleted the feature/keyboard-shortcuts-rebase branch March 26, 2020 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants