Skip to content

Conversation

@gonfunko
Copy link
Contributor

@gonfunko gonfunko commented Jul 14, 2025

This PR fixes #636 by adding support for using keyboard navigation with block comments. Most of the logic was added to core Blockly in RaspberryPiFoundation/blockly#9227, but this PR (1) enables navigating into the bubbles of all bubble-having icons, adds styling to indicate that bubbles are focused, and adds tests. The UX for interacting with block comments is:

  1. Focus the comment icon.
  2. Enter will then open the comment bubble and focus the comment editor.
  3. Comment text can be edited as normal.
  4. On Escape or Command Enter, the edits will be committed and the block comment bubble will be focused.
  5. On a second Escape, the block comment bubble will be dismissed and focus will be restored to the comment icon.

The intermediate focus state on the bubble is to allow moving/resizing block comment bubbles, which is not yet implemented but will be in the future (along with the same behavior for mutator bubbles).

@gonfunko gonfunko requested a review from a team as a code owner July 14, 2025 19:31
@gonfunko gonfunko requested review from cpcallen and removed request for a team July 14, 2025 19:31
@microbit-robert
Copy link
Contributor

We have been testing block comment navigation with this PR and found that you can get into a situation where the block comment is open and the block comment icon has focus. When pressing Enter or Space at this point, the block comment is closed, but the focus unexpectedly moves forward to the next field/input in the block. Please see the video below for an example of this:

Screen.Recording.2025-07-15.at.12.06.05.mov

@gonfunko
Copy link
Contributor Author

Thanks for flagging, that's been resolved.

@microbit-matt-hillsdon
Copy link
Contributor

More/broader feedback in this doc.

Copy link
Collaborator

@rachel-fenichel rachel-fenichel left a comment

Choose a reason for hiding this comment

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

I'm approving this so that it's easier to play with and modify this part of navigation.

If we need to do a release and specifically don't want this, it's easy to pull out.

None of the current proposals for navigation of block comments feels fully baked right now, so we'll need more iterating on behaviour.

@gonfunko gonfunko merged commit c9fcb52 into main Jul 18, 2025
8 checks passed
@gonfunko gonfunko deleted the block-comment-nav branch July 18, 2025 22:11
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.

6 participants