feat(cli): send github issues/prs from snacks picker to the cli#336
Open
S1M0N38 wants to merge 1 commit into
Open
feat(cli): send github issues/prs from snacks picker to the cli#336S1M0N38 wants to merge 1 commit into
S1M0N38 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to let the CLI “send” action emit a compact GitHub autolink reference (owner/repo#number) when the picker selection represents a GitHub issue/PR, keeping the existing file/location fallback for other items.
Changes:
- Added GitHub-item detection helpers (
is_gh_item,gh_ref) in the picker send path. - Updated the picker send callback to emit a GitHub reference instead of a file/location when a GitHub item is detected.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+55
to
+56
| if is_gh_item(item) then | ||
| ret[#ret + 1] = { gh_ref(item) } |
Comment on lines
+55
to
+58
| if is_gh_item(item) then | ||
| ret[#ret + 1] = { gh_ref(item) } | ||
| ret[#ret + 1] = { "\n" } | ||
| else |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add support for sending a GitHub issue/PR selected in a picker to the CLI as context.
When a picker item is a GitHub issue/PR (detected by the presence of
type,repo, andnumberfields, as exposed by snacks'gh_issues/gh_prssources), the send callback now emits the reference in GitHub's standard cross-repo autolink format:e.g.
folke/sidekick.nvim#123.This format is the documented GitHub autolink reference, so the output is compact for the agent and remains clickable when pasted back into GitHub. It intentionally does not distinguish PR from issue, since they share the same number space on GitHub.
Non-GitHub items keep falling back to the existing file/location behavior, so the change is backwards compatible and scoped to the picker send path (
lua/sidekick/cli/picker/init.lua).Related Issue(s)
Screenshots
Not applicable — this is a change to the text sent to the CLI, with no visual/UI changes. Resulting context for a selected GitHub issue looks like: