From dbb08525d257dbe398cf8f3c17702b0a44dec388 Mon Sep 17 00:00:00 2001 From: James Nord Date: Mon, 23 Jun 2025 14:47:32 +0100 Subject: [PATCH 1/2] extend RootAction.isPrimary javadoc Address review from Jan in https://github.com/jenkinsci/jenkins/pull/10729#issuecomment-2996343069 --- core/src/main/java/hudson/model/RootAction.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/hudson/model/RootAction.java b/core/src/main/java/hudson/model/RootAction.java index 327cbe706ad1..28c94cb947d6 100644 --- a/core/src/main/java/hudson/model/RootAction.java +++ b/core/src/main/java/hudson/model/RootAction.java @@ -54,9 +54,12 @@ public interface RootAction extends Action, ExtensionPoint { /** * Identifies if the action is a primary action. * Primary actions may be handled differently in the UI (for example, by always showing on the header rather than in an actions dropdown). - * In almost all cases this should return {@code false} which is the default - * @return {@code true} iff this action should be considered primary. - * @since TODO + * In almost all cases this should return {@code false} which is the default. + * Examples of a Primary action would be where actions would be used regularly or they would need to be prominent to convey some status. + * As concrete example, an action that provides a Help action with a submenu containing various different links, would be a prime candidate for this to return {@code true}. + * If your action has the possibility of a {@link #getBadge() badge} then this is another indicator that the action should return {@code true} (or otherwise restructured). + * @return {@code true} if and only if this action should be considered primary. + * @since 2.516 */ default boolean isPrimaryAction() { return false; From ad44af603ce82ec0cebf33e86a440420bbf1604b Mon Sep 17 00:00:00 2001 From: James Nord Date: Wed, 25 Jun 2025 22:29:24 +0100 Subject: [PATCH 2/2] Update core/src/main/java/hudson/model/RootAction.java --- core/src/main/java/hudson/model/RootAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/RootAction.java b/core/src/main/java/hudson/model/RootAction.java index 28c94cb947d6..51150991d11a 100644 --- a/core/src/main/java/hudson/model/RootAction.java +++ b/core/src/main/java/hudson/model/RootAction.java @@ -56,7 +56,7 @@ public interface RootAction extends Action, ExtensionPoint { * Primary actions may be handled differently in the UI (for example, by always showing on the header rather than in an actions dropdown). * In almost all cases this should return {@code false} which is the default. * Examples of a Primary action would be where actions would be used regularly or they would need to be prominent to convey some status. - * As concrete example, an action that provides a Help action with a submenu containing various different links, would be a prime candidate for this to return {@code true}. + * As a concrete example, an action that provides a Help action with a submenu containing various different links, would be a prime candidate for this to return {@code true}. * If your action has the possibility of a {@link #getBadge() badge} then this is another indicator that the action should return {@code true} (or otherwise restructured). * @return {@code true} if and only if this action should be considered primary. * @since 2.516