Skip to content

fix: Make IDs of comment bar buttons consistent - #10280

Open
gonfunko wants to merge 3 commits into
mainfrom
bar-button-ids
Open

fix: Make IDs of comment bar buttons consistent#10280
gonfunko wants to merge 3 commits into
mainfrom
bar-button-ids

Conversation

@gonfunko

Copy link
Copy Markdown
Contributor

The basics

The details

Proposed Changes

This PR makes the ID of comment bar button objects consistent with value of the id attribute of their focusable elements. Previously, the ID of the objects was identical to that of their parent comment, and different from the id attribute of their representation in the DOM. It also makes the id field publicly accessible.

In addition to making things more consistent and sensible, this also lays the groundwork for making these buttons focusable in block comments in Scratch; core Blockly only uses them in workspace comments, and hardcodes that logic in WorkspaceSvg's implementation of lookupFocusableNode(). With consistent (and public) IDs, they could be registered with the workspace's ComponentManager as having the FOCUSABLE capability, and the node resolution in lookupFocusableNode() would work. I actually plan to do another refactor to replace the entirety of lookupFocusableNode()'s implementation in core to depend on the ComponentManager, as doing so would make all lookups constant-time and thereby resolve #9162, along with making the code much simpler.

@gonfunko
gonfunko requested a review from a team as a code owner August 17, 2026 21:07
@gonfunko
gonfunko requested a review from lizschwab August 17, 2026 21:07
@github-actions github-actions Bot added the PR: fix Fixes a bug label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide more efficient mechanism for enumerating icons/bubbles

2 participants