Skip to content

Commit 40d37e2

Browse files
authored
Make the click item more obvious as link (#7270)
change the color of navitem to indicate it's clickable <img width="938" height="374" alt="image" src="https://github.com/user-attachments/assets/e488de68-c3f5-4c62-be2d-a4e7cd4804fa" /> demo: https://torchci-git-makeoptionmoreclear-fbopensource.vercel.app/benchmark/compilers_regression
1 parent 2315118 commit 40d37e2

File tree

3 files changed

+41
-20
lines changed

3 files changed

+41
-20
lines changed

torchci/components/benchmark/v3/components/common/SelectionDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function SelectionDialog({
4646
const DialogContentComponent = resolveDialogContentRenderer(config);
4747
return (
4848
<Dialog open={open} onClose={onClose} fullWidth maxWidth="md">
49-
<DialogTitle>Selection Confirmed</DialogTitle>
49+
<DialogTitle>Choose a destination to navigate</DialogTitle>
5050
<DialogContent dividers>
5151
<DialogContentComponent
5252
left={left}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ListItem, ListItemButton, ListItemText } from "@mui/material";
2+
import { styled } from "@mui/material/styles";
3+
4+
export const ClickableListItemText = styled(ListItemText)(({ theme }) => ({
5+
cursor: "pointer",
6+
color: theme.palette.primary.main,
7+
}));
8+
9+
interface NavListItemProps {
10+
primary: string;
11+
secondary?: string;
12+
onClick: () => void;
13+
}
14+
15+
export function NavListItem({ primary, secondary, onClick }: NavListItemProps) {
16+
return (
17+
<ListItem>
18+
<ListItemButton onClick={onClick}>
19+
<ClickableListItemText primary={primary} secondary={secondary} />
20+
</ListItemButton>
21+
</ListItem>
22+
);
23+
}

torchci/components/benchmark/v3/configs/teams/compilers/CompilerPrecomputeConfirmDialogContent.tsx

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { List, ListItemButton, ListItemText } from "@mui/material";
1+
import { List } from "@mui/material";
22
import { Box } from "@mui/system";
33
import { DISPLAY_NAMES_TO_COMPILER_NAMES } from "components/benchmark/compilers/common";
44
import { highlightUntilClick } from "components/benchmark/v3/components/common/highlight";
@@ -7,6 +7,7 @@ import {
77
navigateToEchartInGroup,
88
} from "components/benchmark/v3/components/common/navigate";
99
import { TimeSeriesChartDialogContentProps } from "components/benchmark/v3/components/common/SelectionDialog";
10+
import { NavListItem } from "components/benchmark/v3/components/common/styledComponents";
1011
import { toToggleSectionId } from "components/benchmark/v3/components/common/ToggleSection";
1112
import { toBenchmarkTimeseriesChartSectionId } from "components/benchmark/v3/components/dataRender/components/benchmarkTimeSeries/BenchmarkChartSection";
1213
import { toBenchmarkTimeseriesChartGroupId } from "components/benchmark/v3/components/dataRender/components/benchmarkTimeSeries/components/BenchmarkTimeSeriesChartGroup";
@@ -72,27 +73,24 @@ export const CompilerPrecomputeConfirmDialogContent: React.FC<
7273
return (
7374
<List>
7475
{other?.parent === "timeSeriesChart" && (
75-
<ListItemButton onClick={onGoToTable}>
76-
<ListItemText
77-
primary="Navigate to comparison table"
78-
secondary="Jump to the time series comparison table section on this page."
79-
/>
80-
</ListItemButton>
76+
<NavListItem
77+
primary="Navigate to comparison table"
78+
secondary="Jump to the time series comparison table section on this page."
79+
onClick={onGoToTable}
80+
/>
8181
)}
8282
{other?.parent === "comparisonTable" && (
83-
<ListItemButton onClick={onGoToChart}>
84-
<ListItemText
85-
primary="Navigate to time series chart"
86-
secondary="Jump to the time series comparison table section on this page."
87-
/>
88-
</ListItemButton>
89-
)}
90-
<ListItemButton onClick={onGoToUrl}>
91-
<ListItemText
92-
primary="Navigate to detail view"
93-
secondary={`Open the detailed benchmark view for suite "${left?.suite}" and compiler "${left?.compiler}" in the compiler dashboard.`}
83+
<NavListItem
84+
primary="Navigate to time series chart"
85+
secondary="Jump to the comparison table section on this page."
86+
onClick={onGoToChart}
9487
/>
95-
</ListItemButton>
88+
)}
89+
<NavListItem
90+
primary="Navigate to detail view"
91+
secondary={`Open the detailed benchmark view for suite "${left?.suite}" and compiler "${left?.compiler}" in the compiler dashboard.`}
92+
onClick={onGoToUrl}
93+
/>
9694
</List>
9795
);
9896
};

0 commit comments

Comments
 (0)