Skip to content

Commit e25b2b1

Browse files
authored
Merge pull request #3815 from github/tausbn/compare-perf-positive-negative-delta-iconongraphy
compare-perf: Add positive/negative icons
2 parents d66b540 + ffb142f commit e25b2b1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

extensions/ql-vscode/src/view/compare-performance/ComparePerformance.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,28 @@ function renderAbsoluteValue(x: PredicateInfo, metric: Metric) {
9898
}
9999
}
100100

101+
const DeltaPositive = styled(Codicon)`
102+
color: var(--vscode-problemsErrorIcon-foreground);
103+
`;
104+
105+
const DeltaNegative = styled(Codicon)`
106+
color: var(--vscode-problemsInfoIcon-foreground);
107+
`;
108+
101109
function renderDelta(x: number, unit?: string) {
102110
const sign = x > 0 ? "+" : "";
111+
const symbol =
112+
x > 0 ? (
113+
<DeltaPositive name="triangle-up" />
114+
) : (
115+
<DeltaNegative name="triangle-down" />
116+
);
103117
return (
104118
<NumberCell>
105119
{sign}
106120
{formatDecimal(x)}
107121
{renderUnit(unit)}
122+
{symbol}
108123
</NumberCell>
109124
);
110125
}

0 commit comments

Comments
 (0)