diff --git a/core/src/main/resources/lib/layout/layout.jelly b/core/src/main/resources/lib/layout/layout.jelly
index 25e7063723bb..b811a22e5edd 100644
--- a/core/src/main/resources/lib/layout/layout.jelly
+++ b/core/src/main/resources/lib/layout/layout.jelly
@@ -123,6 +123,12 @@ THE SOFTWARE.
+
+
+
+
+
+
diff --git a/war/src/main/webapp/css/responsive-grid.css b/war/src/main/webapp/css/responsive-grid.css
index 5981211d603c..d47d11d766ca 100644
--- a/war/src/main/webapp/css/responsive-grid.css
+++ b/war/src/main/webapp/css/responsive-grid.css
@@ -1815,4 +1815,4 @@
}
@-ms-viewport {
width: device-width;
-}
+}
\ No newline at end of file
diff --git a/war/src/main/webapp/scripts/hudson-behavior.js b/war/src/main/webapp/scripts/hudson-behavior.js
index b3cfda8f2a44..0603499ba2d4 100644
--- a/war/src/main/webapp/scripts/hudson-behavior.js
+++ b/war/src/main/webapp/scripts/hudson-behavior.js
@@ -2709,3 +2709,60 @@ var layoutUpdateCallback = {
}
},
};
+
+/**
+ * Fix for JENKINS-76241: Prevent POST race condition
+ * Apply Behaviour rules early - MINIMAL, SAFE VERSION
+ */
+(function () {
+ "use strict";
+
+ if (window._jenkinsPostHandlerFixApplied) {
+ return;
+ }
+ window._jenkinsPostHandlerFixApplied = true;
+
+ // Just apply Behaviour earlier - THAT'S IT
+ function applyEarly() {
+ if (typeof Behaviour !== "undefined" && Behaviour.apply) {
+ try {
+ Behaviour.apply();
+ } catch (e) {
+ // Ignore - will retry on DOMContentLoaded
+ }
+ }
+ }
+
+ // Apply immediately
+ applyEarly();
+
+ // Apply on DOMContentLoaded as backup
+ document.addEventListener("DOMContentLoaded", applyEarly);
+
+ // Watch for new content
+ if (typeof MutationObserver !== "undefined") {
+ var observer = new MutationObserver(function (mutations) {
+ var needsReapply = false;
+ mutations.forEach(function (mutation) {
+ mutation.addedNodes.forEach(function (node) {
+ if (
+ node.nodeType === 1 &&
+ (node.tagName === "FORM" ||
+ (node.querySelector && node.querySelector("FORM")))
+ ) {
+ needsReapply = true;
+ }
+ });
+ });
+ if (needsReapply) {
+ applyEarly();
+ }
+ });
+
+ document.addEventListener("DOMContentLoaded", function () {
+ if (document.body) {
+ observer.observe(document.body, { childList: true, subtree: true });
+ }
+ });
+ }
+})();