Close QueueTaskModal only when provider launch request returns#1416
Close QueueTaskModal only when provider launch request returns#1416
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughKeeps the queue modal visible during task submission and adds client-side cycling loading messages shown next to the Submit button while a submission is in progress. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant UI as QueueTaskModal
participant Controller as Tasks handler
participant API as Launch API
User->>UI: Click "Submit"
UI->>Controller: startQueueSubmit() (isSubmitting=true)
Note right of UI: start cycling loadingMessages every 1.5s
Controller->>API: send launch request
API-->>Controller: respond (success/failure)
Controller-->>UI: update result
Note right of UI: stop cycling, show final message
Controller->>UI: setQueueModalOpen(false), clear queued task
UI-->>User: close modal / show outcome
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/components/Experiment/Tasks/Tasks.tsx (1)
970-973: Minor redundancy: Modal is closed twice on success path.On success,
setQueueModalOpen(false)is called at line 970, and then again in thefinallyblock at line 995. While this is harmless (React state updates are idempotent), consider removing the call here since thefinallyblock handles closure for all code paths.Alternatively, if the intent is to close the modal before awaiting the mutations (for faster perceived response), the current structure is acceptable.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/renderer/components/Experiment/Tasks/Tasks.tsx` around lines 970 - 973, The code calls setQueueModalOpen(false) before awaiting Promise.all([jobsMutate(), templatesMutate()]) and then again in the finally block, causing a redundant state update; remove the earlier call to setQueueModalOpen(false) (the one immediately before await Promise.all) so modal closure is handled centrally in the finally block, leaving jobsMutate(), templatesMutate(), and setTaskBeingQueued(null) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/renderer/components/Experiment/Tasks/Tasks.tsx`:
- Around line 970-973: The code calls setQueueModalOpen(false) before awaiting
Promise.all([jobsMutate(), templatesMutate()]) and then again in the finally
block, causing a redundant state update; remove the earlier call to
setQueueModalOpen(false) (the one immediately before await Promise.all) so modal
closure is handled centrally in the finally block, leaving jobsMutate(),
templatesMutate(), and setTaskBeingQueued(null) unchanged.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/renderer/components/Experiment/Tasks/QueueTaskModal.tsxsrc/renderer/components/Experiment/Tasks/Tasks.tsx
Summary by CodeRabbit
New Features
Improvements