Skip to content

Conversation

@BenHenning
Copy link
Collaborator

@BenHenning BenHenning commented Nov 27, 2025

The basics

The details

Resolves

Fixes #9456

Proposed Changes

Introduce and use new Block function for retrieving a configurably constrained singleton field for a given block. The constraints allow for some level of configuring (such as whether to isolate to only full or editable blocks). The existing simple reporter function has been retrofitted to use this new function, instead.

Reason for Changes

This expanded support fixes the underlying use case.

Separately, this change reveals two noteworthy details:

  1. There's inconsistency in the codebase as to when the singleton field needs to be editable, a full-block field, both, and neither. It would be ideal to make this consistent. Interestingly, the documentation for isSimpleReporter seems to have been wrong since it wasn't actually fulfilling its contract of returning an editable field (this has been retained for callsites except where the check was already happening).
  2. There's a possible recursion case now possible between getSingletonFullBlockField and isFullBlockField due to FieldInput's isFullBlockField depending on isSimpleReporter. Ideally this would be changed in the future to avoid that potential recursion risk (possibly as part of Design long-term technical solution for screen reader support #9307).

Test Coverage

No new automated tests are needed for this experimental work. Manual testing mainly comprised of cursory navigation and readout checks for single-field blocks to make sure nothing breaks. More thorough testing is difficult in core since the specific situation of multiple fields don't have a corresponding block to use in the playground to verify.

Automated tests are also being heavily relied on for correctness since all of the nuance behind the simple reporter cases would require a deeper testing pass.

Documentation

No new documentation needed for this experimental work.

Additional Information

None.

@BenHenning BenHenning changed the title feat: Expand single field block labeling feat: Expand single field block labeling (experimental) Nov 27, 2025
@github-actions github-actions bot added PR: feature Adds a feature and removed PR: feature Adds a feature labels Nov 27, 2025
@BenHenning
Copy link
Collaborator Author

There seems to be one legitimate deletion test failure caused by this. Exact cause is unclear and will require investigation.

@BenHenning
Copy link
Collaborator Author

@microbit-robert if you get a chance could you check to see whether this fix actually fixes micro:bit's use case? It may be well worth me looking to double check there aren't any playground blocks that we can use for this (or perhaps I could add one), but I do at least want to ensure that the fix actually does what it's supposed to per the original issue.

@microbit-robert
Copy link
Contributor

Thanks @BenHenning. This fixes the micro:bit use case when combined with a change in the keyboard-navigation plugin.

I think that block.isSimpleReporter in tryShowFullBlockFieldEditor needs true, true passing in, so that "Enter" actually opens the dropdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: feature Adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Screen reader] Missing aria details for shadow blocks in some cases

2 participants