Skip to content
Permalink
Browse files
[JENKINS-47020] - Improve job search experience (#3324)
* Increase search results limit from 20 to 100

Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>

* Enlarge search box size

Increase the max number of results from 10 to 25.
Increase width of results from 25em to 35em
in order to suit longer job names.

This still fits even small 13" screens and improves
user experience.

Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
  • Loading branch information
ssbarnea authored and oleg-nenashev committed Mar 24, 2018
1 parent d5a8487 commit a30ada790779f61faec3f02dcee03ca54e4a472e
@@ -140,7 +140,7 @@ public void doSuggest(StaplerRequest req, StaplerResponse rsp, @QueryParameter S
public SearchResult getSuggestions(StaplerRequest req, String query) {
Set<String> paths = new HashSet<String>(); // paths already added, to control duplicates
SearchResultImpl r = new SearchResultImpl();
int max = req.hasParameter("max") ? Integer.parseInt(req.getParameter("max")) : 20;
int max = req.hasParameter("max") ? Integer.parseInt(req.getParameter("max")) : 100;
SearchableModelObject smo = findClosestSearchableModelObject(req);
for (SuggestedItem i : suggest(makeSuggestIndex(req), query, smo)) {
if(r.size()>=max) {
@@ -48,8 +48,8 @@ THE SOFTWARE.
</j:forEach>
</ol>
<j:if test="${items.hasMoreResults()}">
<j:set var="max" value="${request.hasParameter('max')?request.getParameter('max'):20}"/>
<em>result has been truncated, <a href="?q=${it.encodeQuery(q)}&amp;max=${max+20}">see 20 more</a></em>
<j:set var="max" value="${request.hasParameter('max')?request.getParameter('max'):100}"/>
<em>result has been truncated, <a href="?q=${it.encodeQuery(q)}&amp;max=${max+100}">see 100 more</a></em>
</j:if>
</j:otherwise>
</j:choose>
@@ -1493,7 +1493,7 @@ DIV.yahooTree td {

#search-box-completion .yui-ac-content {
border: 1px solid black;
width:25em;
width:35em;
background-color: white;
overflow: hidden;
}
@@ -2373,6 +2373,7 @@ function createSearchBox(searchURL) {
ac.typeAhead = false;
ac.autoHighlight = false;
ac.formatResult = ac.formatEscapedResult;
ac.maxResultsDisplayed = 25;

var box = $("search-box");
var sizer = $("search-box-sizer");

0 comments on commit a30ada7

Please sign in to comment.