-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Voicing] Implement individual hands #413
Comments
Above is a start. I only have responses on end drag right now, not "during" drag. I still need to work out how GFLB was doing that and make things right. I also am just using exact alerts from description, and I think they are a bit too verbose. @terracoda this is as much as I could get to today, and likely won't have more time before our meeting Friday. Here is a dev version now even though it is really quite rough. |
This is a great start @zepumph! I am glad you have just implemented the default descriptions for now. I think that is an excellent approach. Here are few things I am noticing right off the bat:
Again, a really great start! |
And just an FYI, I really like that I can turn off context changes (position information) and just hear ratio information. |
I think I just implemented (1) above, but I could be wrong |
For 2, we created a whole set of outside Properties that could change the description (aria-valuetext) of the sliders, so I just linked to all of those. I think it is working better now to update the context and object responses. |
(3) will get worked on over in #416. There are two issues with that one. The most pressing is that by asking for the distance progress with voicing, we nullify the distance progress for description. (basically the second time we call it, the function thinks there has been no change). |
@zepumph, I am still hearing position or progress information when I click on a hand and do not move it. I checked this version https://bayes.colorado.edu/dev/html/ratio-and-proportion/1.2.0-dev.2/phet/ratio-and-proportion_en_phet.html I'll check phettest :-) |
Another issue with mouse input:
When I check any of the checkboxes in the preferences menu, I no longer hear the name response, I just hear the responses associated with the checkboxes. Note that for keyboard input, the responses that fire on keyboard focus are working correctly and as expected when different checkboxes are checked. @zepumph, can you make the mouse click with no value change work the same, like this:
|
Today @terracoda and I spoke about this further, going through the table column by column. We realized it would be best if we focused on implementing the keyboard interaction before worrying about the timing of the mouse. This will be able to occur after #417 #416 and mostly phetsims/sun#730 |
Here is a first pass at using common code to achieve this. Here is the work that is done, and behavior expected:
NOTE: The context responses for distance progress are broken, so you only hear distance from other hand. |
hmm...
|
I was making progress on implementing the voicing we talked about that is specific to mouse drags, but I couldn't really test because of phetsims/scenery#1337. Here is the current patch of work: Index: js/common/view/RatioHalf.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/view/RatioHalf.ts b/js/common/view/RatioHalf.ts
--- a/js/common/view/RatioHalf.ts (revision 71ae824c11bc540f702d072dd474551814c719ea)
+++ b/js/common/view/RatioHalf.ts (date 1642721270169)
@@ -292,9 +292,8 @@
a11yCreateAriaValueText: createObjectResponse,
voicingCreateObjectResponse: createObjectResponse,
- // TODO: comment back in once https://github.com/phetsims/ratio-and-proportion/issues/416 is fixed
- // a11yCreateContextResponseAlert: () => this.getSingleHandContextResponse(),
- voicingCreateContextResponse: () => this.getSingleHandContextResponse(),
+ a11yCreateContextResponseAlert: () => this.getSingleHandContextResponse(),
+ // voicingCreateContextResponse: () => this.getSingleHandContextResponse(),
a11yDependencies: options.a11yDependencies.concat( [ options.ratioLockedProperty ] ),
voicingNameResponse: options.accessibleName // accessible name is also the voicing name response
} );
@@ -396,9 +395,16 @@
viewSounds.tickMarkBumpSoundClip.onInteract( positionProperty.value.y );
// @ts-ignore
- this.ratioHandNode.voicingOnChangeResponse( {
- utterance: voicingUtteranceForDrag
- } );
+ this.ratioHandNode.voicingObjectResponse = createObjectResponse();
+
+ // @ts-ignore
+ this.ratioHandNode.voicingSpeakResponse( {
+ utterance: voicingUtteranceForDrag,
+ contextResponse: this.handPositionsDescriber.getSingleHandDistanceProgressSentence( this.ratioTerm ),
+
+ // @ts-ignore
+ objectResponse: this.ratioHandNode.voicingObjectResponse
+ } );
},
end: () => {
@@ -426,10 +432,16 @@
// Only voice a response if the value changed
if ( startingY !== positionProperty.value.y ) {
- // TODO: should this have the object response too, or just the context repsonse?? https://github.com/phetsims/ratio-and-proportion/issues/413
+ // @ts-ignore
+ this.ratioHandNode.voicingObjectResponse = createObjectResponse();
+
// @ts-ignore
- this.ratioHandNode.voicingOnEndResponse( {
- onlyOnValueChange: false // don't use the AccessibleValueHandler's start, and instead handle it ourselves
+ this.ratioHandNode.voicingSpeakResponse( {
+ utterance: voicingUtteranceForDrag,
+ contextResponse: this.handPositionsDescriber.getSingleHandDistanceRegionSentence( this.ratioTerm ),
+
+ // @ts-ignore
+ objectResponse: this.ratioHandNode.voicingObjectResponse
} );
}
else {
Index: js/common/view/describers/HandPositionsDescriber.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/view/describers/HandPositionsDescriber.ts b/js/common/view/describers/HandPositionsDescriber.ts
--- a/js/common/view/describers/HandPositionsDescriber.ts (revision 71ae824c11bc540f702d072dd474551814c719ea)
+++ b/js/common/view/describers/HandPositionsDescriber.ts (date 1642721073532)
@@ -73,7 +73,7 @@
private ratioTupleProperty: Property<RAPRatioTuple>;
private tickMarkDescriber: TickMarkDescriber;
- private previousDistanceRegion: null | string;
+ private previousDistanceLowercaseRegion: null | string;
private previousDistance: number;
public static QUALITATIVE_POSITIONS: string[];
@@ -89,8 +89,13 @@
// @private - keep track of previous distance regions to track repetition, and alter description accordingly. This
// is used for any modality getting a distance region in a context response.
- this.previousDistanceRegion = null;
+ this.previousDistanceLowercaseRegion = null;
this.previousDistance = ratioTupleProperty.value.getDistance();
+
+ ratioTupleProperty.lazyLink( ( newValue, oldValue ) => {
+ this.previousDistance = oldValue.getDistance();
+ this.previousDistanceLowercaseRegion = this.getDistanceRegion( false );
+ } );
}
/**
@@ -162,8 +167,7 @@
/**
* NOTE: These values are copied over in RAPPositionRegionsLayer, consult that Node before changing these values.
*/
- public getDistanceRegion( lowercase = false ): string {
- const distance = this.ratioTupleProperty.value.getDistance();
+ public getDistanceRegion( lowercase: boolean, distance: number = this.ratioTupleProperty.value.getDistance() ): string {
assert && assert( TOTAL_RANGE.getLength() === 1, 'these hard coded values depend on a range of 1' );
@@ -204,12 +208,32 @@
return ( lowercase ? DISTANCE_REGIONS_LOWERCASE : DISTANCE_REGIONS_CAPITALIZED )[ index ];
}
+ public getSingleHandDistanceRegionSentence( ratioTerm: RatioTerm ): string {
+ const otherHand = ratioTerm === RatioTerm.ANTECEDENT ? rightHandLowerString : leftHandLowerString;
+
+ const distanceRegion = this.getDistanceRegion( false );
+
+ return StringUtils.fillIn( ratioAndProportionStrings.a11y.handPosition.distanceOrDistanceProgressClause, {
+ otherHand: otherHand,
+ distanceOrDistanceProgress: distanceRegion
+ } );
+ }
+
+ public getSingleHandDistanceProgressSentence( ratioTerm: RatioTerm ): string {
+ const otherHand = ratioTerm === RatioTerm.ANTECEDENT ? rightHandLowerString : leftHandLowerString;
+
+ return StringUtils.fillIn( ratioAndProportionStrings.a11y.handPosition.distanceOrDistanceProgressClause, {
+ otherHand: otherHand,
+ distanceOrDistanceProgress: this.getDistanceProgressString()
+ } );
+ }
+
public getSingleHandDistance( ratioTerm: RatioTerm ): string {
const otherHand = ratioTerm === RatioTerm.ANTECEDENT ? rightHandLowerString : leftHandLowerString;
- const distanceRegion = this.getDistanceRegion();
+ const distanceRegion = this.getDistanceRegion( false );
- if ( distanceRegion === this.previousDistanceRegion ) {
+ if ( this.getDistanceRegion( true ) === this.previousDistanceLowercaseRegion ) {
const distanceProgressPhrase = this.getDistanceProgressString();
if ( distanceProgressPhrase ) {
@@ -219,13 +243,10 @@
} );
// Count closer/farther as a previous so that we don't ever get two of them at the same time
- this.previousDistanceRegion = distanceProgressDescription;
return distanceProgressDescription;
}
}
- this.previousDistanceRegion = distanceRegion;
-
return StringUtils.fillIn( ratioAndProportionStrings.a11y.handPosition.distanceOrDistanceProgressClause, {
otherHand: otherHand,
distanceOrDistanceProgress: distanceRegion
@@ -236,7 +257,7 @@
const distanceRegion = this.getDistanceRegion( true );
if ( overrideWithDistanceProgress ) {
- if ( distanceRegion === this.previousDistanceRegion ) {
+ if ( distanceRegion === this.previousDistanceLowercaseRegion ) {
assert && assert( capitalized, 'overriding with distance-progress not supported for capitalized strings' );
const distanceProgressPhrase = this.getDistanceProgressString( {
@@ -249,11 +270,9 @@
} );
// Count closer/farther as a previous so that we don't ever get two of them at the same time
- this.previousDistanceRegion = distanceProgressDescription;
return distanceProgressDescription;
}
}
- this.previousDistanceRegion = distanceRegion;
}
const pattern = capitalized ? ratioAndProportionStrings.a11y.bothHands.handsDistancePatternCapitalized :
@@ -277,7 +296,6 @@
distanceProgressString = filledOptions.fartherString;
}
- this.previousDistance = currentDistance;
return distanceProgressString;
}
}
|
Testing Notes from latest versions Jan 21, 2022
|
|
Testing Notes from latest versions Feb 18, 2022
|
At this point, I think the last item here will be covered over in #429. I'm going to close this, please reopen if there is more to discuss, or feel free to open new issues to report bugs you find. |
No description provided.
The text was updated successfully, but these errors were encountered: