[#1057] Fix airdrop chart diamond label clipping + MCap caption float#1058
Merged
realproject7 merged 1 commit intomainfrom May 6, 2026
Merged
[#1057] Fix airdrop chart diamond label clipping + MCap caption float#1058realproject7 merged 1 commit intomainfrom
realproject7 merged 1 commit intomainfrom
Conversation
- pad.right 16 → 50 so the rightmost milestone (diamond) labels at text-anchor="middle" no longer extend past viewBox 600. pad.left 16 → 24 so the "$0" endpoint label has matching breathing room. - formatMcap rounds K/M values to 2 decimals when not integer, so "Current: $33.523555869999996K" renders as "$33.52K". Fixes #1057 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This was referenced May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1057
Summary
Two visible bugs from #1056:
Diamond milestone labels clipped: `unlocks 100%` rendered as `unlocks 1`, `(≈ Fix Farcaster identity: use Steemhunt API (free) with Neynar fallback #250)` rendered as `(≈ [P0-2] Supabase Schema #2`, because text-anchor="middle" centered at x=584 (= pad.left + 1.0×chartW) extends ~35px past the SVG `viewBox`'s right edge. Fixed by widening `pad.right` from 16 to 50 (and `pad.left` 16 → 24 for symmetry, so `$0` endpoint label has room).
Current MCap caption showed raw float: `$33.523555869999996K`. Fixed by adding `.toFixed(2)` rounding inside `formatMcap` for non-integer K/M values, while keeping integer milestone values ($1M, $10M, etc.) clean as `$1M` not `$1.00M`.
Files
src/components/airdrop/CampaignHero.tsx—formatMcaprounding +padadjustment inMCapChartpackage.json— 1.7.0 → 1.7.1Verification
npm run typecheckpassesformatMcap(1_000_000)→\$1M(integer untouched)formatMcap(33_523.555)→\$33.52KformatMcap(50)→\$50Test plan