Skip to content
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

Merged
merged 1 commit into from
Jul 12, 2023
Merged

Conversation

dlockhart
Copy link
Member

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 into app.js in part 2 of the refactoring. Because Rollup builds all this together, there's no impact on the report output files -- still just index.html and app.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.

@dlockhart dlockhart requested a review from a team as a code owner July 12, 2023 20:42
panelsContent = tabs.map(t => t.content);
} else {
panelsContent = tabs.map(t => renderTabPanel(t));
}
Copy link
Member Author

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) {
Copy link
Contributor

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?

Copy link
Contributor

@svanherk svanherk Jul 12, 2023

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 returns in there. Could maybe move this up into:

content: html`<div class="result">this._renderTestResult(result)</div>`,

Either way, minor, just an idea

Copy link
Member Author

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.

Copy link
Contributor

@svanherk svanherk left a 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

@dlockhart dlockhart force-pushed the dlockhart/refactor-report-part1 branch from 296322f to c12cca4 Compare July 12, 2023 22:24
@dlockhart dlockhart enabled auto-merge (squash) July 12, 2023 22:25
@dlockhart dlockhart merged commit 8dc56d7 into main Jul 12, 2023
1 check passed
@dlockhart dlockhart deleted the dlockhart/refactor-report-part1 branch July 12, 2023 22:26
@ghost
Copy link

ghost commented Jul 17, 2023

🎉 This PR is included in version 0.15.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ghost ghost added the released label Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants