Skip to content

Restore unsaved changes warning in new Manage Jenkins UI#26292

Closed
Maanvi212006 wants to merge 3 commits intojenkinsci:masterfrom
Maanvi212006:fix/unsaved-changes-warning
Closed

Restore unsaved changes warning in new Manage Jenkins UI#26292
Maanvi212006 wants to merge 3 commits intojenkinsci:masterfrom
Maanvi212006:fix/unsaved-changes-warning

Conversation

@Maanvi212006
Copy link

@Maanvi212006 Maanvi212006 commented Feb 9, 2026

Fixes #JENKINS-26270

Testing done

  • Enabled the new Manage Jenkins UI
  • Navigated to Manage Jenkins → System
  • Modified a configuration value (for example, toggled a checkbox)
  • Attempted to navigate away from the page or reload
  • Verified that the browser displayed a native unsaved changes warning dialog
  • Repeated the same steps on Security and Appearance pages

This change was tested manually since it affects frontend behavior.

Screenshots (UI changes only)

Before

No warning and one leaves the page potentially losing unsaved changes

After

fixed_ui

Proposed changelog entries

  • Restore unsaved changes warning on Manage Jenkins configuration pages

Proposed changelog category

/label bug,web-ui

Proposed upgrade guidelines

N/A

Submitter checklist

  • The issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change and are in the imperative mood.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • UI changes do not introduce regressions when enforcing the current default rules of the Content Security Policy Plugin.
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

@jenkinsci/core-pr-reviewers

@MarkEWaite MarkEWaite changed the title [JENKINS-26270] Restore unsaved changes warning in new Manage Jenkins UI [Restore unsaved changes warning in new Manage Jenkins UI Feb 9, 2026
@MarkEWaite
Copy link
Contributor

MarkEWaite commented Feb 9, 2026

Please restore the pull request template and answer all the items in the pull request template.

When you skip the pull request template, it looks like you are not paying attention to the contributing guidelines. Show that you are paying attention to the contributing guidelines by completing the pull request template.

I've marked this pull request as draft. When you've completed the pull request template and confirmed that you've done all the steps in that template, you can mark it as "Ready for Review".

In the very near future, we will immediately close pull requests that do not use the pull request template.

@MarkEWaite MarkEWaite marked this pull request as draft February 9, 2026 23:23
@Maanvi212006 Maanvi212006 marked this pull request as ready for review February 9, 2026 23:30
@timja
Copy link
Member

timja commented Feb 10, 2026

Please use the actual template not one you've made up:
https://raw.githubusercontent.com/jenkinsci/jenkins/refs/heads/master/.github/PULL_REQUEST_TEMPLATE.md

The change itself looks sensible, (assuming it works)

@timja timja marked this pull request as draft February 10, 2026 15:15
@comment-ops-bot comment-ops-bot bot added bug For changelog: Minor bug. Will be listed after features web-ui The PR includes WebUI changes which may need special expertise labels Feb 10, 2026
@Maanvi212006 Maanvi212006 marked this pull request as ready for review February 10, 2026 16:43
@MarkEWaite MarkEWaite changed the title [Restore unsaved changes warning in new Manage Jenkins UI Restore unsaved changes warning in new Manage Jenkins UI Feb 12, 2026
Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

When I run Jenkins from this pull request with the command:

JENKINS_HOME=work java -jar war/target/jenkins.war

and complete the setup wizard by choosing to install no plugins, when I open the "Manage Jenkins" -> "System" page, it reports the following stack trace to the console:

2026-02-12 13:30:40.281+0000 [id=126]   INFO    h.m.UpdateCenter$CompleteBatchJob#run: Completed installation of 0 plugins in 17 ms
2026-02-12 13:30:56.201+0000 [id=32]    WARNING o.k.s.f.adjunct.AdjunctsInPage#findNeeded: No such adjunct found: hudson-behavior
org.kohsuke.stapler.framework.adjunct.NoSuchAdjunctException: Neither hudson-behavior.css, .js, .html, nor .jelly were found
        at org.kohsuke.stapler.framework.adjunct.Adjunct.<init>(Adjunct.java:127)
        at org.kohsuke.stapler.framework.adjunct.AdjunctManager.get(AdjunctManager.java:154)
        at org.kohsuke.stapler.framework.adjunct.AdjunctsInPage.findNeeded(AdjunctsInPage.java:169)
        at org.kohsuke.stapler.framework.adjunct.AdjunctsInPage.generate(AdjunctsInPage.java:115)
        at org.kohsuke.stapler.jelly.AdjunctTag.doTag(AdjunctTag.java:86)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:271)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:100)
        at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:271)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.apache.commons.jelly.impl.TagScript.getBodyText(TagScript.java:767)
        at org.apache.commons.jelly.tags.core.CoreTagLibrary$3.run(CoreTagLibrary.java:141)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:102)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:102)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:100)
        at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:271)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
        at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:121)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
        at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:121)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
        at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:121)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)

That will need to be fixed before the pull request can be merged.

@timja
Copy link
Member

timja commented Feb 12, 2026

Also the screenshot doesn't have the feature flag enabled either.

So it doesn't show this fixed

Go to your profile in the top right, then experiments

Enable:
image

permissions="${attrs.permissions}"
type="${newManageJenkins ? 'two-column' : 'one-column'}">

<st:adjunct includes="hudson-behavior"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

The hudson-behavior.js is always included and even when not that would not be the correct way.

</l:defer.placeholder>
<l:defer.children>
<d:invokeBody />
<div class="jenkins-config">
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see why this should solve the problem. To detect that there is a changed field there is lib.form.confirm.js. I think it is loaded but for some reason it doesn't catch the changes.

@mawinter69
Copy link
Contributor

With #26314 we have a much more promising approach.

@mawinter69
Copy link
Contributor

/label proposed-for-close

@comment-ops-bot comment-ops-bot bot added the proposed-for-close There is no consensus about feasibility of this PR, and maintainers do not see a way forward for it label Feb 14, 2026
@MarkEWaite
Copy link
Contributor

Closing

@MarkEWaite MarkEWaite closed this Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug For changelog: Minor bug. Will be listed after features proposed-for-close There is no consensus about feasibility of this PR, and maintainers do not see a way forward for it web-ui The PR includes WebUI changes which may need special expertise

Projects

None yet

Development

Successfully merging this pull request may close these issues.

With the new Manage Jenkins UI there is no warning anymore when leaving with unsaved changes

4 participants