-
Notifications
You must be signed in to change notification settings - Fork 518
feat: add credit balance check to WorkflowRunForm for modal display #1866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Implemented a pre-check for credit balance in the WorkflowRunForm component to display a modal if the user's credit balance is insufficient for the required credits. - Integrated subscription usage hooks to manage credit balance state and modal visibility. - Enhanced user experience by preventing submission when credit requirements are not met.
WalkthroughThis change adds a frontend credit-balance validation check to the workflow run form. The component now imports subscription-related hooks, consumes credit balance data and insufficient balance modal state, and implements pre-run checks in two locations to verify sufficient credits before execution, aborting and showing a modal if balance is insufficient. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (19)**/*.{jsx,tsx}📄 CodeRabbit inference engine (.cursorrules)
Files:
**/*.{js,ts,jsx,tsx}📄 CodeRabbit inference engine (.cursorrules)
Files:
**/*.{js,ts,tsx,jsx,py,java,cpp,c,cs,rb,go,rs,php,swift,kt,scala,r,m,mm,sql}📄 CodeRabbit inference engine (.cursor/rules/00-language-priority.mdc)
Files:
**/*.{js,ts,tsx,jsx}📄 CodeRabbit inference engine (.cursor/rules/00-language-priority.mdc)
Files:
**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/01-code-style.mdc)
Files:
**/*.{jsx,tsx,css}📄 CodeRabbit inference engine (.cursor/rules/01-code-style.mdc)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/03-typescript-guidelines.mdc)
Files:
**/*.{js,ts,jsx,tsx,css,json}📄 CodeRabbit inference engine (.cursor/rules/04-code-formatting.mdc)
Files:
**/*.{js,ts,jsx,tsx,css,json,yml,yaml}📄 CodeRabbit inference engine (.cursor/rules/04-code-formatting.mdc)
Files:
**/*.{js,ts,jsx,tsx,css,json,yml,yaml,md}📄 CodeRabbit inference engine (.cursor/rules/04-code-formatting.mdc)
Files:
**/*.{jsx,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/05-code-organization.mdc)
Files:
**/*.tsx📄 CodeRabbit inference engine (.cursor/rules/05-code-organization.mdc)
Files:
**/*.{css,scss,sass,less,js,jsx,ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/09-design-system.mdc)
Files:
**/*.{tsx,ts}📄 CodeRabbit inference engine (.cursor/rules/09-i18n-guidelines.mdc)
Files:
**/*.{tsx,ts,json}📄 CodeRabbit inference engine (.cursor/rules/09-i18n-guidelines.mdc)
Files:
**/*.{tsx,ts,jsx,js,vue,css,scss,less}📄 CodeRabbit inference engine (.cursor/rules/11-ui-design-patterns.mdc)
Files:
**/*.{tsx,ts,jsx,js,vue}📄 CodeRabbit inference engine (.cursor/rules/11-ui-design-patterns.mdc)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.cursor/rules/08-contributing-guidelines.mdc)
Files:
**/*.{tsx,jsx}📄 CodeRabbit inference engine (.cursor/rules/08-contributing-guidelines.mdc)
Files:
🧠 Learnings (2)📚 Learning: 2025-11-25T03:04:05.715ZApplied to files:
📚 Learning: 2025-11-25T03:04:05.715ZApplied to files:
🧬 Code graph analysis (1)packages/ai-workspace-common/src/components/canvas/workflow-run/workflow-run-form.tsx (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.