From b135edbc2b841c94dfa224bd66d14565df4bbe8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Tue, 19 Nov 2024 22:38:10 +0100 Subject: [PATCH] Move compare backends checkbox to the filter section The `Filters` component assumes that it manages the state of the filter. This invariant was broken before. This PR moves the checkbox into the `Filters` component, which restores the invariant. --- .../pages/compare/compile/compile-page.vue | 23 +++---------------- .../src/pages/compare/compile/filters.vue | 11 ++++++++- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/site/frontend/src/pages/compare/compile/compile-page.vue b/site/frontend/src/pages/compare/compile/compile-page.vue index 16219d054..c5059c3e0 100644 --- a/site/frontend/src/pages/compare/compile/compile-page.vue +++ b/site/frontend/src/pages/compare/compile/compile-page.vue @@ -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 @@ -261,20 +254,10 @@ const filteredSummary = computed(() => computeSummary(comparisons.value)); :selected-metric="selector.stat" :metrics="benchmarkInfo.compile_metrics" /> -
- Compare codegen backends for this commit: - -
diff --git a/site/frontend/src/pages/compare/compile/filters.vue b/site/frontend/src/pages/compare/compile/filters.vue index a59950661..b01e6f432 100644 --- a/site/frontend/src/pages/compare/compile/filters.vue +++ b/site/frontend/src/pages/compare/compile/filters.vue @@ -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; @@ -192,7 +193,7 @@ const opened = createPersistedRef(PREF_FILTERS_OPENED); LLVM - The default LLVM backend. + The default LLVM backend.