feat(keys): supply cap progress indicator on key detail page - #1080
Merged
Chucks1093 merged 1 commit intoOct 1, 2026
Merged
Conversation
|
@chidii Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
5 tasks
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.
Closes #1035
Summary
Adds a
SupplyCapProgresscomponent and wires it into the key detail page,showing current supply as a percentage of the cap with a sold-out state
when the cap is reached.
Changes
src/components/common/SupplyCapProgress.tsx— progress bar with numericcurrent / cap / remaining display, sold-out badge, and full hide when the
cap is null / undefined / 0
src/components/common/__tests__/SupplyCapProgress.test.tsx— 9 testscovering every acceptance criterion
src/services/course.service.ts— addsupplyCap?: number | nulltoKeyStatsso the API field is typed and readysrc/pages/CreatorDetailPage.tsx— render<SupplyCapProgress>belowthe Buy button and disable Buy when
supply >= supplyCapAcceptance criteria
Notes
/keys/:id/statsendpoint does not currently returnsupplyCap, so thecomponent renders nothing for every key today. Once the API includes
supplyCap, the bar activates automatically — no further client changesneeded.
useKeyStats, whoserefetchIntervalis already
30_000(KEY_STATS_REFRESH_INTERVAL_MS), so no new pollingwas added.
Verification
pnpm run lint— 0 problemspnpm run build— ✓ built in 43.86spnpm run test -- SupplyCapProgress— 9 passed (9)