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

feat: add snacks picker support for issues, prs, and notifications #858

Merged
merged 6 commits into from
Feb 16, 2025

Conversation

tris203
Copy link
Contributor

@tris203 tris203 commented Feb 15, 2025

WIP adding snacks picker support
Closes #809

Just a draft for now but will add more support

Issues:
image

PRs:
image

- Updated README.md to include 'folke/snacks.nvim' as an option
- Modified config.lua to add 'snacks' to OctoPickers alias and validate_pickers
- Added new file provider.lua for snacks picker with not implemented methods
@github-actions github-actions bot added the enhancement New feature or request label Feb 15, 2025
@wd60622
Copy link
Collaborator

wd60622 commented Feb 15, 2025

Cool. I think that it would be good to approach this in multiple PRs for the sake of the reviewers

@tris203
Copy link
Contributor Author

tris203 commented Feb 15, 2025

At the moment I am just working in separate commits to make the review easier. I am planning to just do issues/prs/notifications then the rest of the changes can go in separate PRs

@tris203 tris203 marked this pull request as ready for review February 15, 2025 18:15
@tris203
Copy link
Contributor Author

tris203 commented Feb 15, 2025

I think this is probably ready for an initial review now as a starting point and then we can iterate in future PRs

@wd60622
Copy link
Collaborator

wd60622 commented Feb 15, 2025

At the moment I am just working in separate commits to make the review easier. I am planning to just do issues/prs/notifications then the rest of the changes can go in separate PRs

That'd be a great start. Feel free to make some sub-issues on the current issue to let others know the status

@wd60622 wd60622 changed the title feat: add snacks picker framework feat: add snacks picker support for issues, prs, and notifications Feb 15, 2025
@tris203
Copy link
Contributor Author

tris203 commented Feb 15, 2025

I think im done here with first iteration.
There will be stuff to refactor/tidy up/more functionality later

But I think I'm happy with this as a first pass

id like to work out how to get the gh.run to work in a finder function so we don't have to pass an items[], but I'm not sure that's possible

@wd60622
Copy link
Collaborator

wd60622 commented Feb 16, 2025

I think im done here with first iteration. There will be stuff to refactor/tidy up/more functionality later

But I think I'm happy with this as a first pass

Will take another look

id like to work out how to get the gh.run to work in a finder function so we don't have to pass an items[], but I'm not sure that's possible

Not exactly sure what you mean. You can use the gh.api.graphql function as well which simplifies the call.

local gh = require "octo.gh"

local query = [[
query {
  viewer {
    login
  }
}
]]

local cb = function(output)
    vim.notify("Greetings " .. output)
end

gh.api.graphql { 
  query = query, 
  jq = ".data.viewer.login",
  opts = { cb = cb }
}

Feel free to raise another issue and we can discuss ideas separate from this PR

Copy link
Collaborator

@wd60622 wd60622 left a comment

Choose a reason for hiding this comment

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

Awesome. Let's iterate!

@wd60622 wd60622 merged commit f06ac2a into pwntester:master Feb 16, 2025
2 of 3 checks passed
@tris203 tris203 deleted the snacks_picker branch February 16, 2025 09:53
folke pushed a commit to LazyVim/LazyVim that referenced this pull request Feb 16, 2025
## Description
A [PR](pwntester/octo.nvim#858) has landed in
`octo.nvim` that adds initial support for `snacks.picker`. Enable it in
`octo.nvim` Extra if user uses `snacks.picker`.

I also changed the checks to use `has_extra`. This was needed for
`snacks.picker`, since `has("snacks.nvim")` doesn't ensure that user
also has `snacks.picker` enabled. For the others I just changed it for
conformity, but if you think there might be something wrong about that
(that I'm unable to think of), please feel free to change them back.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
None
<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
@wd60622 wd60622 added the snacks Related to the snacks picker label Feb 16, 2025
doodleEsc pushed a commit to doodleEsc/LazyVim that referenced this pull request Feb 17, 2025
## Description
A [PR](pwntester/octo.nvim#858) has landed in
`octo.nvim` that adds initial support for `snacks.picker`. Enable it in
`octo.nvim` Extra if user uses `snacks.picker`.

I also changed the checks to use `has_extra`. This was needed for
`snacks.picker`, since `has("snacks.nvim")` doesn't ensure that user
also has `snacks.picker` enabled. For the others I just changed it for
conformity, but if you think there might be something wrong about that
(that I'm unable to think of), please feel free to change them back.
<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

## Related Issue(s)
None
<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request snacks Related to the snacks picker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support snacks.nvim picker
2 participants