phetsims / ohms-law

"Ohm's Law" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/ohms-law
GNU General Public License v3.0
5 stars 6 forks source link

Review recent layout changes #67

Closed zepumph closed 7 years ago

zepumph commented 7 years ago

I just did a fair amount of layout change, and would love some feedback. I want to make sure that it uses practices that good for PhET i18n and have good coding sense. @ariel-phet could you please assign to someone to look over the general layout (it's not too big of a sim), focusing around commits made in #62.

I want to be sure that I'm not using too many fixed values (empirically determined).

ariel-phet commented 7 years ago

@jessegreenberg do you have time for this review?

If not please assign back to me.

jessegreenberg commented 7 years ago

Sure, Ill take a look!

jessegreenberg commented 7 years ago

I can look at this on 7/19/17 or 7/20/17.

phet-steele commented 7 years ago

This is for phetsims/QA/issues/24, sorta.

jessegreenberg commented 7 years ago

Talked with @zepumph, it sounds like I should take a look at commits against #62, but there may be other commits so I should look at others in master

jessegreenberg commented 7 years ago

Gonna start here 91d3f2ef28a9f4a3f20c19b261211691b1e65d24 and move up!

jessegreenberg commented 7 years ago

Changes look great @zepumph, these are some big improvements. Changes for the layout are excellent. I have just a few picky comments about some code style and structure.

// constants
var VOLTAGE_RANGE = new Range();
var AA_VOLTAGE = new Range();

var OhmsLawConstants = {
  VOLTAGE_RANGE: VOLTAGE_RANGE,
  AA_VOLTAGE: AA_VOLTAGE,
  MAX_NUM_BATTERIES: Math.ceil( VOLTAGE_RANGE.max / AA_VOLTAGE )
  ...
};

Again, the benefit is that BatteryView doesn't need a batteryWidth argument, it can just pull from the constants file.

Nice work @zepumph, let me know if you have any questions about the above comments.

zepumph commented 7 years ago

Can you please clarify the comment on line 89 of SliderUnit?

I updated the comment to // Size the unit to be as big as possible next to the value with spacing.

Does this make sense?

All other changes fixed. Thanks for the review!

zepumph commented 7 years ago

Unassigning, @jessegreenberg let me know if you need anything else.

jessegreenberg commented 7 years ago

Thanks for the ping @zepumph, sorry I let this lag for a while. Changes look great. Thanks!