Skip to content

Instantly share code, notes, and snippets.

@grokys
Created July 31, 2017 09:44
Show Gist options
  • Select an option

  • Save grokys/818e1b8c6e7b7315796cab632e86316c to your computer and use it in GitHub Desktop.

Select an option

Save grokys/818e1b8c6e7b7315796cab632e86316c to your computer and use it in GitHub Desktop.

Problems with current editor margin

  1. Hard to differentiate between VS' margin and our margin - clicking on wrong one to add breakpoints etc
  2. Hard to see comment glyph on colored line in margin
  3. Confusing when comments show up in editor because you're on a PR branch and you don't know why

Thoughts on 1 and 2

Other tools such as ncrunch add a margin to editors and this margin doesn't cause a problem because it has the same background color as the editor.

Solution: make the editor margin the same color as the editor

Problem: we want to show in the margin whether lines have been added or not

Solution: not really that useful IMHO - we should remove the coloring from the lines in the margin. Seeing whether lines have been added is something you want to know when reviewing a PR, and the diff view is best for this as you also want to see deleted lines. Comments in the editor margin are useful when you're addressing PR feedback, in which case whether the line has been added is not of much interest.

Problem: we still need to indicate lines that cannot be commented on

Solutiion: use GraphQL; any line can be commented on

Problem : hard to see colored glyphs

Solution: no more colored glyphs

Thoughts on 3

By addressing 1 and 2, most of the visual distraction will have been removed. There will be 2 differences that remain:

  1. Existing comments will show up. IMHO this is a feature rather than a problem, it's useful to know that there is a comment here
  2. The "Add comment" button will show up when hovering over the margin. This may be useful for people who e.g. like to comment on their own PRs. It shouldn't provide too much distraction as it only shows up when hovering over our margin

Alternatives:

Review mode

We have a "Start a review" button as in .com which puts us into review mode. This is something we were planning to address in a subsequent version. If we did this there are some things to consider:

  • How would this work for someone addressing PR feedback? They wouldn't be starting a review
  • Adding a single comment outside the review would be disallowed
  • How would this work with the "I want to add a comment to my own PR" scenario?

Only show comments after a user has opened the PR in the GitHub pane

This was originally how it worked, but people (@donokuda and maybe @paladique?) asked me "I'm on my PR branch but comments aren't showing up - how do I get them to appear". Personally I understand their confusion - I'm on a PR branch, you should be showing me my comments.

Conclusion

IMHO if we made the comments margin less intrusive, we could show existing comments whenever we're on a PR branch and it wouldn't be distracting.#

For this to work though we'd need to move to GraphQL - before moving to GraphQL we'd need the crosshatched margin (or something similar). What would we do in this case for enterprise installations, which won't get the GraphQL APIs for maybe a year?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment