Skip to content

Commit b77618e

Browse files
committed
Show neutral icon if there is no change in the metric
1 parent 5ad0ba4 commit b77618e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/markdownRenderer.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -397,12 +397,17 @@ export function getPercentageChange(
397397
const percentChange = ((current - baseline) / baseline) * 100
398398
const absolutePercentChange = Math.abs(percentChange).toFixed(2)
399399

400+
let icon, direction
400401
// For metrics where lower is better (like response time), a decrease is positive
401402
// For metrics where higher is better (like throughput), an increase is positive
402403
const isPositive = higherIsBetter ? percentChange > 0 : percentChange < 0
403-
404-
const icon = isPositive ? '✅' : '❌'
405-
const direction = percentChange > 0 ? '↑' : '↓'
404+
if (current === baseline) {
405+
icon = '🔘'
406+
direction = ''
407+
} else {
408+
icon = isPositive ? '✅' : '❌'
409+
direction = percentChange > 0 ? '↑' : '↓'
410+
}
406411

407412
return ` (${icon} ${direction} ${absolutePercentChange}%)`
408413
}

0 commit comments

Comments
 (0)