amyworrall/QuickRadar — pull request #22 by DrummerB (2012-08-21 22:28:39+00:00)
Title: Automatically fill in version number and category.

Since the main goal of QuickRadar is to simplify and streamline the process of submitting bugs, I thought why not make it help you fill out the form for you?

One of the things you always have to fill in is the version of the app you're reporting a bug for. I implemented a function that lists the recently used (Apple) apps in a popover. You bring it up by clicking a small icon in the version text field. Then you just have to select one from the list to fill in version and build numbers. No more hunting and copy pasting :-)

![Screenshot](http://i.imgur.com/Lp0XO.png)

Apple also [recommends](https://developer.apple.com/bugreporter/bugbestpractices.html#BugBody) to include the version number in the title, so that's done too. But the text is also selected automatically so it can be overridden with no additional effort.

In addition, it will try to guess the correct Product Category for the selected app. For Xcode it will select Developer Tools, for Pages it will be iWork, etc. I've done this by collecting a list of bundle IDs for most of the Apple apps and order them by Category. This list is stored in ProductCategories.plist and might have to be updated or expanded in future. However I think the IDs shouldn't change that much (Messages is still com.apple.iChat for instance). I couldn't find out the IDs for the Pro apps, because I don't have them.

It will also search for recent crash reports. If any of the listed apps crashed in the last 15 minutes, it will be indicated with a small badge. Selecting one of these apps will select Crash from the Classification list. This could be easily expanded in future (when file uploads work) to automatically select the latest crash report to be uploaded and/or show a list with the crash reports for that app.

I also added a little animation when a submission was successful. The window will fly from the window, just like in Mail.app. I think this brings a tiny amount of fun and satisfaction into bug reporting :-) It could fly off the screen immediately, when you press Submit (like in Mail) and the submission could happen in the background. If an error occurs, the window would come back. But for now, it just goes away on success.

Finally, I'd like to throw in some additional ideas:

* A second global hotkey that will open a new window and automatically select the currently active app. So if you discover a bug in Xcode for instance, you just press this hotkey and the Product Category and Version fields are already set up for you. When it's Xcode, it could offer to zip and attach the current project as a sample (together with the build log, derived data and any crash logs)
* I don't know if this is possible, but if QuickRadar could detect that the selected app hangs/freezes, it could offer to run a (Shark) sample and attach it to the report.
* For bug reports about Xcode, Apple [requests](https://developer.apple.com/bugreporter/bugbestpractices.html#Xcode) some additional information and resources. These could also be automated as good as possible:
* Mac OS X version.
* The output of `gcc -v`, `gdb -v` or `clang -v` should be added to the message text view.