Skip to content

Add unsaved changes popup to global settings#3198

Open
Crabcyborg wants to merge 1 commit into
masterfrom
add_unsaved_changed_popup_to_global_settings
Open

Add unsaved changes popup to global settings#3198
Crabcyborg wants to merge 1 commit into
masterfrom
add_unsaved_changed_popup_to_global_settings

Conversation

@Crabcyborg

@Crabcyborg Crabcyborg commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

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.

Screenshot 2026-07-22 at 1 47 15 PM

Summary by CodeRabbit

  • Bug Fixes
    • Prevented search, add-on license, and payment-related fields from incorrectly marking global settings as having unsaved changes.
    • Improved unsaved-change tracking for other global settings fields.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds delegated change tracking for eligible global settings fields and regenerates the compiled admin JavaScript bundle without changing its public entrypoints.

Changes

Admin settings behavior

Layer / File(s) Summary
Settings change tracking and bundle regeneration
js/src/admin/admin.js, js/formidable_admin.js
The global settings form delegates eligible input, select, and textarea changes to fieldUpdated, excludes search, addon license, and payment controls, and includes the regenerated admin bundle.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: garretlaxton

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding an unsaved-changes prompt for global settings.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add_unsaved_changed_popup_to_global_settings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@deepsource-io

deepsource-io Bot commented Jul 22, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in ddac8e5...bc813bc on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
js/src/admin/admin.js (1)

11375-11377: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add 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

📥 Commits

Reviewing files that changed from the base of the PR and between ddac8e5 and bc813bc.

📒 Files selected for processing (2)
  • js/formidable_admin.js
  • js/src/admin/admin.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant