Skip to content

feat(keys): supply cap progress indicator on key detail page - #1080

Merged
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
chidii:feat/1035-supply-cap-progress
Oct 1, 2026
Merged

Chucks1093 merged 1 commit into
accesslayerorg:devfrom
chidii:feat/1035-supply-cap-progress

Conversation

@chidii

@chidii chidii commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Closes #1035

Summary

Adds a SupplyCapProgress component 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 numeric
    current / cap / remaining display, sold-out badge, and full hide when the
    cap is null / undefined / 0
  • src/components/common/__tests__/SupplyCapProgress.test.tsx — 9 tests
    covering every acceptance criterion
  • src/services/course.service.ts — add supplyCap?: number | null to
    KeyStats so the API field is typed and ready
  • src/pages/CreatorDetailPage.tsx — render <SupplyCapProgress> below
    the Buy button and disable Buy when supply >= supplyCap

Acceptance criteria

  • Progress bar shows correct current/cap ratio
  • Numeric values display correctly at all supply levels
  • Sold-out badge appears when supply equals cap
  • Buy button correctly disabled in sold-out state
  • Progress bar not rendered for unlimited keys

Notes

  • The /keys/:id/stats endpoint does not currently return supplyCap, so the
    component renders nothing for every key today. Once the API includes
    supplyCap, the bar activates automatically — no further client changes
    needed.
  • The 30s refresh is inherited from useKeyStats, whose refetchInterval
    is already 30_000 (KEY_STATS_REFRESH_INTERVAL_MS), so no new polling
    was added.

Verification

  • pnpm run lint — 0 problems
  • pnpm run build — ✓ built in 43.86s
  • pnpm run test -- SupplyCapProgress — 9 passed (9)

@drips-wave

drips-wave Bot commented Oct 1, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@Chucks1093
Chucks1093 merged commit 3eabfb8 into accesslayerorg:dev Oct 1, 2026
1 check 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.

Add supply cap progress indicator on creator key detail page

2 participants