Skip to content

Commit

Permalink
Improved UI for #88
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanolson committed Apr 16, 2020
1 parent be7ad92 commit e092392
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions js/report/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ Property.multilink( [ reportProperty, expandedReposProperty ], ( report, expande
}
} );

const testLabels = tests.map( test => {
let testLabels = tests.map( test => {
const label = new Text( test.names.join( ' : ' ), { font: new PhetFont( { size: 12 } ) } );
label.addInputListener( new FireListener( {
fire: () => {
Expand Down Expand Up @@ -190,6 +190,15 @@ Property.multilink( [ reportProperty, expandedReposProperty ], ( report, expande
const maxSnapshotLabelWidth = _.max( snapshotLabels.map( node => node.width ) );
const maxSnapshotLabelHeight = _.max( snapshotLabels.map( node => node.height ) );

testLabels = testLabels.map( label => {
label.left = 0;
label.top = 0;
return new Rectangle( 0, 0, maxTestLabelWidth, maxTestLabelHeight, {
fill: '#fafafa',
children: [ label ]
} );
} );

const snapshotsTestNodes = _.flatten( report.snapshots.map( ( snapshot, i ) => {
return tests.map( ( test, j ) => {
const x = maxTestLabelWidth + padding + i * ( maxSnapshotLabelWidth + padding );
Expand Down Expand Up @@ -261,7 +270,9 @@ Property.multilink( [ reportProperty, expandedReposProperty ], ( report, expande
font: new PhetFont( { size: 12 } ),
align: 'left'
} );
const panel = new Panel( messagesNode );
const panel = new Panel( messagesNode, {
backgroundPickable: true
} );
rootNode.addChild( panel );
panel.left = background.right;
panel.top = background.top;
Expand Down

0 comments on commit e092392

Please sign in to comment.