Toggling comments in diff view to see "resolved" discussions is unintuitive

Currently, if you have a discussion that is marked as "resolved", it will be hidden by default in the diff view. However, the "toggle comments" button is already depressed, so in order to view the discussion, you need to click the button twice; once to toggle comments "off" and again to toggle them all "on" again.

Screen-Shot-2016-09-28-at-11.00.17-AM
^ There's a resolved discussion in here, but it is invisible despite the state of the "toggle" at the top, and there is no obvious indication that a discussion is there to be un-hidden.

The main problem is that we start with a mixed state in which not all discussions are hidden or visible, so the state of the "show/hide" toggle is arbitrary.

My proposed fix:

  • If there is a mix of hidden/visible discussions in a diff file, or if there are only hidden discussions, start the toggle in the non-active state. The state of the toggle indicates that there are hidden discussions, and making the discussions visible requires only one click.
  • If there are only visible discussions, or if there are no discussions for a given diff file, the button should start in the active state, indicating to the user that all available discussions are already visible.

In addition this toggle is completely hidden in mobile views, making it impossible to see discussions from the diffs page if they are hidden by default. Either we should the responsive css to disregard the hide class in smaller viewports and make all discussions visible, or find a way to add the button to mobile views.