Skip to content

Commit 25c0f10

Browse files
ref(snapshots): two small UI tweaks
1 parent 3445a4a commit 25c0f10

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

static/app/views/preprod/snapshots/main/imageDisplay/diffImageDisplay.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ export function DiffImageDisplay({
8787
};
8888
}, [diffImageUrl]);
8989

90-
const diffPercent = pair.diff === null ? null : `${(pair.diff * 100).toFixed(1)}%`;
90+
// >= 1% shows 1 decimal (e.g. "93.5%"), < 1% shows up to 4 without trailing zeros (e.g. "0.0227%")
91+
const diffPct = pair.diff === null ? null : pair.diff * 100;
92+
const diffPercent =
93+
diffPct === null
94+
? null
95+
: `${diffPct >= 1 ? diffPct.toFixed(1) : parseFloat(diffPct.toFixed(4))}%`;
9196

9297
return (
9398
<Flex direction="column" gap="lg" padding="xl" flex="1" minHeight="0">

static/app/views/preprod/snapshots/snapshots.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default function SnapshotsPage() {
7676
const [showOverlay, setShowOverlay] = useState(true);
7777
const [overlayColor, setOverlayColor] = useState<string>(() => {
7878
const palette = theme.chart.getColorPalette(10);
79-
return palette.at(-1) ?? '#67C800';
79+
return palette.at(-5) ?? palette[0];
8080
});
8181
const [diffMode, setDiffMode] = useState<DiffMode>('split');
8282

0 commit comments

Comments
 (0)