pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.28k stars 125 forks source link

Ability to sort issues/prs #338

Closed kristijanhusak closed 1 year ago

kristijanhusak commented 1 year ago

Issue Description

Discussion: https://github.com/pwntester/octo.nvim/discussions/336 Type: feature request

Describe what happened (or what feature you want)

Ability to sort issues/PRs by anything that Github api supports. This is what their docs have https://docs.github.com/en/graphql/reference/input-objects#issueorder

I would expect it to work something like this:

:Octo pr list states=MERGED sort=CREATED_AT:DESC

And maybe if DESC is omitted in the sort key to default it to ASC:

// This sorts ascending by default
:Octo pr list states=MERGED sort=CREATED_AT
pwntester commented 1 year ago

Thanks, for the idea and suggestion. I though about enabling users to add an orderBy configuration property instead since it should not be very common to change the order on each Octo command. What do you think? would that work for you or you have a reason to specify a different orderBy order on each Octo invocation?

kristijanhusak commented 1 year ago

Configuration works perfectly for me, since I just want to have similar experience to GitHub sorting, which is created_at desc by default. What do you think about setting it as a general default rule? I believe most people would expect to have the same sorting like in browser view.

pwntester commented 1 year ago

Yep, I think that is a better default. Can you please try https://github.com/pwntester/octo.nvim/pull/339 ?

kristijanhusak commented 1 year ago

Works like a charm :)

pwntester commented 1 year ago

Nice, thanks for reporting the issue and testing the PR!