adobe/brackets — pull request #3793 by njx (2013-05-12 22:14:03+00:00)
Title: Implement extension removal story

This implements the following functional changes/additions:
* File > Install Extensions... has been replaced with File > Extension Manager...
* The Extension Manager dialog shows all locally installed dev and user extensions.
* The list of installed extensions can be searched by typing in the search box in the upper right. (This isn't really a requirement for the installed extension list, but it was implemented for the registry list, which is currently turned off, and there didn't seem to be any reason to turn it off.)
* User extensions can be removed by clicking the Remove button.
* The Remove button is grayed out for "dev" extensions, with a tooltip explaining why.
* After removing extensions, closing the dialog will prompt the user to quit Brackets.
* The original Install Extensions dialog is available from the "Install from URL..." button at the bottom left of the Extension Manager dialog.

Notes on the implementation:
* `ExtensionManager` is now responsible for both accessing the remote registry and keeping track of installed extensions. The `extensions` object maps extension ids (or paths for local legacy extensions with no id) to a bundle of info about the associated extension, both info about it from the registry and info from the local installation (which might be different).
* `ExtensionManagerDialog` is the main entry point into the dialog, but it pretty much just creates an `ExtensionManagerView`. (The search box is in the dialog class just because that's where it makes sense to have it in the layout, but it's really hooked up into the view.)
* `ExtensionManagerView` is the main listing. It now has two modes: you can either view the registry (which isn't currently enabled in the build) or the list of locally installed extensions.
* `ExtensionManagerViewModel` keeps track of the current filtered list of extensions in the view, and notifies the view when the status of an extension has changed due to installation or removal. (This model class is separate from the main ExtensionManager since it's really keeping the state of the dialog view--it's not intended to be more generally useful than that.)

I'm still not 100% happy with the refactoring here, since the View class doesn't talk directly to the ExtensionManager for things like data and status changes (those are mediated through the model), but does still talk to ExtensionManager to actually remove extensions. (Also, since installation is still reliant on the old installation dialog, it also talks to that directly rather than going through ExtensionManager for installation.) Suggestions are welcome.