From f40ded0e5c137038c33f087c51f206acf793acc5 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Thu, 2 Oct 2025 10:40:04 -0700 Subject: [PATCH 1/4] add config --- .../v3/components/benchmarkList/BenchmarkCategoryCard.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/torchci/components/benchmark/v3/components/benchmarkList/BenchmarkCategoryCard.tsx b/torchci/components/benchmark/v3/components/benchmarkList/BenchmarkCategoryCard.tsx index 8746dcc6c7..b62ccf2b0d 100644 --- a/torchci/components/benchmark/v3/components/benchmarkList/BenchmarkCategoryCard.tsx +++ b/torchci/components/benchmark/v3/components/benchmarkList/BenchmarkCategoryCard.tsx @@ -15,6 +15,7 @@ import { Typography, } from "@mui/material"; import { Box } from "@mui/system"; +import { wrap } from "module"; import Link from "next/link"; import ReactMarkdown from "react-markdown"; From 58c065151b11c8471ae137180264586953559d2f Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Fri, 3 Oct 2025 17:32:34 -0700 Subject: [PATCH 2/4] add config --- .../components/benchmarkList/BenchmarkCategoryCard.tsx | 1 - .../BenchmarkTimeSeriesChartGroup.tsx | 8 ++++---- .../BenchmarkTimeSeriesComparisonTableSlider.tsx | 2 +- .../benchmark/v3/pages/BenchmarkRegressionPage.tsx | 9 +++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/torchci/components/benchmark/v3/components/benchmarkList/BenchmarkCategoryCard.tsx b/torchci/components/benchmark/v3/components/benchmarkList/BenchmarkCategoryCard.tsx index b62ccf2b0d..8746dcc6c7 100644 --- a/torchci/components/benchmark/v3/components/benchmarkList/BenchmarkCategoryCard.tsx +++ b/torchci/components/benchmark/v3/components/benchmarkList/BenchmarkCategoryCard.tsx @@ -15,7 +15,6 @@ import { Typography, } from "@mui/material"; import { Box } from "@mui/system"; -import { wrap } from "module"; import Link from "next/link"; import ReactMarkdown from "react-markdown"; diff --git a/torchci/components/benchmark/v3/components/dataRender/components/benchmarkTimeSeries/components/BenchmarkTimeSeriesChart/BenchmarkTimeSeriesChartGroup.tsx b/torchci/components/benchmark/v3/components/dataRender/components/benchmarkTimeSeries/components/BenchmarkTimeSeriesChart/BenchmarkTimeSeriesChartGroup.tsx index 08b908fa00..d1f6b7609d 100644 --- a/torchci/components/benchmark/v3/components/dataRender/components/benchmarkTimeSeries/components/BenchmarkTimeSeriesChart/BenchmarkTimeSeriesChartGroup.tsx +++ b/torchci/components/benchmark/v3/components/dataRender/components/benchmarkTimeSeries/components/BenchmarkTimeSeriesChart/BenchmarkTimeSeriesChartGroup.tsx @@ -89,13 +89,13 @@ export default function BenchmarkTimeSeriesChartGroup({ chartGroup?.chart ); - console.log(g.labels.join("-"), chartGroup?.sectionSelectMode); - const enableSelectMode = - chartGroup?.sectionSelectMode?.[g.labels.join("-")] ?? true; + const maxTimeSeries = groupSeries + .map((s) => s.data.length) + .reduce((a, b) => Math.max(a, b)); return ( 40 ? 12 : 6 }} id={toBenchmarkTimeseriesChartGroupId(g.key)} > diff --git a/torchci/components/benchmark/v3/components/dataRender/components/benchmarkTimeSeries/components/BenchmarkTimeSeriesComparisonSection/BenchmarkTimeSeriesComparisonTableSlider.tsx b/torchci/components/benchmark/v3/components/dataRender/components/benchmarkTimeSeries/components/BenchmarkTimeSeriesComparisonSection/BenchmarkTimeSeriesComparisonTableSlider.tsx index cbbc37bee8..89007713e1 100644 --- a/torchci/components/benchmark/v3/components/dataRender/components/benchmarkTimeSeries/components/BenchmarkTimeSeriesComparisonSection/BenchmarkTimeSeriesComparisonTableSlider.tsx +++ b/torchci/components/benchmark/v3/components/dataRender/components/benchmarkTimeSeries/components/BenchmarkTimeSeriesComparisonSection/BenchmarkTimeSeriesComparisonTableSlider.tsx @@ -116,7 +116,7 @@ export function BenchmarkTimeSeriesComparisonTableSlider({ [ids, onChange] ); - const minWidth = Math.max(200, 50 * ids.length); + const minWidth = Math.min(200, 50 * ids.length); return ( diff --git a/torchci/components/benchmark/v3/pages/BenchmarkRegressionPage.tsx b/torchci/components/benchmark/v3/pages/BenchmarkRegressionPage.tsx index 3553be9385..d963223a5f 100644 --- a/torchci/components/benchmark/v3/pages/BenchmarkRegressionPage.tsx +++ b/torchci/components/benchmark/v3/pages/BenchmarkRegressionPage.tsx @@ -1,3 +1,4 @@ +import { Box } from "@mui/system"; import dayjs from "dayjs"; import utc from "dayjs/plugin/utc"; import { BenchmarkDashboardStoreProvider } from "lib/benchmark/store/benchmark_dashboard_provider"; @@ -19,12 +20,12 @@ export default function BenchmarkRegressionPage({ return ( -
+ -
+ -
-
+ +
); } From 7f4ce5e37279764c9af2ec55327f87bc00382be5 Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Mon, 6 Oct 2025 07:52:43 -0700 Subject: [PATCH 3/4] add config --- torchci/components/benchmark/v3/components/common/navigate.tsx | 2 +- .../teams/compilers/CompilerPrecomputeConfirmDialogContent.tsx | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/torchci/components/benchmark/v3/components/common/navigate.tsx b/torchci/components/benchmark/v3/components/common/navigate.tsx index 0069ae9361..a25d33beb7 100644 --- a/torchci/components/benchmark/v3/components/common/navigate.tsx +++ b/torchci/components/benchmark/v3/components/common/navigate.tsx @@ -22,7 +22,7 @@ export async function navigateToDataGrid( await delay(350); // wait for toggle animation } const target = scrollToDataGridView(sectionId, keywords, field); - await delay(300); // wait for scroll animation + await delay(800); // wait for scroll animation return target; } diff --git a/torchci/components/benchmark/v3/configs/teams/compilers/CompilerPrecomputeConfirmDialogContent.tsx b/torchci/components/benchmark/v3/configs/teams/compilers/CompilerPrecomputeConfirmDialogContent.tsx index 76ce3cf13c..38a437e16b 100644 --- a/torchci/components/benchmark/v3/configs/teams/compilers/CompilerPrecomputeConfirmDialogContent.tsx +++ b/torchci/components/benchmark/v3/configs/teams/compilers/CompilerPrecomputeConfirmDialogContent.tsx @@ -50,6 +50,8 @@ export const CompilerPrecomputeConfirmDialogContent: React.FC< const tableId = toBenchamrkTimeSeriesComparisonTableId( `metric=${left.metric}` ); + + const table = getElementById(tableId); // if the table is not exist,scroll to the toggle section if (!table) { @@ -57,6 +59,7 @@ export const CompilerPrecomputeConfirmDialogContent: React.FC< triggerUpdate(); return; } + const cell = await navigateToDataGrid( tableId, [`${left?.compiler}`], From 84663d7cb8b59140c8d83a2f750dd83f94fd6aec Mon Sep 17 00:00:00 2001 From: Yang Wang Date: Mon, 6 Oct 2025 08:09:01 -0700 Subject: [PATCH 4/4] add config --- .../v3/components/common/navigate.tsx | 43 ++++++++++++++----- ...CompilerPrecomputeConfirmDialogContent.tsx | 1 - 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/torchci/components/benchmark/v3/components/common/navigate.tsx b/torchci/components/benchmark/v3/components/common/navigate.tsx index a25d33beb7..0d1855d0f2 100644 --- a/torchci/components/benchmark/v3/components/common/navigate.tsx +++ b/torchci/components/benchmark/v3/components/common/navigate.tsx @@ -21,12 +21,11 @@ export async function navigateToDataGrid( openToggleSectionById(toggleId); await delay(350); // wait for toggle animation } - const target = scrollToDataGridView(sectionId, keywords, field); - await delay(800); // wait for scroll animation + const target = await scrollToDataGridView(sectionId, keywords, field); return target; } -function scrollToDataGridView( +async function scrollToDataGridView( sectionId: string, keywords: string[], field?: string @@ -58,7 +57,7 @@ function scrollToDataGridView( ); if (cell) { target = cell; - scrollingToElement(cell); + await scrollingToElement(cell); } } return target; @@ -85,7 +84,7 @@ export async function navigateToEchartInGroup( return null; } // scroll into view - scrollingToElement(target); + await scrollingToElement(target); return target; } @@ -94,11 +93,35 @@ export function getElementById(id: string): HTMLElement | null { return document.getElementById(id); } -export async function scrollingToElement( - target: HTMLElement | null, - delay_ts: number = 200 -) { +export async function scrollingToElement(target: HTMLElement | null) { if (!target) return null; target.scrollIntoView({ behavior: "smooth", block: "center" }); - await delay(delay_ts); + await waitUntilElementVisible(target); +} + +// Wait until element is visible in the viewport (with timeout) +export async function waitUntilElementVisible( + el: HTMLElement | null, + timeout = 1500 +): Promise { + if (!el) { + return; + } + const start = performance.now(); + return new Promise((resolve) => { + const check = () => { + const rect = el.getBoundingClientRect(); + const inView = + rect.top >= 0 && + rect.bottom <= + (window.innerHeight || document.documentElement.clientHeight); + + if (inView || performance.now() - start > timeout) { + resolve(); + } else { + requestAnimationFrame(check); + } + }; + requestAnimationFrame(check); + }); } diff --git a/torchci/components/benchmark/v3/configs/teams/compilers/CompilerPrecomputeConfirmDialogContent.tsx b/torchci/components/benchmark/v3/configs/teams/compilers/CompilerPrecomputeConfirmDialogContent.tsx index 38a437e16b..ee45926ba5 100644 --- a/torchci/components/benchmark/v3/configs/teams/compilers/CompilerPrecomputeConfirmDialogContent.tsx +++ b/torchci/components/benchmark/v3/configs/teams/compilers/CompilerPrecomputeConfirmDialogContent.tsx @@ -51,7 +51,6 @@ export const CompilerPrecomputeConfirmDialogContent: React.FC< `metric=${left.metric}` ); - const table = getElementById(tableId); // if the table is not exist,scroll to the toggle section if (!table) {