-
Notifications
You must be signed in to change notification settings - Fork 8
Feature/#21 add assignees on new issue #119
base: master
Are you sure you want to change the base?
Conversation
- fix to be able to set assignee when creating new issue
- refactor: put some variables into one dictionary
- integrate `gh#provider#quickpick#open` to select assignees
remove white space in autoload/gh/issues.vim
- fix to be able to set assignee when creating new issue
- refactor: put some variables into one dictionary
- integrate `gh#provider#quickpick#open` to select assignees
…ub.com/skanehira/gh.vim into feature/#21-add-assignees-on-new-issue
autoload/gh/github/repos.vim
Outdated
let s:assignee_list_query =<< trim END | ||
{ | ||
repository(name: "%s", owner: "%s") { | ||
assignableUsers(first: 10) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to get all of repository's users
GraphQL can get 100 members but it's maybe not all in repository, so we need to use cursor to get when repository has over 100 members
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skanehira
sorry, i don't understand why we need to get users who are not assignable for the issue.
i guess getting only assignableUsers
like this way is enough to show the list of assignable users on quickpick buffer.
something of my understanding is wrong...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry my explanation is not good.
I mean I think we need to get assignable users for the issue more than 10.
But in GitHub specification, assign for 1 issue is until 10 users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for replying late... lol
ok, i got understand what you mean.
tried to fix by this commit.
Please check it again :)
autoload/gh/issues.vim
Outdated
endfunction | ||
|
||
function! s:open_assignees_list(resp) abort | ||
let s:issue_new_assignees = ["-"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the intent of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skanehira
I intended to express for 'assigning nobody' by this '-'.
if you don't want to add assignee on new issue, not selecting any item by in quickpick-buffer is not enough for assigning nobody. because the item which is on your cursor would be selected even if you don't selected an items by .
autoload/gh/provider/quickpick.vim in s:on_accept
function around line 340 is the place.
else
let l:items = [s:state['fitems'][l:index]] " <= l:index is the cursor line
endif
so, I placed '-' on top of the list.
then, when you not selecting in quickpick-buffer, the item '-' is selected(if you didn't move cursor in quickpick buffer), and s:on_accept_assignees
function in gh/issues.vim remove that '-' and finally nobody assignees on new issue would be achieved.
this is the reason why i set '-' as default item.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intended to express for 'assigning nobody' by this '-'.
if you don't want to add assignee on new issue, not selecting any item by in quickpick-buffer is not enough for assigning nobody. because the item which is on your cursor would be selected even if you don't selected an items by .
How about implement cancel function?
I think if user do nothing, just close quickpick is better way.
As a result, operation and implement will be more simple because we don't need to remove -
from list and user is just press <C-c>
to close quickpick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about implement cancel function?
i thought it would be better that the cancel function ( <C-c>
) should be able to cancel for creating new issue itself, not for selecting nobody as assignee, like below.
vnew gh://:owner/:repo/issues/new
- Enter title of new issue.
- Select assignee(s). ( there should be 3 options for user )
- Pattern A:
<C-c>
- => cancel creating new issue
- Pattern B: Just put
<CR>
(without selecting)- => create new issue, but no assignee
- Pattern C: Select assignee(s) and put
<CR>
- => create new issue with assignee(s)
How about this fix ?
I fixed autoload/gh/provider/quickpick.vim
a little bit.
- removed
-
from assignees list - user can select no assignee by just putting
<CR>
without selecting nobody
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it's inconvenience a little bit when we choose how to merge the PR, because we must choose one.
sorry, I didn't consider it. I've got to understand.
I'll rebase revert the commit :)
How about implement like
gh issue create
? We can choose option to add some metadata.
hmm, sorry. could you explain your idea, a bit more...?
implement like the picture (you posted), just before selecting assignees?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implement like the picture (you posted), just before selecting assignees?
In my image, operation is bellow.
- open create new issue buffer
- choose template (if existed)
- edit issue body and save with
:w
- ask user what they want to add some metadata
- if they want, ask they what kind of metadata to add (like screenshot) with quickpick (labels, projects, milestone will implement in other issues)
- if they don't want, do nothing
- create new issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your explanation, I've got your image clearly :)
I'm gonna try to implement it.
💪 Summary
working on #21.
🏁 Goals
fix to be able to set assignees when creating new issue.