node-gh / gh

(DEPRECATED) GitHub CLI made with NodeJS. Use the official https://cli.github.com/ instead.
http://nodegh.io
Other
1.71k stars 217 forks source link

Print labels in headlines for pull requests #611

Closed gamerson closed 5 years ago

protoEvangelion commented 5 years ago

Takin a look now. Thanks @gamerson!

protoEvangelion commented 5 years ago

@gamerson Looks like you are not the only one who wants to improve PR listing 😄

This open PR will create a beautiful new table view:

image

For listing in the simple view via gh pr, I can't think of a good way to print out labels given that they may need to wrap text unless we add a new column.

Given that we are tight for space width wise the best alternative would be to add labels somewhere on gh pr --detailed.

We could add a new divider under author:

image

What do you think?

hamxabaig commented 5 years ago

Yes adding a new column would make things a bit difficult layout wise. We could add the labels in the title column with a line break or we could do it in --detailed tag

protoEvangelion commented 5 years ago

I really like how clean the non-detailed view looks with each PR being on its own line. In the detailed view, do you think labels best belong in the "Details" column or do you think it would look better as another cell below author or status?

gamerson commented 5 years ago

Thanks for the update. I understand your concern about a large number of labels causing the text to wrap. But you already have that same problem if the title text is very long right? To handle all potential wrapping problems for any field in the line of text, perhaps for long fields like title or labels you could do print an ellipse instead of the the entire text?

On Fri, Jan 4, 2019 at 8:03 PM Ryan Garant notifications@github.com wrote:

@gamerson https://github.com/gamerson Looks like you are not the only one who wants to improve PR listing 😄

This open PR https://github.com/node-gh/gh/pull/595 will create a beautiful new table view:

[image: image] https://user-images.githubusercontent.com/20076677/50718966-62a33c00-104a-11e9-8c85-c55a93ef31e6.png

For listing in the simple view via gh pr, I can't think of a good way to print out labels given that they may need to wrap text unless we add a new column.

Given that we are tight for space width wise the best alternative would be to add labels somewhere on gh pr --detailed.

We could add a new divider under author:

[image: image] https://user-images.githubusercontent.com/20076677/50719001-ec530980-104a-11e9-9e81-7286e7e43c37.png

What do you think?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/node-gh/gh/pull/611#issuecomment-451618817, or mute the thread https://github.com/notifications/unsubscribe-auth/AAkVFbwnoPCYSNTMlbqngfaNcivf51hWks5vAAgAgaJpZM4ZrUNj .

-- Greg Amerson Liferay Developer Tools Liferay, Inc. www.liferay.com

protoEvangelion commented 5 years ago

In any case we will get the labels working in the --detailed view.

Our goal for the non detailed view is to show only vital info.

Would you say that labels are vital info in your workflow?

gamerson commented 5 years ago

Actually the labels are vital for my workflow, but my usage may not be idiomatic. Here is how it usually goes...

  1. I check all of my repositories that have incoming PRs (5 repos right now that I check regularly) ("gh pr")
  2. if I have any new PRs that have no labels, then I now I have some new PRs I haven't looked at, so I review them
  3. If the PR require changes to be made, I label them with a "requested changes" but I leave the PR open for the author to send more followup commits
  4. many times my code reviews require non-trivial refactoring that result in multiple followup commits. Instead of me reviewing the PR each time a new commit comes in, the author will remove my "requested changes" label and add a new label "ready for review"
  5. so now when I fly by my 5 repos again, I usually see several PRs with a "requested changes" label, so I know those aren't ready to be reviewed again. When I see a "ready for review" label, I know I need to open that PR and view the most recently changes.

So in my workflow the presence of "no labels" or a "ready for review" label tells me I have new work to do. If the PRs have "requested changes", then I just leave them alone. I realize this workflow could be modified, where I make my code review comments and then close the PR and ask author to resend changes on a new PR. But that feels like more work than just adding/removing labels.

Suggestions?

On Mon, Jan 7, 2019 at 10:12 AM Ryan Garant notifications@github.com wrote:

In any case we will get the labels working in the --detailed view.

Our goal for the non detailed view is to show only vital info.

Would you say that labels are vital info in your workflow?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/node-gh/gh/pull/611#issuecomment-451987376, or mute the thread https://github.com/notifications/unsubscribe-auth/AAkVFTufy0P6e2IZ4mSvZgX1J3cPShzLks5vA3H_gaJpZM4ZrUNj .

-- Greg Amerson Liferay Developer Tools Liferay, Inc. www.liferay.com

protoEvangelion commented 5 years ago

Hmm that's actually a pretty handy way to use them. Thinking through it a bit more, I wouldn't mind placing the labels below the title with a linebreak as @hamxabaig suggested. We could do that in both detailed and non-detailed views.

If there are no labels then everything will still print on a single line. From what I have witnessed, that would not affect most users.

Thanks for taking the time to explain that 😄

protoEvangelion commented 5 years ago

@gamerson we just release with the table formatting. Here is what it looks like now:

image

Will that work for you?

gamerson commented 5 years ago

Looks nice. How do you activate the table view? Is it the default?

On Tue, Feb 5, 2019 at 7:42 PM Ryan Garant notifications@github.com wrote:

@gamerson https://github.com/gamerson we just release with the table formatting. Here is what it looks like now:

[image: image] https://user-images.githubusercontent.com/20076677/52315819-71dd1880-296d-11e9-8216-097c239689ac.png

Will that work for you?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/node-gh/gh/pull/611#issuecomment-460872670, or mute the thread https://github.com/notifications/unsubscribe-auth/AAkVFWofi7XMYljA_6xuE6ZB7MTKmRPgks5vKjMbgaJpZM4ZrUNj .

-- Greg Amerson Liferay Developer Tools Liferay, Inc. www.liferay.com

gamerson commented 5 years ago

I just updated and this does let me see the labels in a useful format. Thanks gh team, keep up the good work!

On Wed, Feb 6, 2019 at 9:26 AM Greg Amerson gregory.amerson@liferay.com wrote:

Looks nice. How do you activate the table view? Is it the default?

On Tue, Feb 5, 2019 at 7:42 PM Ryan Garant notifications@github.com wrote:

@gamerson https://github.com/gamerson we just release with the table formatting. Here is what it looks like now:

[image: image] https://user-images.githubusercontent.com/20076677/52315819-71dd1880-296d-11e9-8216-097c239689ac.png

Will that work for you?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/node-gh/gh/pull/611#issuecomment-460872670, or mute the thread https://github.com/notifications/unsubscribe-auth/AAkVFWofi7XMYljA_6xuE6ZB7MTKmRPgks5vKjMbgaJpZM4ZrUNj .

-- Greg Amerson Liferay Developer Tools Liferay, Inc. www.liferay.com

-- Greg Amerson Liferay Developer Tools Liferay, Inc. www.liferay.com

protoEvangelion commented 5 years ago

To pretty print output in a table add "pretty_print": true to your ~/.gh-json config

protoEvangelion commented 5 years ago

I am planning to make it default in next major release