   handlePackageEvents: ->
     @subscribe @packageManager, 'package-installed theme-installed', ({name}) =>
       if pack = atom.packages.getLoadedPackage(name)
-        @addPanel(name, new InstalledPackageView(pack, @packageManager))
+        title = @getPackageTitle(pack)
+        @addPackagePanel(pack)
+
+        # Move added package menu item to properly sorted location
+        for panelMenuItem in @panelMenu.children('[type=package]')
+          compare = title.localeCompare($(panelMenuItem).text())
+          if compare > 0
+            beforeElement = panelMenuItem
+          else if compare is 0
+            addedPackageElement = panelMenuItem
+
+        if beforeElement? and addedPackageElement?
+          $(addedPackageElement).insertAfter(beforeElement)
 
     @subscribe @packageManager, 'package-uninstalled theme-uninstalled', ({name}) =>
       @removePanel(name)

    version: 2
    activePanelName: @activePanelName

  addPanelMenuSeparator: ->
    @panelMenu.append $$ ->
      @div class: 'panel-menu-separator'

  addPanel: (name, iconName, panel) ->
    if arguments.length is 2
      panel = iconName
      iconName = null

    label = _.undasherize(_.uncamelcase(name))
    panelItem = $$ ->
      @li name: name, =>
        if iconName
          @a class: "icon icon-#{iconName}", label
        else
          @a label

    @panelMenu.append(panelItem)
    panel.hide()
    @panelsByName[name] = panel
    @showPanel(name) if @getPanelCount() is 1 or @panelToShow is name

  getPanelCount: ->
    _.values(@panelsByName).length

  showPanel: (name) ->
    if panel = @panelsByName?[name]

    @openDotAtom.on 'click', ->
      atom.open(pathsToOpen: [atom.getConfigDirPath()])

    @addCorePanel('General Settings', 'settings', new GeneralPanel)
    @addCorePanel('Keybindings', 'keyboard', new KeybindingsPanel)
    @addCorePanel('Packages', 'package', new PackagesPanel(@packageManager))
    @addCorePanel('Themes', 'paintcan', new ThemesPanel(@packageManager))

    packages = atom.packages.getLoadedPackages()
    # Include disabled packages so they can be re-enabled from the UI
