[Feature Request] Add "Ctrl+Enter" posting of messages for all textareas #6945

Closed
opened 2025-11-02 07:11:51 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @delvh on GitHub (Mar 1, 2021).

  • Gitea version (or commit ref): 1.14.0+dev-784-g85e6e0734

Description

Currently, Gitea supports "posting" text entered into a textarea using "Ctrl+Enter" for some text areas.
However, it appears pretty random which text areas do support it and which don't.
For example, adding a comment to a PR review cannot be posted using Ctrl+Enter.
Creating an issue can in contrast be posted using Ctrl+Enter, both for the title as well as for the description.

It would be nice if users didn't have to guess whether they can press Ctrl+Enter or not.

One textarea must make a decision before posting:
The textarea where you add the first comment on a PR and can choose either Start review or add single comment should automatically count as start review as a singly posted comment is most often unnecessary.
All textareas for further comments should simply add the comments to the queue submitted when submitting the PR review.

One textarea will need special treatment (could, if requested, also be a separate issue):
The "Submit review - comment" textarea where you can approve, comment or request changes for a PR currently throws an error when posting using Ctrl+Enter because no type has been given.
I'd argue that if no comments were made, the PR should automatically be counted as approved,
else it should be counted as (opinions will differ here) comment or as changes requested (I personally am for changes requested because I'd say we can assume that if someone made a comment on a PR, it should be counted as a requested change)

Originally created by @delvh on GitHub (Mar 1, 2021). - Gitea version (or commit ref): 1.14.0+dev-784-g85e6e0734 ## Description Currently, Gitea supports "posting" text entered into a textarea using "Ctrl+Enter" for **some** text areas. However, it appears pretty random which text areas do support it and which don't. For example, adding a comment to a PR review cannot be posted using Ctrl+Enter. Creating an issue can in contrast be posted using Ctrl+Enter, both for the title as well as for the description. It would be nice if users didn't have to guess whether they can press Ctrl+Enter or not. One textarea must make a decision before posting: The textarea where you add the first comment on a PR and can choose either `Start review` or `add single comment` should automatically count as start review as a singly posted comment is most often unnecessary. All textareas for further comments should simply add the comments to the queue submitted when submitting the PR review. One textarea will need special treatment (could, if requested, also be a separate issue): The "Submit review - comment" textarea where you can approve, comment or request changes for a PR currently throws an error when posting using Ctrl+Enter because no type has been given. I'd argue that if no comments were made, the PR should automatically be counted as approved, else it should be counted as (opinions will differ here) `comment` or as `changes requested` (I personally am for `changes requested` because I'd say we can assume that if someone made a comment on a PR, it should be counted as a requested change)
GiteaMirror added the type/enhancementtopic/ui-interaction labels 2025-11-02 07:11:51 -06:00
Author
Owner

@zeripath commented on GitHub (Mar 1, 2021):

It would be seriously helpful if you could list the URLs that don't have ctrl-enter submits - and even better some way of identifying these forms either their class Id etc.

That would help immensely in tracking down which ones are missing the feature and why

@zeripath commented on GitHub (Mar 1, 2021): It would be seriously helpful if you could list the URLs that don't have ctrl-enter submits - and even better some way of identifying these forms either their class Id etc. That would help immensely in tracking down which ones are missing the feature and why
Author
Owner

@delvh commented on GitHub (Mar 1, 2021):

List of textareas known to be missing that feature (feel free to add any I missed):

  • Adding a comment to a PR (where you can choose Start Review or Add to Review)
  • Renaming issue
  • Editing issue comment?
  • New project description (title supports it, only if title is not empty)
  • New Release description (title and tag support it already - will need to only be performed if title and tag are not empty)
  • New Milestone description (again, title supports it and should only be done when title is not empty)
  • New File commit description (title and filename both support it, should only be performed when both are not empty)
  • Reference in new issue description (title already supports it, of course only when title is not empty) - also the repository searching mechanism is a bit broken there as it does not match users, only repositories entered (if I try to use i.e. delvh/test I have to enter test and not delvh/test
  • Settings: repository description (of course, title and website support it already)
  • Settings: Deploy keys content (of course, title supports it already)

Also, since most likely new and edit always use the same template, anything mentioned for new should also be present for the edit version and vice versa.

I'm noticing a bit of a pattern here…
That is the list I found for now.

Textareas I found where currently "Ctrl+Enter" works erroneously:

  • Submit PR Review textarea (see first message) (no type gets set, so a error message pops up)
  • "Uploading file - create directory" textarea works even if no file has been uploaded - results in 404 after clicking (but no commit being created thankfully)
@delvh commented on GitHub (Mar 1, 2021): List of textareas known to be missing that feature (feel free to add any I missed): - Adding a comment to a PR (where you can choose `Start Review` or `Add to Review`) - Renaming issue - Editing issue comment? - New project description (title supports it, only if title is not empty) - New Release description (title and tag support it already - will need to only be performed if title and tag are not empty) - New Milestone description (again, title supports it and should only be done when title is not empty) - New File commit description (title and filename both support it, should only be performed when both are not empty) - Reference in new issue description (title already supports it, of course only when title is not empty) - also the repository searching mechanism is a bit broken there as it does not match users, only repositories entered (if I try to use i.e. delvh/test I have to enter test and not delvh/test - Settings: repository description (of course, title and website support it already) - Settings: Deploy keys content (of course, title supports it already) Also, since most likely new and edit always use the same template, anything mentioned for new should also be present for the edit version and vice versa. I'm noticing a bit of a pattern here… That is the list I found for now. Textareas I found where currently "Ctrl+Enter" works erroneously: - Submit PR Review textarea (see first message) (no type gets set, so a error message pops up) - "Uploading file - create directory" textarea works even if no file has been uploaded - results in 404 after clicking (but no commit being created thankfully)
Author
Owner

@NPatch commented on GitHub (May 6, 2022):

using gitea 1.66.6, Ctrl+Enter doesn't work with Issue creation, as well as, Repo Project creation(kanban) and Project Board creation.

@NPatch commented on GitHub (May 6, 2022): using gitea 1.66.6, Ctrl+Enter doesn't work with Issue creation, as well as, Repo Project creation(kanban) and Project Board creation.
Author
Owner

@wxiaoguang commented on GitHub (May 13, 2022):

The reason is that the PR #2540 only attach an event handler to existed elements, while some elements are created dynamically.

A quick fix is to use $(document).on('keydown', instead, then every input with js-quick-submit CSS class can have the expected behavior (for traditional forms). For AJAX requests, there could be a little more work to do to make the event handler to know which element event should be triggered.

@wxiaoguang commented on GitHub (May 13, 2022): The reason is that the PR #2540 only attach an event handler to existed elements, while some elements are created dynamically. * #2540 A quick fix is to use `$(document).on('keydown', ` instead, then every input with `js-quick-submit` CSS class can have the expected behavior (for traditional forms). For AJAX requests, there could be a little more work to do to make the event handler to know which element event should be triggered.
Author
Owner

@wxiaoguang commented on GitHub (May 16, 2022):

See:

More details about List of textareas known to be missing that feature above:

  • For any input type=text in a real form, a simple Enter event can submit the form.
  • If an input is not in a form, then you need customized code to do quick submit (eg: issue title editor) and trigger the AJAX request.
  • All textarea elements always need the quick submit mechanism.
@wxiaoguang commented on GitHub (May 16, 2022): See: * https://github.com/go-gitea/gitea/pull/19729 More details about `List of textareas known to be missing that feature` above: * For any `input type=text` in a real form, a simple Enter event can submit the form. * If an `input` is not in a form, then you need customized code to do quick submit (eg: issue title editor) and trigger the AJAX request. * All `textarea` elements always need the quick submit mechanism.
Author
Owner

@wxiaoguang commented on GitHub (May 4, 2024):

I think this issue could be closed by Fix issue/PR title edit #30858

@wxiaoguang commented on GitHub (May 4, 2024): I think this issue could be closed by Fix issue/PR title edit #30858
Author
Owner

@wxiaoguang commented on GitHub (May 5, 2024):

I think this issue could be closed now.

These listed textarea/input[text] should have Ctrl+Enter/Enter support now.

If anything is missing, I will propose following fixes.

@wxiaoguang commented on GitHub (May 5, 2024): I think this issue could be closed now. These listed textarea/input[text] should have Ctrl+Enter/Enter support now. If anything is missing, I will propose following fixes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6945