Closed Bug 155502 Opened 22 years ago Closed 20 years ago

Bugzilla search / query should focus summary field

Categories

(Bugzilla :: Query/Bug List, enhancement)

2.17
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: tpowellmoz, Assigned: kiko)

Details

Attachments

(1 file, 2 obsolete files)

When you go to the search form, no field has focus. The summary field should
have focus by default, so you can immediately start typing, just like on the
index page with quicksearch and most search engines.

This is easily accomplished with a line of javascript:

<script language="JavaScript">
<!--
document.forms['queryform'].short_desc.focus()
// -->
</script>

One place to add this is on line 30 of
bugzilla/template/en/default/search/search.html.tmpl
Change:
 onload = "selectProduct(document.forms['queryform']);"
to
 onload = "selectProduct(document.forms['queryform']);
document.forms['queryform'].short_desc.focus()"

Although this is a minor change, it will save time for all users.
Target Milestone: --- → Bugzilla 2.18
Assignee: endico → nobody
These bugs appear to be abandoned.  Retargeting to 2.20
Target Milestone: Bugzilla 2.18 → Bugzilla 2.20
Trivial. Patch coming up.
Assignee: nobody → kiko
Target Milestone: Bugzilla 2.20 → Bugzilla 2.18
Tested and works. Shouldn't be any cross-browser issues -- it's the same DOM
access we use for the form selection JS.
Attachment #144226 - Flags: review?(myk)
This is not necessarily a good thing, for the following reason: if a page takes
a couple of seconds to load (as our query page does, being very big), and you've
already clicked somewhere and started typing, the focus gets stolen from you,
which is really irritating. Can we detect whether that has happened before
calling focus()?

(For something like www.google.com, which is tiny, it's fine.)

Gerv
Comment on attachment 144226 [details] [diff] [review]
kiko_v1: add focus() call to onLoad handler. 


Gerv has a point; this is even painful on Google sometimes.  Can we do this
right after displaying the summary field rather than after the page has been
loaded?
Attachment #144226 - Flags: review?(myk)
With the advent of the new fulltext search, I'm usually using that when I need
to do a "quick" query on something easy.  When I go to the Advanced Query page,
I typically want to do something advanced, and most of the time it's somewhere
below the top screen of the page.  First thing I generally do when the query
page loads is hit the space bar to page down.  That gets broken if the summary
field focuses.

That said, I'd be all for focusing the "enter some words" field on the fulltext
search page, since the entire page (mostly) fits in the browser window, and the
fulltext search will be the default search page when 2.18 ships.
So what do I do now?
Severity: minor → enhancement
Another alternative is using inline script to focus the search form, which would
be invoked early (and not late as onLoad is). It could even be placed right
after rendering the search box (which is parsed early) to ensure nothing else
could have been focused (unless in the reload case).

How does that sound?
Inline script sounds like a good idea.

Gerv
Attached patch kiko_v2: inline script (obsolete) — Splinter Review
Glad you liked it.
Attachment #144226 - Attachment is obsolete: true
This is less broken, and does it for both pages.
Attachment #146128 - Attachment is obsolete: true
Comment on attachment 146132 [details] [diff] [review]
kiko_v3: less braindead version for both specific and "regular" query

Low-risk and a nice usability touch.
Attachment #146132 - Flags: review?(gerv)
Comment on attachment 146132 [details] [diff] [review]
kiko_v3: less braindead version for both specific and "regular" query

r=gerv.

Gerv
Attachment #146132 - Flags: review?(gerv) → review+
Flags: approval?
I still have my reservations on doing this on the advanced query page, but I
suppose we can back it out later if we get a lot of complaints.
Flags: approval? → approval+
checked in for kiko, since he's off wandering Europe somewhere. :)

Checking in template/en/default/search/form.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/search/form.html.tmpl,v 
<--  form.html.tmpl
new revision: 1.23; previous revision: 1.22
done
Checking in template/en/default/search/search-specific.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/search/search-specific.html.tmpl,v
 <--  search-specific.html.tmpl
new revision: 1.6; previous revision: 1.5
done
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: