            bit & codes.WT_TYPECHANGE
 
   renderChanges: ->
-    change.classList.add('old') for change in @querySelectorAll('.change')
-
     @changes.getStatuses().then (statuses) =>
+      @stagedChangesNode.innerHTML = ''
+      @unstagedChangesNode.innerHTML = ''
+
       statuses.forEach (status) =>
         if @changeIsUnstaged(status)
           @renderChangeSummary(status, 'unstaged')

        if @changeIsStaged(status)
          @renderChangeSummary(status, 'staged')

      change.remove() for change in @querySelectorAll('.change.old')

      unstagedCount = @querySelectorAll('.unstaged .change').length
      stagedCount = @querySelectorAll('.staged .change').length

      @updateColumnHeader(unstagedCount, 'unstaged')
      @updateColumnHeader(stagedCount, 'staged')

      @unstagedChangesNode.firstElementChild?.click()
      @unstagedChangesNode.focus()

  renderChangeSummary: (change, state) =>
    if existingChange = @querySelector(".change[data-path='#{change.path()}'][data-state='#{state}']")
      existingChange.classList.remove('old')
    else
      changeNode = TemplateHelper.renderTemplate(@changeTemplate)
      changeNode.querySelector('.path').textContent = change.path()
      changeNode.firstElementChild.dataset['path'] = change.path()
      changeNode.firstElementChild.dataset['state'] = state
      changeNode.querySelector('button').textContent = if state == 'unstaged' then 'Stage' else 'Unstage'
      node = if state == 'staged' then @stagedChangesNode else @unstagedChangesNode
      node.appendChild(changeNode)

  renderChangeDetail: (path, state) ->
    diffsNode = @diffsNode


BaseTemplate = """
  <div class="data" tabindex="-1">
    <div class="unstaged column-header">
      Unstaged changes
      <button class="btn btn-xs">Stage all</button>
    </div>
    <div class="unstaged files"></div>
    <div class="staged column-header">
      Staged changes
      <button class="btn btn-xs">Unstage all</button>
    </div>
    <div class="staged files"></div>
    <div class="staged column-header">Commit message</div>
    <div class="commit-message-box">
      <atom-text-editor class="commit-description" data-placeholder="Enter the commit message describing your changes." style="height: 120px"></atom-text-editor>
<button class="btn btn-commit">Commit</button>
    </div>
  </div>
  <div class="diffs"></div>
