-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat: field label improvements (experimental) #9470
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
base: add-screen-reader-support-experimental
Are you sure you want to change the base?
feat: field label improvements (experimental) #9470
Conversation
This also fills in more field labels (particularly for options) and adds example 'where am I?' shortcuts for team testing.
|
This needs a bunch of explanation and work yet. It largely adds good naming for fields and drop-downs for all but the dynamic cases (since those are trickier and may need some additional work to make it possible). It also splits field labels into type and values and largely keeps the type out of the block readout unless using new shortcuts. Two new shortcuts:
These are meant to provide initial possibilities as part of addressing RaspberryPiFoundation/blockly-keyboard-experimentation#764. |
|
From feedback: ensure fields always read out their type + value (verbose) when focused. |
core/field.ts
Outdated
| * | ||
| * @returns An ARIA representation of the field's value. | ||
| */ | ||
| abstract getAriaValue(): string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this not be abstract and have a default implementation that returned an empty string (or null)? I found myself going through and returning empty strings for quite a few custom fields in order to get up and running with this change, and having a default implementation would reduce the overhead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was on the fence of going with a default implementation but this gives strong incentive to. Within core Blockly we more or less need to explicitly decide what to provide here in all cases so I didn't have enough context to decide on a default value.
Could you maybe provide some context on why so many of your custom fields have an empty string? I'd expect that to be atypical in general since I expect that basically all fields have a non-default value (except maybe text input when nothing has yet been inputted).
…ity-shortcuts Conflicts: core/block_svg.ts
…ity-shortcuts Conflicts: core/block_svg.ts
This fixes the build being broken.
## The basics - [x] I [validated my changes](https://developers.google.com/blockly/guides/contribute/core#making_and_verifying_a_change) ## The details ### Resolves Fixes part of RaspberryPiFoundation/blockly-keyboard-experimentation#764 Fixes part of #9450 (infrastructure needs) ### Proposed Changes Introduces support for two new "where am I?" shortcuts for helping to provide location context for users: - `I`: re-reads the current selected block with full verbosity (i.e. also includes the block's field types with their values in the readout). - `shift+I`: reads the current selected block's parent with full verbosity. Note that this includes some functional changes to `Field` to allow for more powerful customization of a field's ARIA representation (by splitting up value and type), though a field's value defaults potentially to null which will be ignored in the final ARIA computed label. This seems necessary per the discussion here: https://github.com/RaspberryPiFoundation/blockly/pull/9470/files#r2541508565 but more consideration may be needed here as part of #9307. Some limitations in the new shortcuts: - They will not read out anything if a block is not selected (e.g. for fields and icons). - They read out input blocks when the input block is selected. - They cannot read out anything while in move mode (due to the behavior here in the plugin which automatically cancels moves if an unknown shortcut is pressed: https://github.com/RaspberryPiFoundation/blockly-keyboard-experimentation/blob/a36f3662b05c2ddcd18bde8745777fff8dc3df31/src/actions/mover.ts#L166-L191). - The readout is limited by the problems of dynamic ARIA announcements (per #9460). ### Reason for Changes RaspberryPiFoundation/blockly-keyboard-experimentation#764 provides context on the specific needs addressed here. ### Test Coverage Self tested. No new automated tests needed for experimental work. ### Documentation No new documentation needed for experimental work. ### Additional Information This was spun out of #9470 with the intent of getting shortcuts initially working checked in even if the entirety of the experience is incomplete.
|
The shortcut bits have been moved out of this branch and into #9481 (which is now merged into the experimental branch). Bringing this up-to-date to focus on specifically the label improvements. |
|
Hmm I inadvertently undid my changes. :) Edit: They should now be back. I still need to go through and double check that all fields have been accounted for, and add support for blocks defined through functions rather than JSON. |
This reverts commit 6a7e5e0. Conflicts: blocks/math.ts
The basics
The details
Resolves
Fixes #9450
Proposed Changes
Reason for Changes
Test Coverage
Documentation
Additional Information