phetsims / joist

Joist is the main framework for PhET Interactive Simulations. Joist creates and displays the simulation content, home screen, navigation bar, About dialog, enables switching between tabs, and other framework-related features.
http://scenerystack.org/
MIT License
9 stars 6 forks source link

`supportsInteractiveHighlights: true` should be the default for sims that support alt input #858

Closed pixelzoom closed 2 years ago

pixelzoom commented 2 years ago

From 9/15/2022 dev meeting notes, with notes by @jessegreenberg

KP: PSA - Interactive Highlights has a query parameter, and will be grouped into standard alternative input design requirement. Jesse - please explain the lift (pretty easy I think).

PhET wants this added to all sims that support alt input. We are already indicating that alt input is supported via supportsInteractiveDescription: true in package.json. So why do we need to take the additional step of adding supportsInteractiveHighlights: true to PreferencesModel? Shouldn't that be the default for sims that support alt input?

A correct default seems preferrable to having to revisit each sim and make a change.

kathy-phet commented 2 years ago

@jessegreenberg - Let me know what you think about CM's suggestion above. Thanks!

jessegreenberg commented 2 years ago

Yes, I think this makes sense! Making this the default has a little more up front cost in enabling this for the ~25 sims that currently support alt input but do not yet support Interactive Highlights. Most will be trivial, but a few might take 15-30 minutes.

@kathy-phet is that OK? Is this something you would like me to do or should I create issues for the responsible dev of each of these sims?

kathy-phet commented 2 years ago

Hey Jesse, Yes, this sounds great. There are 14 sims published that are listed as supporting alt input. So maybe 10 other sims. I don't think we would eagerly republish all 14 sims right now. But if you could get it working on master, that would be great, so its ready when we republish. Sounds like its pretty straightforward. @emily-phet - Do you see any issues with having interactive highlights be the default for sims that support alt input? Kathy

emily-phet commented 2 years ago

This sounds wonderful!

Having interactive highlights be forever forward coupled with alt input is indeed ideal! One clarification, it would be available but "off" by default, correct? I'm guessing that's the case but just wanted to clarify.

kathy-phet commented 2 years ago

Yes - off by default unless you use the query parameter to start with it on - but available to turn on through the preferences dialog.

The user testing that was done with low-vision non-screen reader users on GHE suggests that this would really help them. We are going to re-do the testing in GHE with the interactive highlights available and confirm. But it definitely seems like what they were wishing for in the user feedback reports.

jessegreenberg commented 2 years ago

I got about halfway through the list of sims locally this afternoon, should have this finished soon.

jessegreenberg commented 2 years ago

This was done in the above commits and sims in perennial/ now support Interactive Highlights. Only exception are the CCK sims because alt input isn't really supported for those.

@kathy-phet would you like QA or someone from design to spot check new highlights in these sims? Would you like a developer to review any changes?

kathy-phet commented 2 years ago

@pixelzoom - Can you please review the code changes here? @KatieWoe - When QA has a lull, this would be good to test. @jessegreenberg - Can you make a QA issue with what to test, and put it in the pipeline? Label it medium-priority. thx.

pixelzoom commented 2 years ago

I can't get to reviewing this for a least a week - I'm on vacation. This seems like should be high priority to review, since it affects many sims, and PhET is in the process of re-releasing many sims. So @kathy-phet @jessegreenberg please assign someone else to review the code.

pixelzoom commented 2 years ago

@kathy contacted me via Slack:

The only sims the interactive highlights infrastructure impact are ones with alt-input, which are my sims. You are in the best position to evaluate it, and it can wait until you are back.

So I'll do the review, sometime during the week of October 17.

pixelzoom commented 2 years ago

Requirements are not described in this issue. And (at first glance), there are a lot of commits above. So to make this review so more smoothly...

@jessegreenberg could you please summarize:

jessegreenberg commented 2 years ago

Certainly,

pixelzoom commented 2 years ago

This looks great, and is behaving as advertised. I tested Preferences and query parameter in pH Scale, but not other sims.

A few suggestions/questions ...

export default class OpticalObjectNode extends InteractiveHighlighting( Node ) {
...
    const options = optionize<OpticalObjectNodeOptions, SelfOptions, NodeOptions>()( {

      // NodeOptions
      tagName: 'div',
      focusable: true,

Should focusable: true (and a default tagName?) be handled by InteractiveHighlighting? If these options are not present, it seems like InteractiveHighlighting will not work, because you can't highlight something that is not focusable.

Back to @jessegreenberg.

jessegreenberg commented 2 years ago

Thank you for reviewing!

Rename interactiveHighlightsInitiallyEnabled to interactiveHighlightsEnabled

Currently it is matching the similar query parameters for extra sound and voicing extraSoundInitiallyEnabled, voicingInitiallyEnabled.

Where should documentation live? ... I'm wondering why it's an entirely separate document

PhET is going to enable both at the same time by default, but these features are really different in how they behave and how they are added. I do not think of them as the same feature set. I think if someone is looking for info on "Interactive Highlights" they would first look for a quick start guide just about that feature (and likewise for alt input). I think the "quickstart" guides are most useful when short so I currently have a preference to keep them separate.

To alternative-input-quickstart-guide.md I added

3. Adding `"supportsInteractiveDescription": true` will by default also enable Interactive Highlights.
   See https://github.com/phetsims/phet-info/blob/master/doc/interactive-highlights-quickstart-guide.md for more
   information about this feature.

Should InteractiveHighlighting be resonspible for setting focusable? The API is getting complicated. To properly add alt input to a custom Node, I need to remember to do a bunch of things that are not tied together in any way

Combining these points because I see them as related. I think Interactive Highlighting less related to alt input and more related to mouse/touch input. I could see making scenery more responsible for this feature by automatically adding highlights for Nodes with a input listeners. I think almost every commit in this issue using InteractiveHighlighting surrounds a Node with a PressListener? Ill make a new issue for this.

Use of mixins/traits. I'm a little concerned about how much a11y features (in general) use mixins/traits. Elsewhere, PhET's policy is to use mixins/traits sparingly. What is the advantage of using a trait in this case?

I think there are cases where it simplifies adding multiple sets of features to a component. It is sort of like multiple inheritance. There are also syntax advantages. For example, AmplitudeNumberDisplay.js -

class AmplitudeNumberDisplay extends InteractiveHighlighting( VBox ) {

The superclass is clear and you can easily see that AmplitudeNumberDisplay is in vertical layout. It also "inherits" the features of interactive highlighting. You could change the VBox superclass if you need without changing InteractiveHighlighting. To do this with single inheritance, you would have to change the superclass to InteractiveHighlightingNode, then add the VBox as a child with composition further down in the constructor. That is more disruptive and less clear IMO.

pixelzoom commented 2 years ago

👍🏻 closing.