assistant: add all rules disabled banner#1205
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughAdds a new AllRulesDisabledBanner component to the automation UI, extends ActionCard with blue/destructive variants and richer description typing, marks Alert components as deprecated, wraps onboarding step rendering in a Suspense boundary, and renames/refactors OpenAI-specific quota errors to generic AI quota handling across utilities. Changes
Sequence Diagram(s)(Skipped — changes are UI additions and utility refactors that do not introduce a new multi-component control flow warranting a sequence diagram.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
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 |
Add an AllRulesDisabledBanner to the Automation page to prompt onboarding when all rules are disabledIntroduce 📍Where to StartStart with Macroscope summarized 49455ba. |
There was a problem hiding this comment.
1 issue found across 10 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="apps/web/utils/llms/index.ts">
<violation number="1" location="apps/web/utils/llms/index.ts:326">
P2: Error message may mislead users when the underlying error is quota exceeded (not rate limiting). The `isAiQuotaExceededError` function catches both quota exceeded AND rate limit errors, but this message suggests all such errors are temporary rate limits. For quota exceeded errors, users need to take action (add credits), and it's not temporary. Consider a more accurate message like: "Your AI provider has rejected requests due to rate limits or quota. Please check your provider account if this persists."</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="apps/web/components/ui/card.tsx">
<violation number="1" location="apps/web/components/ui/card.tsx:144">
P2: The `description` prop now accepts `React.ReactNode`, but it's rendered inside a `<p>` tag which only allows phrasing (inline) content. If block-level elements are passed as description, this will create invalid HTML and may cause React hydration warnings. Consider changing the wrapper from `<p>` to `<div>` to safely accommodate React nodes.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
…card description wrapper
User description
Add a banner to the AI Assistant page that appears when all rules are disabled, directing users to restart the onboarding process.
AllRulesDisabledBannerclient component.ActionCardcomponent.AutomationPagewith proper spacing.ActionCardexamples to the components gallery.Alertcomponent as deprecated.Summary by CodeRabbit
New Features
UI Improvements
Bug Fixes
Deprecation
✏️ Tip: You can customize this high-level summary in your review settings.
Generated description
Below is a concise technical summary of the changes proposed in this PR:
graph LR handleError_("handleError"):::modified isAiQuotaExceededError_("isAiQuotaExceededError"):::added checkCommonErrors_("checkCommonErrors"):::modified AllRulesDisabledBanner_("AllRulesDisabledBanner"):::added ActionCard_("ActionCard"):::modified AutomationPage_("AutomationPage"):::modified useRules_hook_call_("useRules (hook call)"):::added useAccount_hook_call_("useAccount (hook call)"):::added handleError_ -- "Detects AI quota errors instead of OpenAI retry; shows notification." --> isAiQuotaExceededError_ checkCommonErrors_ -- "Classifies RetryError as AI quota and returns 429." --> isAiQuotaExceededError_ AllRulesDisabledBanner_ -- "Renders blue ActionCard banner with setup action link." --> ActionCard_ AutomationPage_ -- "Inserts AllRulesDisabledBanner into AutomationPage above tabs." --> AllRulesDisabledBanner_ AllRulesDisabledBanner_ -- "Fetches user rules via useRules to detect all-disabled." --> useRules_hook_call_ AllRulesDisabledBanner_ -- "Uses useAccount to obtain emailAccountId for onboarding link." --> useAccount_hook_call_ classDef added stroke:#15AA7A classDef removed stroke:#CD5270 classDef modified stroke:#EDAC4C linkStyle default stroke:#CBD5E1,font-size:13pxIntroduces an
AllRulesDisabledBannercomponent on the AI Assistant page to inform users when all rules are disabled, guiding them to restart the onboarding process. Enhances theActionCardcomponent with new visual variants and refactors AI quota error handling for broader AI provider support.AllRulesDisabledBannercomponent and its integration into theAutomationPage, along with addingSuspenseto the onboarding page for improved loading feedback.Modified files (3)
Latest Contributors(2)
ActionCardcomponent with newblueanddestructivevariants, adds examples for these new variants to the components gallery, and marks theAlertcomponent as deprecated in favor ofActionCard. Additionally, refactors AI quota error detection to be more generic, changingOPENAI_RETRY_ERRORtoAI_QUOTA_ERRORto cover multiple AI providers.Modified files (7)
Latest Contributors(2)