             position    : position
             last_edited : new Date() - 0
 
-        @tasks.unshift(task)
-        @_visible_tasks.unshift(task)
         task_id = uuid()
         @db.update(set:task, where:{task_id : task_id})
         task.task_id = task_id
-        @render_task(task, true)
+        @tasks.push(task)
+
+        @render_task_list()
+        @set_current_task(task)
         @edit_desc(task)
         @set_dirty()
+
+    set_current_task_by_id: (task_id) =>
+        @current_task = @get_task_by_id(task_id)
 
     init_create_task: () =>
         @element.find("a[href=#create-task]").click (event) =>

    create_task: () =>
        if @readonly
            return
        p = 0
        for t in @tasks
            if t.position < p
                p = t.position
        position = p - 1

        desc = @selected_hashtags().join(' ')
        if desc.length > 0

            task.element.addClass("salvus-current-task")
            task.element.scrollintoview()

    get_current_task_index: () =>
        if not @current_task?
            return
        for i in [0...@tasks.length]  # TODO: could maintain a map
            if @tasks[i].task_id == @current_task.task_id
                return i

    get_current_task_visible_index: () =>
        if not @current_task?
            return
