Skip to content

Commit 0f2e69a

Browse files
mdgeorge4153claude
andcommitted
Trust-signal pill: show the count even at 0 (when attestations are configured)
"✓ 0" on the latest version is a real signal — this package has no published audits — so show the pill at zero too, instead of hiding it. Gate on the attestation config being present (rather than count > 0) so the pill stays absent when the feature is dormant (no trusted attesters configured). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d16cb74 commit 0f2e69a

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

app/src/components/single-package/SinglePackageTrustSignals.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,27 @@ import { useGetMvrVersionAddresses } from "@/hooks/useGetMvrVersionAddresses";
1212
import { Text } from "../ui/Text";
1313
import LoadingState from "../LoadingState";
1414
import ExplorerLink from "../ui/explorer-link";
15-
import { type TrustedAttestor } from "@/lib/attestations";
15+
import { attestationConfig, type TrustedAttestor } from "@/lib/attestations";
1616
import { CheckIcon } from "@/icons/single-package/CheckIcon";
1717
import { WarningIcon } from "@/icons/single-package/WarningIcon";
1818

19-
/** Tab label: a pill with the count of live attestations. */
19+
/** Tab label: a pill with the count of live attestations on the latest version.
20+
* Shown whenever attestations are configured — "✓ 0" is itself a signal (this
21+
* package has no published audits), so it shows even at zero. */
2022
export function TrustSignalCount({
2123
address,
2224
network,
2325
}: {
2426
address: string;
2527
network: "mainnet" | "testnet";
2628
}) {
29+
const cfg = attestationConfig();
2730
const { data } = useGetAttestations(address, network);
2831
const positives = (data ?? []).length;
2932

30-
// Attestations are a mainnet-only feature in the demo.
31-
if (network === "testnet" || !positives) return null;
33+
// Mainnet-only, and only when attestations are configured (the feature is
34+
// dormant — no pill at all — when there are no trusted attesters).
35+
if (network === "testnet" || !cfg) return null;
3236
return (
3337
<div className="flex items-center gap-2xs">
3438
<CountPill

0 commit comments

Comments
 (0)