Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add keyboard shortcuts #553

Merged
merged 33 commits into from
Dec 6, 2024
Merged

Add keyboard shortcuts #553

merged 33 commits into from
Dec 6, 2024

Conversation

microbit-grace
Copy link

@microbit-grace microbit-grace commented Dec 2, 2024

This PR addresses this issue: Add keyboard shortcuts
Related closed issue: Regions + shortcuts

  • Adds keyboard shortcuts as detailed below.
  • Tweaks debounce for action name input so that we can immediately tab to record btn.
  • Migrates the dialog states into the store so that we can prevent dialogs overlapping. Keyboard shortcuts should be disabled when a dialog is opened.
  • Remove duplication in feedback form and in delete action row confirmation dialog.

Below's list is adapted from related issues. Bullet point items have not been implemented.

Data page

(i.e. before training a model)

Shortcuts:

  • Add action
  • Record: to trigger an interstitial dialog "Record sample for {action} yes/no" so as to clarify row focus and delay time-sensitivity of the Record dialog.
  • Train model (? - maybe not particularly helpful as it's an occasional action)
  • Row navigation: next/previous action?
  • Save
  • Settings
  • Connect micro:bit
  • Disconnect
  • Rename current action (F2)

Model testing page

(i.e. after training)

Shortcuts

  • Row navigation: next/previous action?
  • Edit in MakeCode
  • Disconnect
  • Jump to graph (focus for aria-live announcements)
  • Jump between each action's "certainty for {class}" live readout (if we made it live)?

Copy link

github-actions bot commented Dec 2, 2024

Preview build will be at
https://review-createai.microbit.org/shortcuts/

@microbit-grace microbit-grace changed the base branch from dialogs to main December 3, 2024 09:49
@microbit-grace microbit-grace changed the base branch from main to dialogs December 3, 2024 09:49
So that the delay does not apply when updating the name from length 0 to something
Base automatically changed from dialogs to main December 3, 2024 12:16
@microbit-grace microbit-grace changed the title [WIP - DO NOT MERGE] Add keyboard shortcuts Add keyboard shortcuts Dec 3, 2024
@microbit-grace microbit-grace marked this pull request as ready for review December 3, 2024 12:51
@microbit-grace microbit-grace marked this pull request as draft December 3, 2024 13:42
@microbit-grace microbit-grace changed the title Add keyboard shortcuts [WIP] Add keyboard shortcuts Dec 3, 2024
- Centralise whether dialog is opened in store
- Refactor suppressing of overlapping dialogs
The reset settings confirmation dialog is opened within settings dialog, so the settings dialog state is sufficient.
and use connection stage hook instead
@microbit-grace microbit-grace changed the title [WIP] Add keyboard shortcuts Add keyboard shortcuts Dec 4, 2024
@microbit-grace microbit-grace marked this pull request as ready for review December 4, 2024 11:10
@microbit-grace microbit-grace requested a review from a team December 4, 2024 11:11
@microbit-robert
Copy link

My thoughts for discussion with the web team:

  • Should connect and disconnect be the same shortcut that changes behaviour based on the current connection state?
  • Should the settings dialog also toggle (open and close via the same shortcut). Not critical because escape will close it.
  • The edit in MakeCode shortcut doesn't seem worth it as the button sits inside a region and it's not a regular action.
  • Perhaps the left and right arrows should focus the name input and record button, respectively (switch between the grid items horizontally).
  • The rename shortcut should probably be scoped to when focus is inside the selected row. At the moment, focus can be on the main action bar and F2 will still focus the selected row name.

@microbit-grace
Copy link
Author

microbit-grace commented Dec 4, 2024

I think the suggestions from @microbit-robert all seems reasonable, @microbit-matt-hillsdon what are you thoughts on them? Thanks!

@microbit-matt-hillsdon
Copy link

  • The rename shortcut should probably be scoped to when focus is inside the selected row. At the moment, focus can be on the main action bar and F2 will still focus the selected row name.

Not so sure about switching to a toggle approach - kinda nice not to have to know the current state to try an action. Might be helpful for screenreader users.

No strong view on "Edit in MakeCode".

The rest of Rob's suggestions make sense to me.

@microbit-matt-hillsdon microbit-matt-hillsdon merged commit 46e51f3 into main Dec 6, 2024
1 check passed
@microbit-matt-hillsdon microbit-matt-hillsdon deleted the shortcuts branch December 6, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants