Drive MilestoneTrack from config (#1004)#1008
Conversation
Replace hardcoded prod CHART_TIERS in MilestoneTrack with values derived from the API response (which already returns config-driven milestones), so test mode shows test milestones ($7K/$10K/$35K/$50K) instead of $1M/$10M/$50M/$100M. Also make the chart's log-scale FDV bounds and dollar-formatting adapt to the active milestones, so the chart renders correctly across both modes (test pool values are sub-$1, prod values are millions). Bumps to 1.2.2. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
realproject7
left a comment
There was a problem hiding this comment.
RE2 review: LGTM (chat approval posted; --approve blocked since PR is from same account).
Verified end-to-end:
- API contract matches:
src/app/api/airdrop/status/route.ts:55-76returnsmilestones.{bronze,silver,gold,diamond}with{mcap, pct, reached};StatusDatainMilestoneTrack.tsx:11-16matches exactly. Thedata?.milestones?.[t.key]?.mcap ?? 0access is the right shape. - Math sanity-check with test config (
POOL_AMOUNT: 10PLOT, BRONZE 7K/10% … DIAMOND 50K/100%): diamondpoolUsd = 10 * 1.0 * (50_000 / 1_000_000) = $0.50, yMax = $0.55.formatUsdValuecorrectly renders sub-$1 as$0.500/$0.250etc. computeFdvBoundsis sensible:floor = bronze/100,logMax = diamond*2→ test mode $70/$100K, prod $10K/$200M (essentially preserves the old prod bounds).Math.max(currentFdv, floor)correctly replaces the old hardcodedMath.max(currentFdv, 10_000).package-lock.jsonbumped to 1.2.2 proactively (both root andpackages[""]).- Version bump 1.2.1 → 1.2.2 per CLAUDE.md (3rd-digit bug fix).
- CI:
lint-and-typecheckSUCCESS, Vercel preview SUCCESS,e2estill in progress — approval is contingent on e2e green.
Minor non-blocking note: formatUsdValue uses .toFixed(2), so prod tier labels shift from $1M/$10M/$50M/$100M → $1.00M/$10.00M/$50.00M/$100.00M. Author flagged uniform formatting across modes as intentional.
Approving from RE2.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
MilestoneTrack now derives FDV targets and pool percentages from the config-backed /api/airdrop/status milestone data instead of hardcoded prod values. The adaptive chart bounds preserve the prior prod scale while allowing test milestones like $7K/$10K/$35K/$50K to render correctly.
Findings
- None.
Decision
Approved. The change satisfies #1004, the version bump is synced in both package.json and package-lock.json, and CI is green for lint/typecheck and e2e.
Summary
CHART_TIERSinMilestoneTrack.tsxwith values derived fromdata.milestones(the existing/api/airdrop/statusresponse, which is already config-driven). Closes Airdrop: MilestoneTrack uses hardcoded FDV targets instead of config #1004.TIER_PRESENTATION;fdvandpoolPctcome from the API.logMin/logMax/floor) adapt to the active milestones so test mode (e.g. $7K/$10K/$35K/$50K) renders correctly instead of getting clamped to the old fixed $10K floor.formatUsdValue, which already handles sub-dollar (test pool USD) through millions (prod pool USD) uniformly.Test plan
npm run typecheckpassesnpm run lintpasses (no new errors onMilestoneTrack.tsx)NEXT_PUBLIC_AIRDROP_MODE=test),MilestoneTrackshows tier targets at $7K, $10K, $35K, $50K and the FDV axis spans roughly $70 → $100KMilestoneTrackshows $1M, $10M, $50M, $100M and the FDV axis spans roughly $10K → $200M (matches previous prod behavior)🤖 Generated with Claude Code