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

Implement #206: Add "Show More" for Table with Changes in Benchmark Set in Compare View #208

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ test.html
/tests/data/expected-results/stats-data-prep/tsom/inline-[0-9][0-9].svg
/tests/data/expected-results/stats-data-prep/tsom/inline-1[0-9][0-9].svg
/tests/data/expected-results/stats-data-prep/tsom/inline-exe-*.svg

# ignore developer-specific helper scripts
/*.sh

17 changes: 17 additions & 0 deletions resources/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -542,3 +542,20 @@ td.warmup-plot {
z-index: 100;
min-width: 250px;
}

/* Make "Changes in Benchmark Set" Table Expandable */
.table-expander td {
cursor: pointer;
user-select: none;
text-align: center;
}
.table-expander a:after {
content: ' ▼';
}
.table-expander.active a:after {
content: ' ▲';
}

table#benchmark-set-change tbody.hide-most-rows tr.benchmark-row:nth-child(n+4) {
display: none;
}
7 changes: 4 additions & 3 deletions src/backend/compare/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h2>Version Details</h2>

{% if (it.notInBoth) { %}
<h3>Changes in Benchmark Set</h3>
<table class="table table-sm">
<table class="table table-sm" id="benchmark-set-change">
<thead>
<tr>
<th scope="col">Commit</th>
Expand All @@ -117,9 +117,9 @@ <h3>Changes in Benchmark Set</h3>
<th scope="col">Extra Arguments</th>
</tr>
</thead>
<tbody>
<tbody class="hide-most-rows">
{% for (const m of it.stats.acrossVersions.missing) { %}
<tr>
<tr class="benchmark-row">
<td>{%= m.commitId.substring(0, 6) %}</td>
<td>{%= m.e %}</td>
<td>{%= m.s %}</td>
Expand All @@ -130,6 +130,7 @@ <h3>Changes in Benchmark Set</h3>
<td>{%= m.ea %}</td>
</tr>
{% } %}
<tr class="table-expander"><td colspan="8"><a href>show more</a></td></tr>
</tbody>
</table>
{% } %}
Expand Down
13 changes: 13 additions & 0 deletions src/frontend/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,19 @@ $(() => {
$('.btn-profile').on('click', insertProfiles);
$('.btn-timeline').on('click', insertTimeline);

$('.table-expander').on('click', function (event) {
event.preventDefault();

$('table#benchmark-set-change tbody').toggleClass('hide-most-rows');

$(this).toggleClass('active');

const isActivated = $(this).hasClass('active');
$(this)
.find('a')
.text(isActivated ? 'show less' : 'show more');
});

const headlinesForTablesWithWarmupPlots = $('table:has(button.btn-warmup)')
.prev()
.prev();
Expand Down