From 0a23310a3407b8815c4a5a20edc1180d91d48458 Mon Sep 17 00:00:00 2001 From: Hermes Bounty Bot Date: Thu, 4 Jun 2026 22:03:31 +0000 Subject: [PATCH 1/3] fix: #401 use (~SOL) notation to prevent USD/coin amount confusion --- src/components/gigs/GigCard.test.tsx | 13 +++++++++++++ src/components/gigs/GigCard.tsx | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/gigs/GigCard.test.tsx b/src/components/gigs/GigCard.test.tsx index 5fc36540..c8c25e18 100644 --- a/src/components/gigs/GigCard.test.tsx +++ b/src/components/gigs/GigCard.test.tsx @@ -252,4 +252,17 @@ describe("GigCard", () => { render(); expect(screen.getByText(/\/article/)).toBeInTheDocument(); }); + + it("displays ~coin notation when payment_coin is set so USD value is not mistaken for coin amount", () => { + const gig = { + ...baseGig, + budget_min: 1, + budget_max: 1, + payment_coin: "SOL", + poster: mockPoster, + }; + render(); + // Should show "$1.00 USD (~SOL)" not "$1.00 USD (paid in SOL)" + expect(screen.getByText(/\$1\.00 USD \(~SOL\)/)).toBeInTheDocument(); + }); }); diff --git a/src/components/gigs/GigCard.tsx b/src/components/gigs/GigCard.tsx index f1d179a8..5bf834b1 100644 --- a/src/components/gigs/GigCard.tsx +++ b/src/components/gigs/GigCard.tsx @@ -60,7 +60,9 @@ export function GigCard({ const coin = gig.payment_coin; const isSats = coin && (coin === "SATS" || coin === "LN" || coin === "BTC"); const currencyLabel = coin ? (isSats ? "sats" : coin) : "USD"; - const coinNote = coin ? ` (paid in ${coin})` : ""; + // Use ~ prefix when paying in crypto so readers don't mistake USD value for coin amount + // e.g. "$1.00 USD (~SOL)" not "$1.00 USD (paid in SOL)" — ~ makes it clear it's an equivalent + const coinNote = coin ? ` (~${coin})` : ""; const fmt = (val: number) => { if (isSats) return `${val.toLocaleString("en-US")} sats`; From 37d1468cd813798585393fd507d6fff4b81662ed Mon Sep 17 00:00:00 2001 From: Hermes Bounty Bot Date: Thu, 4 Jun 2026 22:05:44 +0000 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20apply=20DeepSeek=20review=20suggesti?= =?UTF-8?q?ons=20=E2=80=94=20space=20before=20coin=20note,=20remove=20~=20?= =?UTF-8?q?prefix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/gigs/GigCard.test.tsx | 4 ++-- src/components/gigs/GigCard.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/gigs/GigCard.test.tsx b/src/components/gigs/GigCard.test.tsx index c8c25e18..118a9337 100644 --- a/src/components/gigs/GigCard.test.tsx +++ b/src/components/gigs/GigCard.test.tsx @@ -262,7 +262,7 @@ describe("GigCard", () => { poster: mockPoster, }; render(); - // Should show "$1.00 USD (~SOL)" not "$1.00 USD (paid in SOL)" - expect(screen.getByText(/\$1\.00 USD \(~SOL\)/)).toBeInTheDocument(); + // Should show "$1.00 USD (SOL)" not "$1.00 USD (paid in SOL)" — (SOL) not (~SOL) + expect(screen.getByText(/\$1\.00 USD \(SOL\)/)).toBeInTheDocument(); }); }); diff --git a/src/components/gigs/GigCard.tsx b/src/components/gigs/GigCard.tsx index 5bf834b1..6555bf35 100644 --- a/src/components/gigs/GigCard.tsx +++ b/src/components/gigs/GigCard.tsx @@ -62,7 +62,7 @@ export function GigCard({ const currencyLabel = coin ? (isSats ? "sats" : coin) : "USD"; // Use ~ prefix when paying in crypto so readers don't mistake USD value for coin amount // e.g. "$1.00 USD (~SOL)" not "$1.00 USD (paid in SOL)" — ~ makes it clear it's an equivalent - const coinNote = coin ? ` (~${coin})` : ""; + const coinNote = coin ? ` (${coin})` : ""; const fmt = (val: number) => { if (isSats) return `${val.toLocaleString("en-US")} sats`; @@ -77,7 +77,7 @@ export function GigCard({ } if (min && max && min !== max) return `${fmt(min)} - ${fmt(max)}${suffix}${!isSats ? coinNote : ""}`; - if (min && max) return `${fmt(min)}${suffix}${!isSats ? coinNote : ""}`; + if (min && max) return `${fmt(min)}${suffix}${!isSats ? " " + coinNote : ""}`; if (min) return `${fmt(min)}+${suffix}${!isSats ? coinNote : ""}`; if (max) return `up to ${fmt(max)}${suffix}${!isSats ? coinNote : ""}`; return (gig.budget_type === "fixed" || gig.budget_type === "bounty") ? "Budget TBD" : "Rate TBD"; From 2bb848ca50f6d070d27e5059bcee2ad3631a5987 Mon Sep 17 00:00:00 2001 From: Hermes Bounty Bot Date: Fri, 5 Jun 2026 10:15:19 +0000 Subject: [PATCH 3/3] fix: #401 improve bounty payout display clarity Change formatBountyPayout to show "(COIN)" instead of "(paid in COIN)" so readers don't misread "$1.00 USD (SOL)" as "1 SOL". Before: "$1.00 USD (paid in SOL)" After: "$1.00 USD (SOL)" --- src/lib/bounties.test.ts | 18 ++++++++++++++++++ src/lib/bounties.ts | 6 ++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 src/lib/bounties.test.ts diff --git a/src/lib/bounties.test.ts b/src/lib/bounties.test.ts new file mode 100644 index 00000000..cf862db1 --- /dev/null +++ b/src/lib/bounties.test.ts @@ -0,0 +1,18 @@ +import { describe, it, expect } from "vitest"; +import { formatBountyPayout } from "./bounties"; + +describe("formatBountyPayout", () => { + it("shows USD only when no coin", () => { + expect(formatBountyPayout(1, null)).toBe("$1.00 USD"); + expect(formatBountyPayout(100, undefined)).toBe("$100.00 USD"); + }); + + it("shows (COIN) format to avoid misreading USD value as coin amount", () => { + expect(formatBountyPayout(1, "SOL")).toBe("$1.00 USD (SOL)"); + expect(formatBountyPayout(50, "ETH")).toBe("$50.00 USD (ETH)"); + }); + + it("handles string amount input", () => { + expect(formatBountyPayout("2.50", "BTC")).toBe("$2.50 USD (BTC)"); + }); +}); \ No newline at end of file diff --git a/src/lib/bounties.ts b/src/lib/bounties.ts index 1a2cd966..2e4a084e 100644 --- a/src/lib/bounties.ts +++ b/src/lib/bounties.ts @@ -3,7 +3,9 @@ import { formatCurrency } from "@/lib/utils"; /** * Human label for a bounty payout, matching the gig card style: - * "$2.00 USD (paid in SOL)" when a coin is set, otherwise "$2.00 USD". + * "$2.00 USD (SOL)" when a coin is set, otherwise "$2.00 USD". + * Uses (COIN) format — not "(paid in COIN)" — so readers don't misread + * the USD value as a coin amount (e.g. reading "$1.00 USD (SOL)" as "1 SOL"). * Centralized so browse/detail/dashboard stay consistent. */ export function formatBountyPayout( @@ -12,7 +14,7 @@ export function formatBountyPayout( ): string { const amount = Number(amountUsd); const usd = `${formatCurrency(amount)} USD`; - return paymentCoin ? `${usd} (paid in ${paymentCoin})` : usd; + return paymentCoin ? `${usd} (${paymentCoin})` : usd; } export const questionSchema = z.object({