Skip to content

Commit 92c7887

Browse files
committed
Colorize the delta text instead of using icons
1 parent 27db76e commit 92c7887

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

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

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -98,28 +98,13 @@ 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-
109101
function renderDelta(x: number, unit?: string) {
110102
const sign = x > 0 ? "+" : "";
111-
const symbol =
112-
x > 0 ? (
113-
<DeltaPositive name="triangle-up" />
114-
) : (
115-
<DeltaNegative name="triangle-down" />
116-
);
117103
return (
118-
<NumberCell>
104+
<NumberCell className={x > 0 ? "bad-value" : x < 0 ? "good-value" : ""}>
119105
{sign}
120106
{formatDecimal(x)}
121107
{renderUnit(unit)}
122-
{symbol}
123108
</NumberCell>
124109
);
125110
}
@@ -154,6 +139,19 @@ const NameCell = styled.td``;
154139
const NumberCell = styled.td`
155140
text-align: right;
156141
width: 10em !important;
142+
143+
&.bad-value {
144+
color: var(--vscode-problemsErrorIcon-foreground);
145+
tr.expanded & {
146+
color: inherit;
147+
}
148+
}
149+
&.good-value {
150+
color: var(--vscode-problemsInfoIcon-foreground);
151+
tr.expanded & {
152+
color: inherit;
153+
}
154+
}
157155
`;
158156

159157
const AbsentNumberCell = styled.td`

0 commit comments

Comments
 (0)