performance updates checkpoint

This commit is contained in:
Francis Cao committed 2026-03-05 10:12:30 -08:00
1 parent 8563fe1d30
commit f6a6d2cc31
25 files changed
+488 -343

No files matched your search

+6 -1
View File
@@ -68,7 +68,12 @@ export function ListTable({
return (
<Column gap>
<Grid alignItems="center" justifyContent="space-between" paddingLeft="2" columns="1fr 100px">
<Grid
alignItems="center"
justifyContent="space-between"
paddingLeft="2"
columns={`1fr ${showPercentage ? '100px' : '150px'}`}
>
<Text weight="bold">{title}</Text>
<Text weight="bold" align="center">
{metric}
@@ -1,9 +1,15 @@
.card {
transition: box-shadow 0.2s;
transition: box-shadow 0.2s ease;
}
.card:hover {
box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 15%, transparent);
}
.card.selected {
box-shadow: 0 0 0 2px var(--base-color-primary);
box-shadow:
0 0 0 1px color-mix(in srgb, var(--primary) 40%, transparent),
0 0 6px color-mix(in srgb, var(--primary) 15%, transparent);
}
.good .rating {
+1 -4
View File
@@ -1,6 +1,4 @@
import { useSpring } from '@react-spring/web';
import { Column, Text } from '@umami/react-zen';
import { AnimatedDiv } from '@/components/common/AnimatedDiv';
import { useMessages } from '@/components/hooks';
import { WEB_VITALS_THRESHOLDS } from '@/lib/constants';
import { formatNumber } from '@/lib/format';
@@ -33,7 +31,6 @@ export const PerformanceCard = ({
}: PerformanceCardProps) => {
const { t, labels } = useMessages();
const rating = getRating(metric, value);
const props = useSpring({ x: Number(value) || 0, from: { x: 0 } });
return (
<Column
@@ -52,7 +49,7 @@ export const PerformanceCard = ({
{label}
</Text>
<Text size="4xl" weight="bold" wrap="nowrap">
<AnimatedDiv title={value?.toString()}>{props?.x?.to(x => formatValue(x))}</AnimatedDiv>
{formatValue(value)}
</Text>
<Text size="sm" className={styles.rating}>
{t(labels[rating === 'needs-improvement' ? 'needsImprovement' : rating])}