Saved replies to issues and PRs (Canned/Templated Responses) #10227

Open
opened 2025-11-02 09:01:33 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @techknowlogick on GitHub (Feb 6, 2023).

Feature Description

canned responses would allow faster responses to common queries.

I currently use them for pasting a closing an issues as a dupe, or direction questions to the chatroom. GitHub currently has them on a per user basis.

Instead of how GitHub does it, this could be done on a per-repo basis, and just like with issue templates they could be saved in the .gitea directory as yaml config.

What would need to be done:

  • create yaml schema
    • schema version
    • snippet title/description to show in dropdown list
    • the actual body of the response to be pasted in
  • parse/validate yaml
  • show dropdown in issue/pr comment box

In the future, we could leverage the .gitea repo, and save org/user scoped yaml.

Screenshots

screenshot of canned response dropdown in GitHub
Originally created by @techknowlogick on GitHub (Feb 6, 2023). ### Feature Description canned responses would allow faster responses to common queries. I currently use them for pasting a closing an issues as a dupe, or direction questions to the chatroom. GitHub currently has them on a per user basis. Instead of how GitHub does it, this could be done on a per-repo basis, and just like with issue templates they could be saved in the `.gitea` directory as yaml config. What would need to be done: * create yaml schema * schema version * snippet title/description to show in dropdown list * the actual body of the response to be pasted in * parse/validate yaml * show dropdown in issue/pr comment box In the future, we could leverage the `.gitea` repo, and save org/user scoped yaml. ### Screenshots <img width="948" alt="screenshot of canned response dropdown in GitHub" src="https://user-images.githubusercontent.com/164197/217055324-6ddb32c2-99ce-4a66-bb3c-ca8409ea3c7f.png">
GiteaMirror added the type/proposaltype/feature labels 2025-11-02 09:01:33 -06:00
Author
Owner

@delvh commented on GitHub (Feb 6, 2023):

Why canned? Wouldn't that be saved?

Also, I see a huge benefit with your proposed approach: We can even allow for inserting variables, i.e. the issue open date, its title, its description, …
For that to be efficient, however, there is only one possible approach:
First, define a query that simply lists the available saved replies. It doesn't query their contents, only their names.
(Then, display these results in the UI/ offer an API endpoint to show these names)
Then, simply offer a route that takes a named reply, and use the response of querying for this named reply as output for whatever you want to write.

(To be fair, I haven't used that feature on GitHub yet, so I don't know how they implemented it. Those are simply the thoughts at the top of my head)

@delvh commented on GitHub (Feb 6, 2023): Why `canned`? Wouldn't that be `saved`? Also, I see a huge benefit with your proposed approach: We can even allow for inserting variables, i.e. the issue open date, its title, its description, … For that to be efficient, however, there is only one possible approach: First, define a query that simply lists the available saved replies. It doesn't query their contents, only their names. (Then, display these results in the UI/ offer an API endpoint to show these names) Then, simply offer a route that takes a named reply, and use the response of querying for this named reply as output for whatever you want to write. (To be fair, I haven't used that feature on GitHub yet, so I don't know how they implemented it. Those are simply the thoughts at the top of my head)
Author
Owner

@fsiddi commented on GitHub (Feb 6, 2023):

Here on GH they are called "Saved Replies" because a user makes them and saves them. In this case they are more like "templates".

@fsiddi commented on GitHub (Feb 6, 2023): Here on GH they are called "Saved Replies" because a user makes them and saves them. In this case they are more like "templates".
Author
Owner

@techknowlogick commented on GitHub (Feb 6, 2023):

Why canned? Wouldn't that be saved?

Here on GH they are called "Saved Replies" because a user makes them and saves them. In this case they are more like "templates".

Yeah, I also used snippet, canned response, and perhaps another in my initial description. I've updated title to cover all the possible names.

@techknowlogick commented on GitHub (Feb 6, 2023): > Why canned? Wouldn't that be saved? > Here on GH they are called "Saved Replies" because a user makes them and saves them. In this case they are more like "templates". Yeah, I also used snippet, canned response, and perhaps another in my initial description. I've updated title to cover all the possible names.
Author
Owner

@techknowlogick commented on GitHub (Mar 29, 2023):

I have a WIP branch of this right now. Right now, it is an API endpoint that fetches the config file from the repo, and returns the config to be used by the issue/PR comment area.

The file name is: .gitea/comment_snippets.yml (not sure about this filename, but figured rather than yakshaving it, I'd working on the PR is better)

The yaml schema I'm working with is:

version: 1.0 # schema version, in case it needs to be updated
snippets: # array of all snippets
  - title: Snippet Title, short description
    description: description of snippet to provide more details about what snippet is
    body: |
      Full snippet body
      with multiple lines.
      This full body will be inserted into the editor.
@techknowlogick commented on GitHub (Mar 29, 2023): I have a WIP branch of this right now. Right now, it is an API endpoint that fetches the config file from the repo, and returns the config to be used by the issue/PR comment area. The file name is: `.gitea/comment_snippets.yml` (not sure about this filename, but figured rather than yakshaving it, I'd working on the PR is better) The yaml schema I'm working with is: ``` version: 1.0 # schema version, in case it needs to be updated snippets: # array of all snippets - title: Snippet Title, short description description: description of snippet to provide more details about what snippet is body: | Full snippet body with multiple lines. This full body will be inserted into the editor. ```
Author
Owner

@delvh commented on GitHub (Mar 29, 2023):

Alternatively, what we could as well would be something like .gitea/replies/<saved response name>.yaml.
I'm not sure which one would be better, the one saving one reply per file, or the one saving all replies in the same file?

@delvh commented on GitHub (Mar 29, 2023): Alternatively, what we could as well would be something like `.gitea/replies/<saved response name>.yaml`. I'm not sure which one would be better, the one saving one reply per file, or the one saving all replies in the same file?
Author
Owner

@Mano-Wii commented on GitHub (Aug 16, 2023):

I wasn't aware of this PR, but I created an extension that basically does what is proposed here.

Since it is an extension, the "canned responses" are individual for each user.
https://chrome.google.com/webstore/detail/canned-responses-for-blen/ofenfmlpeilfjabiakajogfjjbhlpden?hl=pt-BR&authuser=0

I would be glad to see something like this in gitea.

@Mano-Wii commented on GitHub (Aug 16, 2023): I wasn't aware of this PR, but I created an extension that basically does what is proposed here. Since it is an extension, the "canned responses" are individual for each user. https://chrome.google.com/webstore/detail/canned-responses-for-blen/ofenfmlpeilfjabiakajogfjjbhlpden?hl=pt-BR&authuser=0 I would be glad to see something like this in gitea.
Author
Owner

@BlenderDefender commented on GitHub (May 24, 2024):

Saving replies would be really helpful, especially if there is an option to add variables like the username of the person who opened the issue/PR, your own username and potentially quite a few more variables.

@BlenderDefender commented on GitHub (May 24, 2024): Saving replies would be really helpful, especially if there is an option to add variables like the username of the person who opened the issue/PR, your own username and potentially quite a few more variables.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10227