Repository navigation
feat(creator-detail): add max supply cap display and mint progress bar - #1195
Merged
Chucks1093 merged 1 commit intoOct 19, 2026
Merged
Conversation
accesslayerorg#1156) - Implement mint progress bar and supply cap section below key stats on CreatorDetailPage - Add pure calculation helper calculateMintProgress and formatMintPercentage with safe clamping (0-100), divide-by-zero prevention, and sensible rounding that prevents premature 100% display - Display remaining mintable key count via existing MiniStatChip primitive - Disable the Buy button when supply reaches or exceeds cap, showing the MaxSupplyReached user-facing error message - Hide progress bar and remaining chip for uncapped keys (maxSupply null, undefined, or <= 0) while keeping buy functionality enabled - Extend Course interface with optional maxSupply property - Add MaxSupplyReached entry to WALLET_ERROR_COPY and error code mappings - Add unit tests for calculation helper, component tests for KeyMintProgressSection, and integration tests for CreatorDetailPage
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.
Summary
Resolves #1156
KeyMintProgressSectiontoCreatorDetailPagedisplaying key supply mint progress towards the configuredmaxSupplycap.calculateMintProgressandformatMintPercentageinmintProgress.utils.tswith safe 0–100 clamping, divide-by-zero avoidance, sensible rounding (never prematurely displaying 100% until supply actually equals or exceeds max supply), and tiny fraction support (<1% display).MiniStatChipdesign primitive to cleanly display the remaining keys available to mint.maxSupply, displaying a contextual alert with the standard copy:"Maximum supply reached. No more keys can be minted.".maxSupplynull, undefined, or <= 0) while keeping buy functionality enabled.Courseincourse.service.tswithmaxSupply?: number | null;and mappedMaxSupplyReachedinerrorHandling.utils.ts.Testing
pnpm vitest run src/utils/__tests__/mintProgress.utils.test.ts(14 unit tests passing: 0%, partial, exactly at cap, over cap, fractions, edge cases)pnpm vitest run src/components/common/__tests__/KeyMintProgressSection.test.tsx(6 component tests passing: accessibility semantics, progress bar values, remaining chip, buy button gating, uncapped state)pnpm vitest run src/pages/__tests__/CreatorDetailPage.integration.test.tsx(Integration tests passing for capped, maxed, and uncapped flows)pnpm vitest run src/pages/__tests__/CreatorDetailPageSkeleton.test.tsx(Skeleton loading states verified)pnpm tsc -b(TypeScript typecheck passed with 0 errors)Checklist