-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor tabs and radio stuff out #69
Conversation
panelsContent = tabs.map(t => t.content); | ||
} else { | ||
panelsContent = tabs.map(t => renderTabPanel(t)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slight bug fix here -- if there's only 1 browser showing we don't render the tabs at all, so this also skips rendering the surrounding panel.
@@ -464,8 +330,7 @@ class Test extends LitElement { | |||
} | |||
|
|||
} | |||
_renderTestResults(browser, testData) { | |||
const result = testData.results.find(r => r.name === browser); | |||
_renderTestResults(result) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this is maybe overkill now, and the div
could just be added to _renderTestResult
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there's a lot of early return
s in there. Could maybe move this up into:
content: html`<div class="result">this._renderTestResult(result)</div>`,
Either way, minor, just an idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I had started leaving space for when this is actually going to be rendering multiple test results -- i.e. once you can click on an entire file and see all its tests. Definitely overkill right now though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this pattern of still logically separating out pieces, but without the overhead that comes with components and data passing if we don't need it
296322f
to
c12cca4
Compare
🎉 This PR is included in version 0.15.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No visual or functional changes here.
This moves all the tabs and pillbox related rendering and CSS out into separate helper files. This will help reduce the size of
test.js
in preparation for merging it back intoapp.js
in part 2 of the refactoring. Because Rollup builds all this together, there's no impact on the report output files -- still justindex.html
andapp.js
.Background: I originally split these into separate components but in since they don't really need to be reused they're creating overhead to pass stuff down and communicate up.