feat(debug): Events shortcuts, stages support & minor fixes#791
Merged
Conversation
We were assigning shortcuts for boardgame.io events (`endTurn` etc.), which mostly made the shortcut assignment code redundant, because the repeated events starting with `e` would never allow us to assign shortcuts matching the first letter of moves. This was additionally redundant as we weren’t actually using the event shortcuts anywhere.
Uses the `Move` component to render the `endStage`, `endTurn`, and `endPhase` events as interactive functions with associated keyboard shortcuts. Shortcuts are 7, 8, 9 to minimize collisions with move shortcuts. Addresses #771
Closes #771 Previously, the debug panel only read the moves & events dispatchers from the client when instantiated. This prevented users from toggling between players and dispatching moves from the debug panel as different players with stages, because the move/event would be out-of-date (created with the wrong playerID). This change makes sure we’re always referencing the latest dispatchers.
The content-editable field in the interactive function can receive focus, e.g. by tabbing to it. Activating it correctly disables other shortcuts during typing and styles the focus state as expected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR pulls together some small features and bug fixes to improve the debug panel:
Add keyboard shortcuts for game events. Instead of “End Turn” etc. being shown as buttons, they are rendered using the same component as moves (supporting argument input). I’ve assigned the shortcuts 7, 8, 9 for these. (c5683da, e107103)
Support dispatching moves as any active player when using stages (as requested in Debug panel keyboard shortcuts for selecting among activePlayers and end turn/end phase/end stage #771). (03f7b2c)
Make the player ID buttons keyboard accessible. This isn’t quite the same as adding a shortcut for toggling through player IDs, but it seems a fairly good solution to tab through and activate the desired ID. (9a640c4)
Fix a logic bug in the Info pane. (e757efe)
Fix a bug when the interactive function component received focus using the tab key. (7868ff3)
Fix Debug panel styling of selects affects page elements #782 and some other styling refactors/tweaks. (5c4eacd, 08afc9f, cefca05)