Skip to content

Commit

Permalink
Fix bad title string/width, update TODOs, see phetsims/sun#738
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisklus committed Mar 22, 2022
1 parent 585f713 commit fddcf83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions js/common/view/NumberPlayAccordionBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import numberPlay from '../../numberPlay.js';
import NumberPlayConstants from '../NumberPlayConstants.js';
import optionize from '../../../../phet-core/js/optionize.js';

// TODO-TS: These should be required
type SelfOptions = {
titleString: string,
titleMaxWidth: number
Expand Down Expand Up @@ -41,7 +40,6 @@ class NumberPlayAccordionBox extends AccordionBox {
contentNode.localBounds = innerContentBounds;

super( contentNode, optionize<NumberPlayAccordionBoxOptions, SelfOptions, AccordionBoxOptions>( {
// @ts-ignore TODO-TS: titleString should be required
titleNode: new Text( options.titleString, {
font: NumberPlayConstants.ACCORDION_BOX_TITLE_FONT,
maxWidth: options.titleMaxWidth
Expand Down
8 changes: 4 additions & 4 deletions js/common/view/NumberPlayScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import SpeechSynthesisAnnouncer from '../../../../utterance-queue/js/SpeechSynth

// types
type NumberPlayScreenViewOptions = {
wordAccordionBoxOptions: Partial<WordAccordionBoxOptions>, // TODO-TS: MK: Is this alright as a partial?
wordAccordionBoxOptions: Partial<WordAccordionBoxOptions>, // TODO-TS: These should not be partial
totalAccordionBoxOptions: Partial<TotalAccordionBoxOptions>,
tenFrameAccordionBoxOptions: Partial<TenFrameAccordionBoxOptions>,
upperAccordionBoxHeight: number,
Expand Down Expand Up @@ -108,7 +108,7 @@ class NumberPlayScreenView extends ScreenView {
expandedProperty: this.onesAccordionBoxExpandedProperty,
titleString: numberPlayStrings.ones,
fill: NumberPlayColors.pinkBackgroundColorProperty,
titleMaxWidth: 1000 // TODO-TS: MK: this should be a real number
titleMaxWidth: NumberPlayConstants.LOWER_ACCORDION_BOX_TITLE_MAX_WIDTH // TODO-TS: this should use the default in CountingAccordionBox
} );
onesAccordionBox.left = this.layoutBounds.minX + NumberPlayConstants.ACCORDION_BOX_MARGIN_X;
onesAccordionBox.bottom = this.layoutBounds.maxY - NumberPlayConstants.SCREEN_VIEW_PADDING_Y;
Expand All @@ -126,8 +126,8 @@ class NumberPlayScreenView extends ScreenView {
linkedPlayArea: model.onesPlayArea,
expandedProperty: this.objectsAccordionBoxExpandedProperty,
fill: NumberPlayColors.blueBackgroundColorProperty,
titleString: 'TEST FOR NOW', // TODO-TS: MK: this should be a real string
titleMaxWidth: 1000 // TODO-TS: MK: this should be a real number
titleString: numberPlayStrings.objects, // TODO-TS: this should use the default in CountingAccordionBox
titleMaxWidth: NumberPlayConstants.LOWER_ACCORDION_BOX_TITLE_MAX_WIDTH // TODO-TS: this should use the default in CountingAccordionBox
} );
this.objectsAccordionBox.right = this.layoutBounds.maxX - NumberPlayConstants.ACCORDION_BOX_MARGIN_X;
this.objectsAccordionBox.bottom = onesAccordionBox.bottom;
Expand Down

0 comments on commit fddcf83

Please sign in to comment.