WebUI - Allow to Close and Comment an issue

Labels: area/ui/web

Timeline

Cláudio Silva (claudioantonio) opened (edited)

At moment the CloseButton is only enabled when there is no comment typed.

When You enter in bug details page, Close Button is enabled (because the textfield for comments is empty) and Comment button is disabled. When You type the first key in the textfield for comments, Close button become disabled and Comment button become enabled.

Github shows a "Close and Comment" button when the user starts to type a comment but our mutation for closeBug don´t accept a comment as argument. 😉

input CloseBugInput {
    """A unique identifier for the client performing the mutation."""
    clientMutationId: String
    """"The name of the repository. If not set, the default repository is used."""
    repoRef: String
    """The bug ID's prefix."""
    prefix: String!
}

Michael

You actually can do multiple mutation in one query in GraphQL, but I'm not sure how that translate in the tsx code: https://hasura.io/docs/1.0/graphql/core/mutations/multiple-mutations.html

Cláudio Silva (claudioantonio) commented

Can You tell me what use cases You think will be possible with multiple queries in one request?

Michael Muré (MichaelMure) commented

You got me, I actually don't have much example for something else that would require multiple mutations. I would expect that the same need arise elsewhere when we add more features (pull-request ...). In any case and more importantly, the UX/UI should not be made worse because of a technical limitation if we can.

Cláudio Silva (claudioantonio) added label area/ui/web

Cláudio Silva (claudioantonio) commented

Specifically in this case, is It difficult ( not a goodfirstissue :) ) to change the mutation to close bug to add an optional parameter for the comment? Or even create a new mutation CloseAndCommentBug where bug prefix and comment are required?

Cláudio Silva (claudioantonio) commented

Hi @MichaelMure, are the options that I mentioned in the last comment viable/acceptable?

Michael Muré (MichaelMure) commented

Hey, sorry for the delay. I guess having a CloseAndCommentBug mutation and avoiding entirely the multi-mutations requests make sense. If you want to do that you'll have to:

  1. update the graphQL schema files and add the mutation: https://github.com/MichaelMure/git-bug/blob/master/api/graphql/schema/mutations.graphql
  2. regenerate the go code of the graphQL server: either through go generate (https://github.com/MichaelMure/git-bug/blob/master/api/graphql/handler.go#L1) or run go run gen_graphql.go
  3. implement the mutation (https://github.com/MichaelMure/git-bug/blob/master/api/graphql/resolvers/mutation.go)

This should be not too difficult as you have examples of very similar code.

Michael Muré (MichaelMure) commented

Actually a better name would be commentAndCloseBug.

Sascha (GlancingMind) commented

@MichaelMure @claudioantonio Is this issue still relevant?

Cláudio Silva (claudioantonio) commented

Hi @GlancingMind sorry for the delay, I'm busy in a professional transition. Well, I think It's not a major feature but It provides agility. Do You agree @MichaelMure ?

Sascha (GlancingMind) commented

Oh. I just noticed, that I miss interpreted the issue. I think it could still be seen as relevant.

Michael Muré (MichaelMure) commented

I agree it's not a major feature but that's also the kind of small things that make a great UX at the end of the road.

Michael Muré (MichaelMure) closed the bug