fix: allow repeated platform checks and unify Alpha metric formatting
Deploy production / deploy (push) Successful in 54s

This commit is contained in:
yuxuanhui
2026-09-12 22:42:37 +08:00
parent c18960946b
commit f3eb239e1a
8 changed files with 196 additions and 17 deletions
+4 -1
View File
@@ -27,6 +27,7 @@ import {
IconRefresh,
} from "@douyinfe/semi-icons";
import "./AlphaPage.css";
import { formatAlphaMetric } from "../alphaMetrics";
import type { ColumnProps } from "@douyinfe/semi-ui-19/lib/es/table/interface";
import {
api,
@@ -84,8 +85,10 @@ function metricColor(key: string, value: unknown): string | undefined {
return "var(--semi-color-danger)";
}
/** Convert Margin only for display; filtering and sorting still use raw values. */
/** Format metrics only for display; filtering and sorting still use raw values. */
function formatMetric(key: string, value: unknown): string {
const headline = formatAlphaMetric(key, value);
if (headline !== undefined) return headline;
if (key !== "margin") return formatNumber(value, 3);
return typeof value === "number" && Number.isFinite(value)
? `${formatNumber(value * 10000, 2)}bps`