Skip to content

Commit 5e5252d

Browse files
Michael Bunsenclaude
andcommitted
feat(ui): show raw verified count next to percentage
`StatBar` takes an optional `count` rendered as "0% (121)". Wired into the Verified occurrences bar so a small-but-nonzero verified set that rounds to 0% still surfaces the underlying count. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d0669ee commit 5e5252d

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

ui/src/pages/occurrences/occurrence-stats.tsx

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@ interface OccurrenceStatsProps {
66
filters: { field: string; value?: string; error?: string }[]
77
}
88

9-
const StatBar = ({ label, value }: { label: string; value: number }) => {
9+
const StatBar = ({
10+
label,
11+
value,
12+
count,
13+
}: {
14+
label: string
15+
value: number
16+
// Optional raw count shown alongside the percentage, e.g. "0% (23)". Useful
17+
// when the percentage rounds to 0 but the underlying count is non-zero.
18+
count?: number
19+
}) => {
1020
const pct = Math.round(Math.min(Math.max(value, 0), 1) * 100)
1121

1222
return (
@@ -21,7 +31,15 @@ const StatBar = ({ label, value }: { label: string; value: number }) => {
2131
style={{ width: `${pct}%` }}
2232
/>
2333
</div>
24-
<span className="body-base tabular-nums">{pct}%</span>
34+
<span className="body-base tabular-nums">
35+
{pct}%
36+
{count !== undefined ? (
37+
<span className="text-muted-foreground">
38+
{' '}
39+
({count.toLocaleString()})
40+
</span>
41+
) : null}
42+
</span>
2543
</div>
2644
</div>
2745
)
@@ -60,7 +78,11 @@ export const OccurrenceStats = ({
6078
</>
6179
) : (
6280
<>
63-
<StatBar label="Verified occurrences" value={data.verified_pct} />
81+
<StatBar
82+
label="Verified occurrences"
83+
value={data.verified_pct}
84+
count={data.verified_count}
85+
/>
6486
<StatBar
6587
label="Human-model agreement rate"
6688
value={data.agreed_any_rank_pct}

0 commit comments

Comments
 (0)