Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/admin-x-framework/src/api/automations.ts`:
- Around line 76-80: The request body is using the wrong envelope—body:
({status}) => ({ automations: [{ status }] })—but the API expects a single
automation object; update the body function in
apps/admin-x-framework/src/api/automations.ts to return automation: { status }
instead of automations: [{ status }] so publish/unpublish uses the correct
contract (locate the arrow function labeled body that destructures status and
replace the array envelope with the single automation object).
In `@apps/posts/src/views/Automations/editor.tsx`:
- Line 27: The pending mutation state currently uses editMutation.isLoading for
any in-flight edit which can affect the wrong automation after a route change;
update the logic that computes pendingStatus so it only considers the mutation
if editMutation.variables?.id matches the current automation's id (e.g.,
automation.id or currentAutomationId) — i.e., scope the isLoading check to
editMutation.variables?.id === automation.id before returning
editMutation.variables?.status (otherwise return undefined). This change touches
the pendingStatus computation that references editMutation and the current
automation id in editor.tsx.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f0fb70f3-e21f-4f97-b078-3c053ab0ea70
📒 Files selected for processing (5)
apps/admin-x-framework/src/api/automations.tsapps/posts/src/views/Automations/components/automation-header.tsxapps/posts/src/views/Automations/editor.tsxapps/posts/test/unit/views/automations/automation-editor.test.tsxghost/admin/app/services/state-bridge.js
Prompt below. --- Let's make some changes to the way saving an automation's status works. I want to change the way in-flight requests are handled, but the "steady state" doesn't need to change. End result: - When publishing an automation (by clicking the "Publish changes" button)... - The "Publish" button should be disabled and show a spinner while loading. Consider changing the text if that's a design pattern elsewhere in this product. - If it fails, the button should turn red and say "retry" or similar. This should match the pattern elsewhere in the codebase. - If it succeeds, do what it does today. - When un-publishing an automation (by clicking the "Turn off" button in the modal)... - The "Turn off" button should be disabled and show a spinner while loading. Consider changing the text if that's a design pattern elsewhere in this product. - If it fails, the button should turn red and say "retry" or similar. This should match the pattern elsewhere in the codebase. - If it succeeds, do what it does today and close the modal. - No error modal should be shown (though the "Turn off" confirmation modal will be there). - If relevant, tests should be updated. Otherwise, it should work similarly to how it works today. Note that you're making changes on a branch that implemented a first version which behaved differently. You might be able to look at something like `git diff main --name-only` (or your favorite equivalent!) to see the relevant files you'll need to edit.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-Authored-By: Troy Ciesco <tmciesco@gmail.com>
Co-Authored-By: Troy Ciesco <tmciesco@gmail.com>
ref NY-1281
closes NY-1267
Screencast.mp4