Closed Bug 453221 Opened 17 years ago Closed 17 years ago

Autocomplete popup should have site favicons

Categories

(Camino Graveyard :: Location Bar & Autocomplete, enhancement)

All
macOS
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Camino2.0

People

(Reporter: chris, Assigned: chris)

Details

Attachments

(1 file, 5 obsolete files)

Most websites have distinctive favicons, which makes searching for them in lists easier. The autocomplete popup currently has generic favicons beside each result. STR: 1. Focus location bar 2. Begin typing in search query with >1 results EB: List of sites from the history, with their respective favicons CB: List of sites from the history, with generic site icons
Thanks for looking into this. I honestly never really noticed it, but this'll be really nice to have.
Hardware: Macintosh → All
Attached patch Fix v1.0 (obsolete) — Splinter Review
Patch to add favicons to the popup list. Grabs favicons from the SiteIconProvider. Provides generic website and file icons if there is no cached favicon. Main thing to look at would be performance issues.
Comment on attachment 336428 [details] [diff] [review] Fix v1.0 This basically got an r- on IRC, so I'm going to mark it obsolete pending a new patch.
Attachment #336428 - Attachment is obsolete: true
Attached patch Fix v1.1 (obsolete) — Splinter Review
Fixes problem discussed on IRC. We now return an icon every time, if we are in the icon column. Apparently the ternary operator requires the same type on each side of the colon, hence the casts.
Attachment #336462 - Flags: review?(cl-bugs-new)
Comment on attachment 336462 [details] [diff] [review] Fix v1.1 >Index: camino/src/browser/AutoCompleteDataSource.mm >=================================================================== >+ NSImage* cachedFavicon =[[SiteIconProvider sharedFavoriteIconProvider] favoriteIconForPage:result]; Nit: space after =. (I assume this was just a typo, as you did it everywhere else.) General comment on performance: this doesn't seem to noticeably slow things down, but we should probably keep an eye out just the same. It does seem a little strange to have a drop-down full of a mix of favicons and generic globe icons, though. Presumably, this is because a large number of sites in my history (I keep a year of history) have had their icons expire from the cache (see bug 346061, which will likely solve this problem). Our default for history is nine days, and I sort of doubt we have a lot of users who keep more than about a month of history. There are only 10 users on the cc list for that bug, and only two votes for it, so it's not like there's great demand for that fix. All of which is a really long-winded way of saying that I think while it's not perfect, the behaviour here is better than without the patch, and we should get better behaviour for free once the other bug is fixed. r=me with the nit fixed. Tagging Stuart for sr since pink has a bunch of stuff on his plate. cl
Attachment #336462 - Flags: superreview?(stuart.morgan+bugzilla)
Attachment #336462 - Flags: review?(cl-bugs-new)
Attachment #336462 - Flags: review+
Comment on attachment 336462 [details] [diff] [review] Fix v1.1 Rather than repeat the early-return ternary, and have the return path in the main body be completely different for the icon column vs the others, make result an |id| initialized with the appropriate type via ternary and handle the return for the icon the same way the existing code does. The votes/cc on the icon bug don't really reflect how often we heard about that issue via other channels, but I'm still fine with landing this now. As for perf, I'm pretty sure that the table view is smart enough not to ask for rows that aren't visible yet, so I wouldn't expect a problem.
Attachment #336462 - Flags: superreview?(stuart.morgan+bugzilla) → superreview-
Attached patch Fix v1.2 (obsolete) — Splinter Review
New patch with changes per comment 6. Method now gets icons for every local file, not just those in the cache. The SiteIconCache does not cache local file icons to disk; there might be a case for changing its code to achieve what this patch does. Since we now check first if the URL is local, there doesn't seem to be any performance loss. Requesting another review, as these changes introduce new issues.
Attachment #336462 - Attachment is obsolete: true
Attachment #336813 - Flags: review?(cl-bugs-new)
Attached patch Fix v1.3 (obsolete) — Splinter Review
Found Bug 414272, which is related to this bug. Removed the local file favicon handling from the previous patch, in favour of fixing the other bug. Sending the patch back to review, but will check on IRC whether it can be sent straight to sr.
Attachment #336813 - Attachment is obsolete: true
Attachment #336821 - Flags: review?(cl-bugs-new)
Attachment #336813 - Flags: review?(cl-bugs-new)
Attached patch Fix v1.4 (obsolete) — Splinter Review
Fixed a typo that crept back in from an earlier version. Comments on the previous patch still apply.
Attachment #336821 - Attachment is obsolete: true
Attachment #336825 - Flags: review?(cl-bugs-new)
Attachment #336821 - Flags: review?(cl-bugs-new)
Attachment #336825 - Flags: review?(cl-bugs-new) → superreview+
Comment on attachment 336825 [details] [diff] [review] Fix v1.4 Sorry, a couple more small things I should have caught before. > NSImage* mIconImage; // owned >+ NSImage* mFileImage; // owned mIconImage is now a confusing name; let's change it to mGenericSiteIcon everywhere (and your new one mGenericFileIcon). >+ nsCAutoString value; >+ item->GetURL(value); >+ NSString* valueString = [NSString stringWith_nsACString:value]; This isn't the value, so call the variables something URL related (url and urlString are fine, to be consistent with the other code). >+ } else { >+ if ([urlString hasPrefix:@"file://"]) >+ result = mFileImage; >+ } else if (...) { sr=smorgan with those changes, since they are trivial. If you could spin a patch with those changes, just mark it sr+ when you post it.
Attached patch Final FixSplinter Review
Adds fixes from comment 10.
Attachment #336825 - Attachment is obsolete: true
Attachment #336917 - Flags: superreview+
Landed on CVS trunk.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: