phetsims / sun

User-interface components for PhET simulations, built on top of Scenery.
http://scenerystack.org/
MIT License
5 stars 12 forks source link

Dialog: support for `accessibleName` and `helpText` #905

Closed pixelzoom closed 2 weeks ago

pixelzoom commented 1 month ago

Related to https://github.com/phetsims/models-of-the-hydrogen-atom/issues/67 and https://github.com/phetsims/scenery-phet/issues/876 ...

MOTHA has 2 modal dialogs: spectrometer snapshots, and Quantum Numbers info. The formers has no title, the latter has a title. When trying to add accessible names and help text, the MOTHA team was unsure about how to proceed.

There is no Dialog.md file to provide guidance, and we could not find exemplars.

Dialog does seem to support the accessibleName and helpText options, but we were unsure if it is doing the right thing, or if it the current behavior was actually designed. Modal dialogs do not get focus.

We were also unsure about how much of the Dialog content should be part of helpText. We decided that the text in the Quantum Numbers dialog (shown below) was outside the scope of helpText. But it's unclear if other sim developers made a similar decision.

screenshot_3535
pixelzoom commented 3 weeks ago

@jessegreenberg and I discussed this issue. It's not blocking for MOTHA because I was able to implement what was specified for QuantumNumbersInfoDialog.

marlitas commented 3 weeks ago

Meeting 11/1/24:

jessegreenberg commented 2 weeks ago

OK, dialog has better support for accessibleName and helpText. It creates its own Node for the heading level so that clients don't have to set that on the title Node.

In addition, its using findStringProperty to get a default accessible name from the title if there is one and no accessibleName has been provided.

@pixelzoom would you mind reviewing this change?

pixelzoom commented 2 weeks ago

I reviewed the commits. They look reasonble to me, a nice improvement.

Back to @jessegreenberg in case there's more to do here.

jessegreenberg commented 2 weeks ago

Thanks for reviewing. Thats all for this issue, closing.