phetsims / molarity

"Molarity" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/molarity
GNU General Public License v3.0
2 stars 6 forks source link

Code review: a11y work #165

Closed twant closed 4 years ago

twant commented 5 years ago

NOTE! Prior to doing a code review, copy this checklist to a GitHub issue for the repository being reviewed. Delete the Table of Contents section, since the links will be incorrect.

PhET Code-Review Checklist (a.k.a "CRC")

GitHub Issues

The following standard GitHub issues should exist. If any of these issues is missing, or have not been completed, pause code review until the issues have been created and addressed by the responsible dev.

GitHub issues should exist that document:

Build and Run Checks

If any of these items fail, pause code review.

Memory Leaks

Performance

Usability

Internationalization

Repository Structure

Coding Conventions

This section deals with PhET coding conventions. You do not need to exhaustively check every item in this section, nor do you necessarily need to check these items one at a time. The goal is to determine whether the code generally meets PhET standards.

For example, both of these are acceptable:

Property.multilink(
  [ styleProperty, activeProperty, colorProperty ],
  ( style, active, color ) => {
    // some algorithm that uses style and active 
} );

Property.multilink(
  [ styleProperty, activeProperty, colorProperty ],
  ( style, active ) => {
    // some algorithm that uses style and active 
} );

This is not acceptable, because the 3rd parameter is incorrect.

Property.multilink(
  [ styleProperty, activeProperty, colorProperty ],
  ( style, active, lineWidth ) => {
    // some algorithm that uses style and active 
} );

Documentation

This section deals with PhET documention conventions. You do not need to exhaustively check every item in this section, nor do you necessarily need to check these items one at a time. The goal is to determine whether the code generally meets PhET standards.

Type Expressions

This section deals with PhET conventions for type expressions. You do not need to exhaustively check every item in this section, nor do you necessarily need to check these items one at a time. The goal is to determine whether the code generally meets PhET standards.

Visibility Annotations

This section deals with PhET conventions for visibility annotations. You do not need to exhaustively check every item in this section, nor do you necessarily need to check these items one at a time. The goal is to determine whether the code generally meets PhET standards.

Because JavaScript lacks visibility modifiers (public, protected, private), PhET uses JSdoc visibility annotations to document the intent of the programmer, and define the public API. Visibility annotations are required for anything that JavaScript makes public. Information about these annotations can be found here. (Note that other documentation systems like the Google Closure Compiler use slightly different syntax in some cases. Where there are differences, JSDoc is authoritative. For example, use Array.<Object> or Object[] instead of Array<Object>). PhET guidelines for visibility annotations are as follows:

Math Libraries

IE11

Organization, Readability, and Maintainability

Accessibility

This section may be omitted if the sim has not been instrumented for a11y.

PhET-iO

This section may be omitted if the sim has not been instrumented for PhET-iO.

twant commented 5 years ago

@zepumph thanks in advance for taking the time to review! I think the complete list of changed files is below:

New files:

Modified files:

zepumph commented 5 years ago

I have gotten to all the files except molarityAlertManager.

zepumph commented 4 years ago

All files have been reviewed for content. I will now go over some of the more general stuff.

zepumph commented 4 years ago

Does resetting the simulation also reset the entire PDOM?

To test this I did the following:

I found that the only changes were Node ids, all the content was identical, so I checked this off.

zepumph commented 4 years ago

Is there any unnecessary coupling? (e.g., by passing large objects to constructors, or exposing unnecessary properties/functions)

I found that VolumeDescriber didn't need to pass in the whole solution, just the volumeDescriber. The same for SoluteAmountDescriber and soluteAmountProperty.

zepumph commented 4 years ago

I couldn't find any other unnecessary (de)coupling.

zepumph commented 4 years ago

Code review is complete. There is still a todo or two in the code. Let's keep this open until those are resolved. I don't think we need to handle the one in SoluteIO though.

zepumph commented 4 years ago

Nevermind, let's take that up in https://github.com/phetsims/molarity/issues/192. Closing