Skip to content

feat: add holding cap warning and enforcement feedback on buy form (#1015) - #1040

Merged
Chucks1093 merged 1 commit into
accesslayerorg:devfrom
Ahbiz:feat/1015-holding-cap-warning
Sep 28, 2026
Merged

Chucks1093 merged 1 commit into
accesslayerorg:devfrom
Ahbiz:feat/1015-holding-cap-warning

Conversation

@Ahbiz

@Ahbiz Ahbiz commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #1015

Display a holding cap indicator on the buy form showing the user's current balance relative to the key's maximum holding cap, and block submission when the purchase would exceed it.

Scope & Changes

  • Holding Cap Progress Bar: Added HoldingCapIndicator showing current balance vs maximum holding cap with an accessible progress bar (role="progressbar").
  • Inline Warning: Displays immediate inline feedback when the entered purchase amount would breach the cap or when the cap limit is already reached.
  • Button Enforcement: Disables the buy button with Holding Cap Exceeded or Holding Cap Reached messages when limit is reached or exceeded, and clamps the MAX button to the remaining cap allowance.
  • Accessible Tooltip: Added AccessibleInfoTrigger tooltip explaining the creator-configured holding cap policy to promote fair distribution and prevent ownership concentration.
  • Unlimited Keys: Hidden automatically when keys have no holding cap or cap is unlimited.
  • Service & Model Updates: Extended Course and KeyConfig interfaces, and added exceeds-holding-cap validation in validateTradeQuantity.

Testing

  • pnpm lint
  • pnpm build
  • HoldingCapIndicator.test.tsx (9 passed)
  • TradeDialog.holdingCap.test.tsx (10 passed)
  • tradeQuantityValidation.holdingCap.test.ts (7 passed)
  • BuySellKeyFlow.test.tsx (11 passed)
  • CreatorDetailPage.buyKeyFlow.integration.test.tsx (3 passed)

Checklist

…ccesslayerorg#1015)

Display a holding cap indicator on the buy form showing the user's current balance relative to the key's maximum holding cap, and block submission when the purchase would exceed it.

- Add HoldingCapIndicator component with accessible progress bar and tooltip
- Provide inline warnings as purchase quantity changes
- Disable buy button with cap exceeded / reached messages
- Hide holding cap indicator when cap is unlimited or unconfigured
- Add comprehensive unit and integration test coverage
@drips-wave

drips-wave Bot commented Sep 27, 2026

Copy link
Copy Markdown

@Ahbiz 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 5dce5d8 into accesslayerorg:dev Sep 28, 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 holding cap warning and enforcement feedback on buy form

2 participants