Thunderbird Message Filter Bar Prototype Extension, check it.

What was just the quick-search box in Thunderbird 2 is now also the home to global search in Thunderbird 3.  This hasn’t turned out splendidly, although we didn’t expect that it would.  Some people think quick-search is gone because they do not realize you can change the modes of the search box.  Other people are hardcore and know how to switch between the modes, they just don’t like all the clicking.

So we’re thinking about splitting the quick-search out into its own separate box.  In addition, we’re trying to expose a lot of the power of the “mail views” system.  You may know “mail views” as that boxy thing that lived with the quick-search box above the thread pane in Thunderbird 1.5 but then became something you had to customize onto the toolbar at some point.  It looks like this:

Thunderbird has a very nice search subsystem under the hood that powers quick-search, “advanced search”, virtual folders, etc.  Mail views was and is the mechanism that allowed you to define arbitrary searches and use them as filters on any folder.  Unfortunately it’s not a smooth operator and its defaults have some issues.  There’s no “starred” filter unless you define your own, there’s no “any tag” filter unless you define your own, and “People I Know” only checks one of the two address books you are likely to have in your profile.  Even with those defined, you’re looking at 3 clicks to get to most things.

So the message filter bar is also trying to bring one-click access to these things you might care about.  In the top screenshot, that’s what you’re looking at.  Starred messages, messages from people in any of your local address books, messages with tags, and messages with attachments are all at your fingertips.  The new quick-search location over on the right works right with them.  And if you love mail views and all the clicking-finger muscle strength it helps build, it works with mail views too!

One bit of polish that I’m hoping people like and performs sufficiently well is the tags case.  When you haven’t clicked on the tags icon, the bar in the screenshot does not show that bit with the tags.  When you click on it, it 1) filters the visible messages to messages with tags, and 2) figures out what tags are on those messages and populates that bar with those tags.  You can then click on any of the tags to stop including messages with that tag (and none of the other tags still selected).

In any event, if you are interested, the prototype is being developed as an extension that you can find here on AMO (sandboxed) if you like pre-built XPIs and here in hg if you like source code.  It is very prototype-y at the current moment.  Keybindings aren’t there, localization/accessibility is not there, being able to make the filter bar go away isn’t there, etc.  We will iterate on things and productize assuming the concept works out.  Just be aware that I don’t believe sandboxed plugins auto-update, so you if you’re really interested you might need to keep an eye on the AMO page or the repo.

UPDATE: I have nuked the add-on from AMO since Thunderbird 3.1 beta 2 is now available.

Review Board and Bugzilla reviews, take 3

I’ve updated my review board setup once more (part 2, part 1).  The low barrier to entry is now even lower.  “How low?”, you might ask.  “On the ground!”, I might say.  “What other low low price features with big big value are on offer? With more facts and less spiel?”, you might then also ask…

  • It now works with patches that have a header.  Patches that were the result of an mq import and then directly uploaded will tend to have headers.  This was why sometimes patches would fail to import with unlikely errors about empty patches.
  • There is now a magic URL scheme that automatically pulls the patch, creates a review and bounces you to the review.  If the review already exists, it just directly bounces you.  That URL scheme is http://reviews.visophyte.org/r/bzpatch/bug###/attach###/.  There are no authentication requirements on using this URL nor viewing the diff or associated reviews.  However, if you want to actually use the review mechanism to make comments then you will need to login via OpenID.  See part 2 for more on that.
  • I modified johnath and Ehsan Akhgari’s magic bugzilla jetpack so that it also adds a “Review” link to patches.  My modified repo is here.  You can install it from here.  You can see what the word “Review” looks like up in the first screenshot.
  • I upgraded to the reviewboard git trunk.  This adds some improvements to the diff display such as showing you function context information, even if the patch did not include it.  (And even if it did, too.  A lot of patches involving C++ truncate the function signature, whereas as you can see in the screenshot, you get the full text!)  I believe it is also supposed to be clever about recognizing moved blocks.

Limitations and other notes:

  • Patch fetching is synchronous and can take a while because we also parse it all up before we return.  Do not sit there hitting reload.  We’ll give you an error message if it doesn’t work out.  Not a great one, but an error message nonetheless.
  • Patches are still assumed to be against mozilla-central or comm-central (depending on the bugzilla product) trunk as of the moment we fetch the patch.  This means bit-rotted patches that you are only looking at now may fail to apply.  At the same time, patches where you clicked on the link back when it was timely and go back to look at them now that they are going out of style are still going to be applied against the same revision they were in the first place.
  • The repo with my modified changes (on the bzreview-master branch) was nuked and re-created because of the svn -> git transition by the reviewboard people.  So if you previously pulled, you should probably blow your old repo away rather than end up with a weird hybrid mixture.  (btw, hg-git works very nicely, with the caveat that its bookmark-based representation of the git branching idiom confuses pbranch really quite badly.)
  • Ping me on IRC or drop me an e-mail if you are experiencing reliable problems after having determined that the patch in question is not just full of gibberish.

Using systemtap to figure what your mozilla app’s event loop is up to

====================                                             ms    #
----- Event Loop:
  nsTimerEvent                                                 1233   31
  nsProxyObjectCallInfo                                          19   44
  nsStreamCopierOB                                                1   48
  nsStreamCopierIB                                                0   18
  nsProxyCallCompletedEvent                                       0   44
  nsProxyReleaseEvent                                             0   27
  nsTransportStatusEvent                                          0   19
  nsSocketEvent                                                   0   18
  nsHttpConnectionMgr::nsConnEvent                                0    1
----- Timers:
  OnBiffTimer(...)                                             1129    3
  nsGlobalWindow::TimerCallback(...)                             70   10
  nsAutoSyncManager::TimerCallback(...)                          29    6
  nsExpirationTracker::TimerCallback(...)                         1    1
  nsIdleService::IdleTimerCallback(...)                           0    5
  nsExpirationTracker::TimerCallback(...)                         0    1
  nsHttpHandler                                                   0    1
  nsUITimerCallback                                               0    2
  imgContainer::sDiscardTimerCallback(...)                        0    1
  nsExpirationTracker::TimerCallback(...)                         0    1

That’s one of the periodic outputs (10 seconds currently) of this systemtap script filtered through this python script to translate addresses to useful symbol names in realtime.  It’s like top for mozilla.

Actual invocation looks like so:
sudo stap -v moz-event-loop.stp /path/to/thunderbird/objdir/mozilla/dist/lib/libxpcom_core.so | ../addrsymfilt.py `pgrep thunderbird-bin`

The giant caveat (and giant hooray for utrace and Fedora having kernels with the utrace patches built-in) is that the magic in here is done dynamically using utrace source line probes.  As such, the probes aren’t resilient in the face of changes to the underlying source files; the current line numbers are targeted at 1.9.2.  There are various in-tree and out-of-tree solutions possible.