     _isLive yes
 
   items: _items
+  hasItems: _hasItems
+  predicateCaption: _predicateCaption
+  clearPredicate: clearPredicate
+  canClearPredicate: _canClearPredicate
   template: 'model-list-view'
 

      isSelected: node$ no

    apply$ _isLive, self.isSelected, (isLive, isSelected) ->
      _.modelSelectionChanged isSelected, _predicate, model if isLive
    self

  displayModels = (models) ->
    _items items = map models, createItem
    activateItem head items unless isEmpty items

  _predicate = null
  loadModels = (predicate) ->
    console.assert isDefined predicate
    _predicate = predicate
    switch predicate.type
      when 'all'
        _.requestModels (error, data) ->

Steam.ModelListView = (_) ->
  _predicate = node$ type: 'all'
  _items = do nodes$
  _hasItems = lift$ _items, (items) -> items.length > 0

  _canClearPredicate = lift$ _predicate, (predicate) -> predicate.type isnt 'all'
  _predicateCaption = lift$ _predicate, (predicate) ->
    switch predicate.type
      when 'all'
        'Showing\nall models'
      when 'compatibleWithFrame'
        "Showing models compatible with\n#{predicate.frameKey}"
      else
        ''

  #TODO ugly
  _isLive = node$ yes
