     else
         console.log 'unknown viewstate.state', viewstate.state
 
-handle 'update:entity', ->
-    redraw()
-
-handle 'update:conv', ->
-    redraw()
-
-handle 'update:conv_count', ->
-    dockicon viewstate
-    trayicon models
-
-handle 'update:searchedentities', ->
-  redraw()
-
-handle 'update:selectedEntities', ->
-  redraw()
-
-handle 'update:convsettings', -> redraw()
-
+#                 _
+#                | |
+#    _ __ ___  __| |_ __ __ ___      __
+#   | '__/ _ \/ _` | '__/ _` \ \ /\ / /
+#   | | |  __/ (_| | | | (_| |\ V  V /
+#   |_|  \___|\__,_|_|  \__,_| \_/\_/
+#
+# simple redrawing all of yakyak UI
 redraw = ->
     notifications models
     convhead models

    convadd models
    startup models


handle 'update:language', ->
    menu viewstate
    redraw()

throttle = (fn, time=10) ->
    timeout = false
    # return a throttled version of fn

            # update startup with connection information
            redraw()

#          _                   _        _
#         (_)                 | |      | |
#   __   ___  _____      _____| |_ __ _| |_ ___
#   \ \ / / |/ _ \ \ /\ / / __| __/ _` | __/ _ \
#    \ V /| |  __/\ V  V /\__ \ || (_| | ||  __/
#     \_/ |_|\___| \_/\_/ |___/\__\__,_|\__\___|
#
#
handle 'update:viewstate', ->

    setLeftSize = (left) ->
        document.querySelector('.left').style.width = left + 'px'
        document.querySelector('.leftresize').style.left = (left - 2) + 'px'

    setConvMin = (convmin) ->
        if convmin
            document.querySelector('.left').classList.add("minimal")
            document.querySelector('.leftresize').classList.add("minimal")
        else
            document.querySelector('.left').classList.remove("minimal")
            document.querySelector('.leftresize').classList.remove("minimal")

    setLeftSize viewstate.leftSize
    setConvMin viewstate.showConvMin

    # check what in what state is the app
    #
    # STATE_STARTUP : still connecting
    # STATE_NORMAL  : conversation list on left with selected chat showing in main window
    # STATE_ABOUT   : conversation list on the left with about showing in main window
    # STATE_ADD_CONVERSATION : conversation list on the left and new / modify conversation on the main window
    if viewstate.state == viewstate.STATE_STARTUP
        if Array.isArray viewstate.size
            later -> remote.getCurrentWindow().setSize viewstate.size...
