-
Notifications
You must be signed in to change notification settings - Fork 6
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
add ControlPanelNode/PlayAreaNode to ScreenView.js #381
Comments
Marking as high priority since we should really know this sooner rather than later. My thought is to discuss this in an a11y meeting, then take it to all the devs for opinions. |
It feels like a fairly nice pattern to me.
The playArea/controlPanel nodes definitely need to be in the scene graph (otherwise they wouldn't be tied to an accessible display). |
Also, let me know if there's a specific meeting where I should be available to discuss (I don't have strong preferences, so up to you). |
Agreed, sorry for confusion, I meant they could be tacked onto the root node directly, and didn't have to be included in any sim structure that was set up prior to a11y implementation. Basically they can be nodes that are siblings to the node tree structure for the sim view. |
This is beginning to be accomplished in phetsims/joist#509 with |
Disussed in a11y dev today. We like that there is an option toggling the creation of the |
We want the names of the other nodes to be: |
I really don't think we should be doing this. This may be a good "conceptual" presentation for the end-user, but it's not generally appropriate for the structure of the scenegraph. |
After #365, this should generally not require changing the structure of the scene graph. Additional nodes on the ScreenView.call( this );
var otherNode = new Node();
var resetAllButton = new ResetAllButton();
this.addChild( resetAllButton )
this.addChild( otherNode );
this.playAreaNode.accessibleOrder = [ otherNode ];
this.controlAreaNode.accessibleOrder = [ resetAllButton ]; |
Adding developer meeting label since there will be strong opinions about this and this has long term impacts on a11y instrumentation. Current proposal for devs reading through this issue for the first time:
Nodes can be added directly to these children if that is best. But generally, they will just be in place to control the structure of the PDOM, used like the example in #381 (comment). In that example, the ResetAllButton is added as a child of the ScreenView, but its accessible content will appear under the "Control Area" section. |
Sounds good to me. Do we run into any current name conflicts that will need to be handled? And can you overwrite their accessibleOrder, or would it already have things on it? |
I haven't run into any, and didn't see any in a project wide search just now.
We could state an overarching convention that you can't set the play/controlArea's accessibleOrder also, and just have to add node's to them instead, but that may be confusing and dumb. |
That sounds too restrictive. Especially for older sims, I'd want to set the complete accessibleOrder of the node if possible. |
I agree that is ideal. For |
I'm confused about the example in #381 (comment) Does putting |
Yes. Generally, if you have a node parent/child and the child is in ANY accessibleOrder, it will not show up in the normal "tree" location. |
I generally like the approach proposed in #381 (comment) as well. My one question is how we'll handle some of the more complex screen summaries that we've seen thus far like RIAW? Would it be a new Node (possibly with children) than handles its own content updates that is then added as a child to the sim's var mySummaryNode = new FancyScreenSummaryNode( ...importantArgs );
this.screenSummaryNode.addChild( mySummaryNode ); |
I'm also wondering what happens if you don't add anything to |
My changes above are as follows:
@jessegreenberg ready for review. |
This and changes after #381 (comment) look good @zepumph, thank you. I also inspected usages in sims, I like this pattern. And I verified that order/structure in sims is correct with these Nodes. I think this can be closed. |
@pixelzoom recommended that I pass children into the ScreenView super constructor (phetsims/mean-share-and-balance#44), however @samreid and I ran into an assertion error. The assertion error was: The lines in question were: public override setChildren( children: Node[] ): this {
Node.prototype.setChildren.call( this, children );
if ( !this.hasChild( this.pdomParentNode ) ) {
this.addChild( this.pdomParentNode );
this.pdomParentNode.moveToBack();
}
return this;
} |
The above commit fixed this behavior. @jessegreenberg, can you review and if all seems good close? |
This makes sense, thanks! |
This name is a bloated way of asking, how do we want sims to use the a11y remapping implemented in #365 to look for phetsims? At the beginning of this issue, we were talking about putting "h2 level" nodes directly on the
ScreenView.js
. This could be pretty nice, especially with the remapping, and usages would look like:Note, these nodes wouldn't have to be in the sim's scene graph at all. so the scene graph would look like:
Tagging @jonathanolson @jessegreenberg for thoughts.
The text was updated successfully, but these errors were encountered: