Open rules in modal instead of switching page#516
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Warning Rate limit exceeded@elie222 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 2 minutes and 50 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
""" WalkthroughThis update replaces all rule-related links from Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant RulesPage
participant RuleDialog
participant RuleForm
participant Backend
User->>RulesPage: Click "Add Rule" or "Edit Rule"
RulesPage->>RuleDialog: Open dialog (with optional ruleId)
RuleDialog->>RuleForm: Render form (create or edit mode)
User->>RuleForm: Fill and submit form
RuleForm->>Backend: Create or update rule
Backend-->>RuleForm: Respond with success
RuleForm->>RuleDialog: Call onSuccess (if dialog mode)
RuleDialog->>RulesPage: Close dialog and refresh list
Possibly related PRs
Poem
✨ 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/web/hooks/useDialogState.ts (1)
1-32: Generic dialog state hook is well-implemented
The hook provides clear, type-safe open/close/toggle handlers with stable callbacks and correctly preserves or resets associated data. Consider adding JSDoc for public methods and unit tests to validate state transitions.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
apps/web/app/(app)/[emailAccountId]/assistant/ProcessResultDisplay.tsx(1 hunks)apps/web/app/(app)/[emailAccountId]/assistant/RuleDialog.tsx(1 hunks)apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx(5 hunks)apps/web/app/(app)/[emailAccountId]/assistant/Rules.tsx(9 hunks)apps/web/app/(app)/[emailAccountId]/assistant/group/Groups.tsx(1 hunks)apps/web/app/(app)/[emailAccountId]/assistant/rule/[ruleId]/examples/page.tsx(1 hunks)apps/web/components/GroupedTable.tsx(1 hunks)apps/web/hooks/useDialogState.ts(1 hunks)apps/web/utils/ai/assistant/process-user-request.ts(1 hunks)version.txt(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (18)
version.txt (1)
1-1: Verify version bump and release documentation.
The version was updated tov1.6.9to coincide with the new modal-based rule UI flow. Please confirm that:
- CHANGELOG.md or release notes include an entry for this bump.
- Any other version metadata (e.g., in package.json or CI configs) has been updated to
v1.6.9.apps/web/utils/ai/assistant/process-user-request.ts (1)
108-108: Corrected system prompt URL to/assistantroute
This aligns the assistant responses with the updated routing scheme, ensuring links now point to the assistant’s rules tab instead of the automation page.apps/web/app/(app)/[emailAccountId]/assistant/group/Groups.tsx (1)
99-102: Updated group rule link to use assistant route
The navigation URL now correctly points to/assistantwith thetab=ruleandruleIdquery parameters, maintaining context when opening a rule.apps/web/app/(app)/[emailAccountId]/assistant/rule/[ruleId]/examples/page.tsx (1)
45-48: Redirect "View Rule" button to assistant route
The button now links to the assistant’s rule details tab, aligning with the modal-driven editing interface in the assistant section.apps/web/app/(app)/[emailAccountId]/assistant/ProcessResultDisplay.tsx (1)
90-93: Link in process result updated to assistant route
The external link now opens the matched rule in the assistant tab instead of the automation page, ensuring consistent navigation across the assistant UI.apps/web/components/GroupedTable.tsx (1)
437-437: URL path update looks good.The change from
/automationto/assistantaligns with the overall transition to assistant-focused routing.apps/web/app/(app)/[emailAccountId]/assistant/RuleForm.tsx (4)
113-119: Well-implemented dialog support.The new props
onSuccessandisDialogprovide clean support for modal dialog usage while maintaining backward compatibility.
330-330: Form styling adjustment is appropriate.Removing explicit width constraints makes sense for dialog usage where the dialog container controls the width.
346-346: Reduced margin improves dialog layout.The change from
mt-8tomt-4provides better spacing within the dialog container.
217-251: Let’s broaden the search to include both .ts and .tsx files via globs:#!/bin/bash # Find any remaining “/automation” references in TypeScript files rg -n "/automation" -g "*.ts" -g "*.tsx"apps/web/app/(app)/[emailAccountId]/assistant/RuleDialog.tsx (3)
15-22: Well-designed interface.The props interface is clean and provides good flexibility for both create and edit scenarios.
32-37: Good separation of concerns.The
handleSuccessfunction properly coordinates between the success callback and dialog closure.
41-78: Solid dialog implementation.The component handles both create and edit modes well:
- Proper loading states for existing rules
- Sensible defaults for new rules
- Good accessibility with dialog constraints
- Appropriate scroll behavior for large forms
apps/web/app/(app)/[emailAccountId]/assistant/Rules.tsx (5)
57-65: Clean dialog state management.The integration of
useDialogStateandRuleDialogprovides a clean separation between state management and UI rendering.
215-246: Improved user experience with dialog approach.Converting the rule name from a link to a button that opens a dialog (or new tab for cold email blocker) provides better UX by keeping users in context while viewing rule details.
297-311: Consistent edit flow.The Edit dropdown now uses the same dialog pattern, providing a consistent user experience across different entry points.
438-447: Well-integrated dialog component.The RuleDialog is properly connected to the dialog state and includes appropriate success handling that refreshes the data and closes the dialog.
481-515: Consistent dialog usage across components.Both
NoRulesandAddRuleButtonscomponents properly use the dialog callback pattern, maintaining consistency throughout the rule management flow.
Summary by CodeRabbit
New Features
Improvements
Other