Skip to content

Commit

Permalink
Merge pull request #2011 from Kobzol/compare-backend-filters
Browse files Browse the repository at this point in the history
Move compare backends checkbox to the filter section
  • Loading branch information
Kobzol authored Nov 19, 2024
2 parents 0695b84 + b135edb commit c3f49a3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
23 changes: 3 additions & 20 deletions site/frontend/src/pages/compare/compile/compile-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,6 @@ function updateFilter(newFilter: CompileBenchmarkFilter) {
refreshQuickLinks();
}
// We pass the event target here, because Parcel cannot handle the `as`
// cast directly in the template.
function updateSelfCompareBackend(target: EventTarget) {
const element = target as HTMLInputElement;
updateFilter({...filter.value, selfCompareBackend: element.checked});
}
/**
* When the filter changes, the URL is updated.
* After that happens, we want to re-render the quick links component, because
Expand Down Expand Up @@ -261,20 +254,10 @@ const filteredSummary = computed(() => computeSummary(comparisons.value));
:selected-metric="selector.stat"
:metrics="benchmarkInfo.compile_metrics"
/>
<div
v-if="canCompareBackends"
:title="`Compare codegen backends for commit '${props.data.a.commit}'`"
>
Compare codegen backends for this commit:
<input
type="checkbox"
:checked="selfCompareBackend"
@change="(e) => updateSelfCompareBackend(e.target)"
/>
</div>
<Filters
:defaultFilter="defaultCompileFilter"
:initialFilter="filter"
:default-filter="defaultCompileFilter"
:initial-filter="filter"
:can-compare-backends="canCompareBackends"
@change="updateFilter"
@export="exportData"
/>
Expand Down
11 changes: 10 additions & 1 deletion site/frontend/src/pages/compare/compile/filters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const props = defineProps<{
defaultFilter: CompileBenchmarkFilter;
// Initialize the filter with this value
initialFilter: CompileBenchmarkFilter;
canCompareBackends: boolean;
}>();
const emit = defineEmits<{
(e: "change", filter: CompileBenchmarkFilter): void;
Expand Down Expand Up @@ -192,7 +193,7 @@ const opened = createPersistedRef(PREF_FILTERS_OPENED);
<input type="checkbox" v-model="filter.backend.llvm" />
<span class="label">LLVM</span>
</label>
<Tooltip>The default LLVM backend. </Tooltip>
<Tooltip>The default LLVM backend.</Tooltip>
</li>
<li>
<label>
Expand Down Expand Up @@ -289,6 +290,14 @@ const opened = createPersistedRef(PREF_FILTERS_OPENED);
style="margin-left: 20px"
/>
</div>
<div
class="section"
v-if="canCompareBackends"
:title="`Compare codegen backends for this commit`"
>
Compare codegen backends for this commit:
<input type="checkbox" v-model="filter.selfCompareBackend" />
</div>
<button @click="reset" style="margin-right: 10px">
Reset filters
</button>
Expand Down

0 comments on commit c3f49a3

Please sign in to comment.