-
Notifications
You must be signed in to change notification settings - Fork 0
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
Dynamic strings should use i tags instead of em tags #67
Comments
I remember that we had a discussion about this a while back and couldn't find notes. I remember @zepumph having a nice way to handle this, but can't remember exactly what was discussed. In the meantime, here is one potential way to do this:
PROS:
CONS:
|
To get around the CONS, we could either
|
@jessegreenberg, I think it is ok that examples like "Grab {{balloonLabel}}"} would get styled as dynamic content. We could, however, easily override the style a nested tag inside buttons, inputs and other controls should we choose to do so with something like this: button i {
border-bottom: none; /*(or text-decoration none)*/
background-color: inherit; /*(or blue)*/
} |
Good point @terracoda, that would work for the case of BASE. |
Could we get a consensus on how to proceed with this issue? |
@zepumph do you have any thoughts about #67 (comment)? I would be happy to proceed with that unless you have concerns or a better recommendation. |
I'm still in brainstorming mode. To me this doesn't necessarily seem like a pro to me. Handling this completely in the a11y view is a post processing step, which we will have to maintain as things change in the sim. What would be pros and cons of automatically surrounding a11y strings using PROS I'm not sure about this, but want to discuss further. Marking for a11y dev meeting. |
Discussed in a11y dev meeting on 2/21/18. We like the proposal in #67 (comment), but still have questions about the second bullet point. Right now, a11y strings are in separate .js/.json files (they should all be converted to .json in the future), and are added to the phet namespace. From here we can modify string values in initializeAccessibility() in Sim.js. But when a11y strings are moved to translatable string files, we won't be able to access them. We can't think of a way around this. We don't want to proceed because we don't want to paint ourselves into a corner later. We explored manipulating the string plugin to modify values, but ran into problems because the built sim hardcodes the strings in. |
#67 (comment) is very complicated. @zepumph suggested that we wrap dynamic a11y descriptions with To add the |
Another idea worth investigating - can we do this with MutationObserver alone by comparing diffs of mutations? |
Discussed in a11y meeting 3/2/18 - @terracoda suggested using a span with a class because which will not have any unwanted semantics. @jhung agrees. @terracoda suggested testing behavior of adding span, i, em, or b tags. |
@zepumph said that a solution in the a11y-view is less maintainable because because it is separate from the sim. |
We will discuss next steps in an a11y dev meeting. |
@jessegreenberg, @terracoda , and @zepumph - I spoke with @klown and here's what he thought: For the record, the a11y mapping for em is not semantic at all. It's mapped to a style: https://w3c.github.io/html-aam/#el-em (I wonder why…). The same with strong. So, it looks like using em and strong semantically is lost at the level of the a11y tree. Hence, don't use them. The decision you and the PhET people made [i.e. using |
@jhung and @klown, where does it say in the specification that the "a11y mapping for em is not semantic at all"? I'm not sure how to read the specification ;-) I would also argue that style itself does communicate have meaning, especially in terms of a user's experience. For example, headings are bigger and bolder to communicate their importance. Maybe a better way to frame the problem is that we do not want to miss-communicate with style. Here's a classic miss-communication example In the case of the Sims Ohm's Law and Resistance in a Wire, I have heard JAWS read out content within I think that we should try to avoid a change in tone of voice when dynamic strings are read out by AT. If a If we only put the needed tags (whichever one works best) in the A11y View's PDOM copy, then we would not be messing with the Sim User Experience at all. Is that what you were getting at @jessegreenberg and @zepumph . If that is a possible route to consider, it might be might be the safest. |
@terracoda my comment was quoting what @klown said (aka. Joseph Scheuhammer at the IDRC). |
We looked into that a little bit, but only adding tags in the a11y view would be more difficult to implement. |
@terracoda I spoke with @klown to get some clarification on his comment. He said that the Klown was surprised that this was the behaviour because there should be semantics, but the API doesn't give it. |
@jhung thanks. I agree that it is strange that the "semantics" for Getting back to our actual issue, we are trying to create the simplest CSS hook through which we can easily and consistently style dynamic parameters within dynamic descriptions when represented in a sim's A11y View. Even though it is a bit more code, perhaps the surest non-semantic option is a <span class="parameter">some dynamic content</span> |
From reading the above comments, I don't know if this is because of the spec, or just how it is; nor do I know how this may change in the future. The above commit is beside the point though, because it has been settled that a span is the best option for provided zero semantics to an element for syntax highlighting. Let's proceed with the following directive: Dynamic strings should be wrapped in a classed span to provide opportunity for syntax highlighting in the a11y view. Please correct the above bold if that is an incorrect focus for the rest of the issue. Here are the following questions/ideas to figure out:
|
I'm leaning more and more toward just having this for postprocessing on the a11y view, although it seems like the implementation may be more complicated. |
@zepumph, post processing on the ally view is the ideal situation in my opinion. This would keep extraneous non-semantic elements out of the PDOM and sim code in general. We do not yet know all the use cases, nor all the useful applicable aspects of our descriptive content, so I hate to hard code something in where it should not be. With little experience with PhET-iO, I can't comment too much on that. For accessible sims that are available on PhET-iO, it seems we would need to make all descriptions (static, dynamic, and interactive alerts) available in some way, at least to verify any changes to the visual sim would remain in synch with changes to in the non-visual representation of the sim. |
@zepumph, you are manipulating the strings somewhere along line. Are there multiple places along the line that the strings are being manipulated, or just one place? |
I want to make sure we are all on the same page about the current state of this issue, the problem at hand, and the potential solution we are looking for. Currently we are adding css to
So that being said, we have two sims, RIAW and OL, that just happen to use When we separate these two pieces out into the very different things that they are, we see independent features of the sim. From here on let's ignore that fact that these sims use the We also decided that in the a11y view, we would rather have So we want a11y view styling for dynamic strings, and we don't want to interfere with the actual strings that will be translatable and stored in the sim. I am quite stumped as to how to get this. @jessegreenberg, didn't you look into the Backtracking a bit to talk about manipulation of strings on the sim side (sorry for the longest github message), the easiest solution from an engineering perspective would be to just manually add the All in all, I don't love either of the solutions in the penultimate paragraph, nor do I love the idea of messing with the |
Talked about during the IDRC meeting today. We discussed the following:
|
Clarification, @terracoda recommended styling the full dynamic descriptions or regions. That would not involve i-tags :-) |
Thanks for speaking up, I must have missed something towards the end there. Could you clarify? How would we mark which regions were fully dynamic (and needed the styling) if not |
@jessegreenberg, brought up a great point in the meeting that what I was representing as "dynamic descriptions" was actually the dynamic parameters within "dynamic descriptions". I would like to explore the possibility of something that can allow us to style the dynamic descriptions at a higher level. |
@zepumph, from a front-end of point of view styling HTML content is a straight forward thing to do - tricky to get right sometimes, but the concept is simple. What was made really clear today is that we do not yet have an easy way to create the styling hooks. I'd like to explore again, your idea of placing a flag of some kind further up in the code. Something that might allow use to place classes in appropriate places in the PDOM copy. It might be easier to identify static content. I think you mentioned this in the meeting. I'd like to discuss that in more detail. |
hey folks - I don't the benefits of investigating this further are worth the time it will take, right now. Let's focus on team integration efforts (getting infrastructure and processes in place to support full team implementation of a11y) and further development of a11y features in sims. We can come back to this later, and decide specifically what the benefit of highlighting subsets of the text are, and then we can dig into how to best do it. |
I agree with @emily-phet that further work on the look of the A11y View can wait. While I think we can still improve the general visual Iook of this tool, the styling of dynamic string parameters is not the way forward. |
Sounds good! |
Removing meeting:a11y label since this was deferred. |
This has not been needed for a long time. Closing. We may continue to improve the a11y view over time in phetsims/chipper#1510. |
from #66:
We also want to strip these dynamic
i
tags from the string files, and then add them in the sim code, like when filling in withStringUtils
.The text was updated successfully, but these errors were encountered: