+debug = require('debug')('sidebar:controller')
 kd = require 'kd'
 EnvironmentFlux = require 'app/flux/environment'
 remote = require 'app/remote'



  setVisibility: (type, id, state) ->
    fetchVisibility()
      .then (filters) =>
        filters[type][id] = state
        return filters



    new Promise (resolve) ->
      appStorageController.storage('Sidebar')

      stacks: {}
      drafts: {}

    @managed = {}

    @bindNotificationHandlers()
    @setStateFromStorage()
