Add unsaved changes popup to global settings#3198
Conversation
📝 WalkthroughWalkthroughAdds delegated change tracking for eligible global settings fields and regenerates the compiled admin JavaScript bundle without changing its public entrypoints. ChangesAdmin settings behavior
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Jul 22, 2026 4:48p.m. | Review ↗ | |
| JavaScript | Jul 22, 2026 4:48p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
js/src/admin/admin.js (1)
11375-11377: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd regression coverage for the delegated settings handler.
Please test that search/license/payment-tab inputs do not set
fieldsUpdated, while ordinary inputs, selects, and textareas do; also verify that dynamically added controls are tracked.🤖 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 `@js/src/admin/admin.js` around lines 11375 - 11377, Add regression tests for the delegated settings handler bound to `#form_global_settings`, covering excluded search inputs, license-key inputs, and payment-section tabs leaving fieldsUpdated unchanged, while ordinary inputs, selects, and textareas set it. Also verify dynamically added matching controls trigger fieldUpdated and update fieldsUpdated.
🤖 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 `@js/src/admin/admin.js`:
- Around line 11375-11377: Add regression tests for the delegated settings
handler bound to `#form_global_settings`, covering excluded search inputs,
license-key inputs, and payment-section tabs leaving fieldsUpdated unchanged,
while ordinary inputs, selects, and textareas set it. Also verify dynamically
added matching controls trigger fieldUpdated and update fieldsUpdated.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 0831bc61-7288-4c01-b8c2-caddfc824614
📒 Files selected for processing (2)
js/formidable_admin.jsjs/src/admin/admin.js
This adds the confirmation pop-up if you update a global setting and then try to leave without saving.
When testing, we want to make sure there aren't any non-settings inputs that trigger this (like a search).
And that it actually triggers for all unsaved global settings changes.
The pop-up contents vary from browser to browser. In Firefox it looks like this.
Summary by CodeRabbit