Closed Bug 302601 Opened 19 years ago Closed 18 years ago

top ten list should exclude the bookmarks manager page (about:bookmarks) and history (about:history)

Categories

(Camino Graveyard :: Bookmarks, defect)

PowerPC
macOS
defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED
Camino1.5

People

(Reporter: terpstra, Assigned: froodian)

References

Details

(Keywords: fixed1.8.1)

Attachments

(1 file, 4 obsolete files)

User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b4) Gecko/20050728 Camino/0.9a2+ Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b4) Gecko/20050728 Camino/0.9a2+ If you have a bookmark to about:bookmarks (for example, so that you can open the manager from the bookmarks toolbar), and frequently use the bookmark manager, it may show up in the "Top Ten" list. However, this doesn't seem to be a very good use of 1/10th of the Top Ten list :) Really, the problem is the requirement of making a bookmark to the bookmarks manager in order to get a button for the manager on the toolbar... Perhaps the best way to solve this problem would be to provide a preference item (ala Safari) for this functionality. Reproducible: Always Steps to Reproduce: 1. Create a bookmark for about:bookmarks 2. Open and close the bookmarks manager several times in order to increment the bookmark's visit count (using the toolbar button and cmd-shift-h works well for this) 3. Open the bookmarks manager one last time and look at the bookmarks included in the "Top Ten List" group. Actual Results: The bookmark for about:bookmarks appears in the "Top Ten List" bookmark group. Expected Results: Ignore visits to about:bookmarks (and possibly other about: pages as well?).
(In reply to comment #0) > Expected Results: > Ignore visits to about:bookmarks (and possibly other about: pages as well?). Makes sense. Putting on the 1.1 list for investigation.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Target Milestone: --- → Camino1.1
Trying something new while awaiting for download patch reviews... Taking...
Assignee: pinkerton → nick.kreeger
While we're at it, it should exclude about:history, too.
Why not all about: pages?
(In reply to comment #4) > Why not all about: pages? about:plugins and the like /should/ show up on the list if they are accessed enough, since they're definately end-points. The history and bookmarks pages, on the other hand, are usually only visited in order to reach another page ("non-end-points"). This reasoning however suggests that other "non-end-point" pages shouldn't be on the list either (portal pages and the like)... Perhaps there should simply be an "exclude this page from Top 10" option for bookmarks?
*** Bug 312127 has been marked as a duplicate of this bug. ***
Tweaking summary, hopefully to catch dupes like bug 312127. cl
Summary: top ten list should exclude the bookmarks manager page (about:bookmarks) → top ten list should exclude the bookmarks manager page (about:bookmarks) and history (about:history)
Attached patch Patch (obsolete) — Splinter Review
Hope I'm not stepping on your toes here Nick. Since it was NEW and not ASSI, I figured I'd risk it. This patch disables the visit count for about:bookmarks, about:history, and about:config. about:blank takes care of itself. Stuart (or anybody else), are there any other about: urls we should be disabling here? about:plugins is sort of on the line as far as I'm concerned.
Assignee: nick.kreeger → stridey
Status: NEW → ASSIGNED
Attachment #224493 - Flags: review?(bugzilla)
FWIW, and I don't think I was helping with QA when this was filed, I think this is a WONTFIX. The Top Ten list should not be excluding ANY page for which a valid bookmark has been created. The fix for this is not to bookmark about:bookmarks (or about:history) if you don't want it showing up in your Top Ten. Why anyone would be bookmarking about: URLs is beyond me, but I think we should let those folks use said bookmarks just like any other bookmark. (I think a better discussion would be of the topic "should we let people bookmark about: URLs in the first place?", but that's just me.) If we really do want this, though, the cautions/discussion in bug 159337 would apply here too. cl
(In reply to comment #9) > Why anyone would be bookmarking about: URLs is beyond me, but I think we should > let those folks use said bookmarks just like any other bookmark. (I think a > better discussion would be of the topic "should we let people bookmark about: > URLs in the first place?", but that's just me.) Are you crazy? I mean... really. People bookmark about:bookmarks and about:history all the time and use them on their bookmark toolbar with no title. It's a quick way to access them without cluttering the toolbar. And because they bookmark those, why not allow them to bookmark other about: URIs? I might bookmark about:blank so I can quickly hide that NSFW website while at work. Who knows? But we shouldn't disallow it, in my opinion.
Comment on attachment 224493 [details] [diff] [review] Patch + if(![loadURL isEqual:@"about:bookmarks"] && + ![loadURL isEqual:@"about:history"] && + ![loadURL isEqual:@"about:config"]) { + NSEnumerator* bookmarksEnum = [BookmarkManager enumeratorForBookmarksInMap:mBookmarkURLMap matchingURL:loadURL]; + Bookmark* curBookmark; + while ((curBookmark = [bookmarksEnum nextObject])) + { + [curBookmark notePageLoadedWithSuccess:successfullLoad]; + } Please be consitent on your curly brace placements. Since the while loop has them on the next new line, do the same on the if statement.
Attachment #224493 - Flags: review?(bugzilla) → review-
Also, I don't think we want to block notePageLoadedWithSuccess: for these bookmarks; that code might want to do other things in future. You could check for the special URLs inside of notePageLoadedWithSuccess:, or you could set a flag on a bookmark if it is for one of those urls and don't change visit counts. Or you could change the code that builds the top 10 list to ignore bookmarks with those urls.
(In reply to comment #12) > Or you could change the code that builds the top 10 list to ignore > bookmarks with those urls. I like this approach. It doesn't mess with the visit counts, and if we have people crazy enough to bookmark about:config, we probably have people crazy enough to care how many times they've visited it. cl
(In reply to comment #12) > Or you could change the code that builds the top 10 list to ignore > bookmarks with those urls. While we're at it, are there other URI prefixes/protocols we should ignore if they're bookmarked when building the top 10 list? It's possible to create bookmarks to aim:, file:, etc. Do we really want to put stuff in the top 10 that Camino doesn't even *handle*? We should check the protocol against our internal (from Gecko) list of what we know how to handle, and if we don't find it on that list, we shouldn't add it to the top 10. We should also exclude purely "internal" URIs, like about:. I haven't really decided whether file: URIs make sense in the top 10 or not. I tend to think not. There may be others I haven't thought of, too. cl
This 1. excludes all about: URIs (per IRC) 2. excludes file: URIs 3. excludes all external URIs primarily using code by cl from bug 325839. I tested it out, and it works on things like irc:// aim:// too. 4. removes a bizarre comment that didn't seem to directly apply to the following lines of code.
Attachment #224493 - Attachment is obsolete: true
Attachment #224636 - Flags: review?
Attachment #224636 - Flags: review? → review?(bugzilla)
Comment on attachment 224636 [details] [diff] [review] Excludes about: and external protocols >Index: bookmarks/KindaSmartFolderManager.mm >=================================================================== >RCS file: /cvsroot/mozilla/camino/src/bookmarks/KindaSmartFolderManager.mm,v >retrieving revision 1.13 >diff -u -8 -p -r1.13 KindaSmartFolderManager.mm >--- bookmarks/KindaSmartFolderManager.mm 2 Jun 2006 18:11:17 -0000 1.13 >+++ bookmarks/KindaSmartFolderManager.mm 7 Jun 2006 00:22:18 -0000 >@@ -172,26 +182,28 @@ const unsigned kNumTop10Items = 10; // > { > // just resort > [mTop10Folder sortChildrenUsingSelector:@selector(compareForTop10:sortDescending:) > reverseSort:YES > sortDeep:NO > undoable:NO]; > } > } >- else if (visitCount >= currentMinVisits) >+ else if (visitCount >= currentMinVisits && >+ ![newItemScheme isEqual:@"about"] && >+ ![newItemScheme isEqual:@"file"] && >+ GeckoUtils::isProtocolValid(newItemSchemeAsCString)) r=me with a comment inserted above the new if statement describing why we want to check for those criteria. cl
Attachment #224636 - Flags: review?(bugzilla) → review+
I'm a little concerned about the performance impact of this. checkForNewTop10: is called on every url load if you have a bookmark for that url. With 3MB of bookmarks, that gets expensive fast.
(In reply to comment #17) > I'm a little concerned about the performance impact of this. checkForNewTop10: > is called on every url load if you have a bookmark for that url. With 3MB of > bookmarks, that gets expensive fast. Ian, the canonical sample file for this is in bug bug 236373.
QA Contact: bookmarks
Using the 3.1 MB bookmarks.plist, launch times seemed comparable within 5 seconds when it had to rebuild the top 10 list, and the same when it didn't (duh). I couldn't tell the difference in page load times using a second-hand timer. If you want more accurate/delicate performance testing, I'm happy to do it, but will need some pointers.
(In reply to comment #19) > Using the 3.1 MB bookmarks.plist, launch times seemed comparable within 5 > seconds when it had to rebuild the top 10 list For clarification, launch times were >30 seconds for me in these cases (with or without the patch).
Attachment #224636 - Flags: review?(smorgan)
Comment on attachment 224636 [details] [diff] [review] Excludes about: and external protocols Fixing review requestee.
Attachment #224636 - Flags: review?(smorgan) → review?(stuart.morgan)
Comment on attachment 224636 [details] [diff] [review] Excludes about: and external protocols The issue here isn't startup time, it's impact on pageload. Given that the work should only be done when a page would in fact become a new top-ten item though, I would think the performance impact of this approach should be negligible, and not really affected much by the size of the bookmarks file. That said, this implementation does extra work on *every* pageload, rather than delaying it until it's actually necessary. >+ NSString* newItemURL = [aBookmark url]; >+ NSRange delimiter = [newItemURL rangeOfString:@":"]; >+ NSString* newItemScheme = @""; >+ >+ if (delimiter.location == NSNotFound) >+ newItemScheme = @"file"; // implicitly file:// if no delimiter is found >+ else >+ newItemScheme = [newItemURL substringToIndex:delimiter.location]; >+ const char* newItemSchemeAsCString = [newItemScheme UTF8String]; None of this should be done until the inside of the |else if (visitCount >= currentMinVisits)| block, otherwise there is a string scan being done on every URL loaded, when it's only needed a small fraction of the time. At a more general level: - Why is file: excluded? If I have a local page that I bookmark and visit frequently, I don't see why it shouldn't show up. - Why even go to the trouble of dealing with schemes that aren't handled? They will have a visit count of at most 1 (and if the creation logic for bookmarks is ever improved, 0), so it's incredibly fringe that any of them would show up in the top 10 anyway. Basically, I think about: is the only thing worth actually considering here.
Attachment #224636 - Flags: review?(stuart.morgan) → review-
Addresses all of smorgan's comments. On further thought, it makes sense to let files into the top ten list, and there's no way external protocol would ever make it there anyway, so this just excludes about:URIs
Attachment #224636 - Attachment is obsolete: true
Attachment #227026 - Flags: review?(stuart.morgan)
Comment on attachment 227026 [details] [diff] [review] Disables about:URIs and improves performance >+ NSRange delimiter = [newItemURL rangeOfString:@":"]; I don't like the name |delimiter| here; ':' is the delimiter, not the NSRange. Maybe |firstColon|? >+ NSString* newItemScheme = [newItemURL substringToIndex:delimiter.location]; //If not found, it's a file, and we don't care If there's no ':', delimeter.location is NSNotFound, which is not safe to feed to substringToIndex: Also, rather than the inline comment I think a comment preceding the whole block to the effect of "if it's an 'about:' bookmark, ignore it" would be better to make it clear what the point of the code is. >+ if(![newItemScheme isEqual:@"about"]) Since all the other "nothing to be done" cases in this function do an early return, do that instead of the if. So the logic becomes: firstColon = foo if (firstColon is found && the scheme is about) return
Attachment #227026 - Flags: review?(stuart.morgan) → review-
Attached patch Sylistic changes and null check (obsolete) — Splinter Review
Attachment #227026 - Attachment is obsolete: true
Attachment #227195 - Flags: review?(stuart.morgan)
Comment on attachment 227195 [details] [diff] [review] Sylistic changes and null check >+ NSRange firstColon = [newItemURL rangeOfString:@":"]; >+ if(firstColon.location && [[newItemURL substringToIndex:firstColon.location] isEqual:@"about"]) NSNotFound isn't null--0 is a perfectly legitimate index to find something. You need to be checking to make sure it's not NSNotFound.
Attachment #227195 - Flags: review?(stuart.morgan) → review-
Ah, I see. Sorry for misunderstanding your previous comment.
Attachment #227195 - Attachment is obsolete: true
Attachment #227257 - Flags: review?(stuart.morgan)
Comment on attachment 227257 [details] [diff] [review] Properly checks for NSNotFound r=me
Attachment #227257 - Flags: superreview?
Attachment #227257 - Flags: review?(stuart.morgan)
Attachment #227257 - Flags: review+
Comment on attachment 227257 [details] [diff] [review] Properly checks for NSNotFound Simon, are you still worried about perf here? Now that I know a little more about NSDate I can do some more careful testing, but since all the code is only called now when a bookmark has enough visit counts to get bumped onto the top ten list, I'm not sure it's an issue.
Attachment #227257 - Flags: superreview? → superreview?(sfraser_bugs)
Attachment #227257 - Flags: superreview?(sfraser_bugs) → superreview?(mikepinkerton)
Comment on attachment 227257 [details] [diff] [review] Properly checks for NSNotFound sr=pink
Attachment #227257 - Flags: superreview?(mikepinkerton) → superreview+
Whiteboard: [needs checkin]
Fixed trunk and branch.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Whiteboard: [needs checkin]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: