My first project this summer as an intern at Mozilla on the Firefox team was to improve the form history feature. It's a feature that most people use when they fill out forms but don't even realize it. For those of you who don't know what I'm talking about, it's the dropdown of previously submitted text that appears when typing into a form input field. The two main improvements that I have been working on in form history (which are also known as form awesomecomplete) for Firefox 3.6 are detailed below.
For the longest time, the entries in the dropdown were sorted alphabetically, which is fine with a small number of results. When you have many saved entries that match what you've typed, an alphabetical sort doesn't help you find the ones that you are likely to use again, since ones that you use regularly are mixed in with the others you've only used once. To make the order of results more useful and reduce the number of keypresses required to select a previous entry, I have implemented a frecency calculation to rank the results. Frecency is a concept that was introduced in Firefox 3 with the "Awesomebar", Firefox's smart address bar. The term is derived from the combination of frequency and recency whereby the more often or the more recently you’ve used the entry, the higher it ranks. Since the most relevant entries will now be at the top of the list of results, this should reduce the number of keypresses to select the entries that you use most often.
Sometimes when filling out a form or typing search terms in the search bar, you may remember only a portion of the text that you previously submitted and you want to retrieve again. An example of this is when you want to repeat a previous search from the search bar such as one for "location". In the past, only previous entries that started with the text "location" would be displayed, and so you would not see a previous search for "firefox 3.5 geolocation". With my improvements, any text that you previously entered which contains the typed text anywhere in the entry will be displayed. Consider another example: if you don't remember your friend's entire email address when filling out a form but you happen to remember that you filled it out in this form before and they have a Mozilla address. Simply enter "@mozilla" in the text field and all email addresses for that field that contain "@mozilla" (ie. @mozilla.com or @mozilla.org) will be displayed. Bonuses are given to matches that are at the beginning of a word or if they are exact prefix matches (like the previous method) so that irrelevant results that happen to contain the search text shouldn't get in the way of relevant results. This should make finding past entries easier as you don't have to type the exact prefix.For more information on the frecency algorithm used and some preferences to tweak the results, see the wiki page. Feel free to experiment with these features and the associated preferences and file bugs in Toolkit::Form Manager.