feat: add step drag and drop reordering#430
Conversation
📝 WalkthroughWalkthroughAdds drag-and-drop reordering to campaign sequence steps in ChangesDrag-and-drop step reordering
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Suggested labels
🚥 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)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/campaign-builder.html (1)
1988-1994: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winConsider providing user feedback when auto-save fails.
The save failure is logged to console but the user has no indication that persistence failed. If the user navigates away believing the reorder was saved, they may be surprised when it reverts on next load.
A minimal approach could be a toast notification or reverting the local state on failure.
💡 Example: revert on failure or notify user
if (campaignId) { + const previousSteps = [...steps]; try { await saveCampaign(); } catch (error) { console.warn('Unable to persist reordered steps automatically.', error); + // Option A: Revert on failure + // steps.length = 0; + // steps.push(...previousSteps); + // renderCanvas(); + // renderEditor(); + + // Option B: Notify user (if toast utility exists) + // showToast?.('Step order could not be saved', 'warning'); } }🤖 Prompt for 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. In `@frontend/campaign-builder.html` around lines 1988 - 1994, When the saveCampaign() function fails inside the try-catch block (when campaignId exists), the error is only logged to console without any user-facing feedback. Modify the catch block to provide visible feedback to the user about the failed auto-save by either displaying a toast notification informing them the reorder failed to persist, or by reverting the local state changes back to their previous state so the UI reflects what was actually saved to the server. This ensures the user knows the auto-save failed and won't be surprised if the changes revert on next page load.
🤖 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.
Nitpick comments:
In `@frontend/campaign-builder.html`:
- Around line 1988-1994: When the saveCampaign() function fails inside the
try-catch block (when campaignId exists), the error is only logged to console
without any user-facing feedback. Modify the catch block to provide visible
feedback to the user about the failed auto-save by either displaying a toast
notification informing them the reorder failed to persist, or by reverting the
local state changes back to their previous state so the UI reflects what was
actually saved to the server. This ensures the user knows the auto-save failed
and won't be surprised if the changes revert on next page load.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 3fc883be-233a-43c4-82f2-33e97a3d754e
📒 Files selected for processing (1)
frontend/campaign-builder.html
What changed
Why
Validation
git diff --checknode --checkon the inline campaign builder scriptSummary by CodeRabbit
Release Notes