Skip to content

Drive MilestoneTrack from config (#1004)#1008

Merged
realproject7 merged 1 commit intomainfrom
fix/milestone-track-config
Apr 28, 2026
Merged

Drive MilestoneTrack from config (#1004)#1008
realproject7 merged 1 commit intomainfrom
fix/milestone-track-config

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Replace hardcoded prod CHART_TIERS in MilestoneTrack.tsx with values derived from data.milestones (the existing /api/airdrop/status response, which is already config-driven). Closes Airdrop: MilestoneTrack uses hardcoded FDV targets instead of config #1004.
  • Visual presentation (label + emoji) stays declared in TIER_PRESENTATION; fdv and poolPct come from the API.
  • Made the chart's log-scale FDV bounds (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.
  • Switched the y-axis ticks, milestone annotation, and x-axis labels to formatUsdValue, which already handles sub-dollar (test pool USD) through millions (prod pool USD) uniformly.
  • Version bump 1.2.1 → 1.2.2 (3rd-digit per CLAUDE.md for bug fix).

Test plan

  • npm run typecheck passes
  • npm run lint passes (no new errors on MilestoneTrack.tsx)
  • In test mode (NEXT_PUBLIC_AIRDROP_MODE=test), MilestoneTrack shows tier targets at $7K, $10K, $35K, $50K and the FDV axis spans roughly $70 → $100K
  • In prod mode, MilestoneTrack shows $1M, $10M, $50M, $100M and the FDV axis spans roughly $10K → $200M (matches previous prod behavior)
  • Current-FDV indicator (dashed line + dot) lands inside the chart area in both modes

🤖 Generated with Claude Code

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>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored Apr 28, 2026 0:24am

Request Review

Copy link
Copy Markdown
Owner Author

@realproject7 realproject7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-76 returns milestones.{bronze,silver,gold,diamond} with {mcap, pct, reached}; StatusData in MilestoneTrack.tsx:11-16 matches exactly. The data?.milestones?.[t.key]?.mcap ?? 0 access is the right shape.
  • Math sanity-check with test config (POOL_AMOUNT: 10 PLOT, BRONZE 7K/10% … DIAMOND 50K/100%): diamond poolUsd = 10 * 1.0 * (50_000 / 1_000_000) = $0.50, yMax = $0.55. formatUsdValue correctly renders sub-$1 as $0.500/$0.250 etc.
  • computeFdvBounds is 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 hardcoded Math.max(currentFdv, 10_000).
  • package-lock.json bumped to 1.2.2 proactively (both root and packages[""]).
  • Version bump 1.2.1 → 1.2.2 per CLAUDE.md (3rd-digit bug fix).
  • CI: lint-and-typecheck SUCCESS, Vercel preview SUCCESS, e2e still 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.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@realproject7 realproject7 merged commit d6cd26e into main Apr 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Airdrop: MilestoneTrack uses hardcoded FDV targets instead of config

2 participants