Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add colors based on Issue / PR state #637

Merged
merged 11 commits into from
Oct 20, 2024

Conversation

wd60622
Copy link
Collaborator

@wd60622 wd60622 commented Oct 15, 2024

Describe what this PR does / why we need it

Using the state, isDraft, stateReason fields from the graphql API to determine the icon and color of the PR or Issue. This should be consistent with the github interface.

This works for :Octo issue / pr list / search and :Octo search

Does this pull request fix one issue?

Related to #485

Describe how you did it

  • Add state, isDraft, stateReason to the related graphql queries
  • Determine the icon and color based on these fields
  • Implement for all list and search commands

Describe how to verify it

Run any of the affected commands and see that the icons will be colored based on the state of the PR or Issue.

Special notes for reviews

This only effects telescope picker

Checklist

  • Passing tests and linting standards
  • Documentation updates in README.md and doc/octo.txt

@wd60622
Copy link
Collaborator Author

wd60622 commented Oct 15, 2024

EDIT: Previews of :Octo pr search below

@wd60622 wd60622 added telescope Related to telescope picker enhancement New feature or request labels Oct 15, 2024
@wd60622
Copy link
Collaborator Author

wd60622 commented Oct 15, 2024

I have the colors wrong. The merge should be purple and there should be red if closed. Might need to pull in some more in query

lua/octo/pickers/telescope/entry_maker.lua Outdated Show resolved Hide resolved
lua/octo/pickers/telescope/provider.lua Outdated Show resolved Hide resolved
wd60622 and others added 3 commits October 16, 2024 06:50
Co-authored-by: Peter V. <98245483+p5quared@users.noreply.github.com>
@wd60622
Copy link
Collaborator Author

wd60622 commented Oct 16, 2024

Hi @p5quared, Thanks for the review!

I ended up adding richer set of symbols to match the github interface a bit more. Think it looks way better now

:Octo pr search
pr-search

:Octo issue search
issue-search

Copy link
Collaborator

@GuillaumeLagrange GuillaumeLagrange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Olgtm, you can merge if you agree with the comment.

On a side note, I suggest we default to squash and merge to keep the master git history clean, either this or we make the effort of cleaning up the commits before merging which is a bit overkill for a small project like this.

lua/octo/pickers/telescope/entry_maker.lua Outdated Show resolved Hide resolved
lua/octo/pickers/telescope/entry_maker.lua Show resolved Hide resolved
@wd60622 wd60622 merged commit 52bf4c2 into pwntester:master Oct 20, 2024
2 checks passed
@wd60622 wd60622 deleted the telescope-state-colors branch October 20, 2024 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request telescope Related to telescope picker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants