Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
delvh opened this issue Mar 1, 2021 · 7 comments
Closed
Labels
topic/ui-interaction Change the process how users use Gitea instead of the visual appearance type/enhancement An improvement of existing functionality

Comments

@delvh
Copy link
Member

delvh commented 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)

@zeripath
Copy link
Contributor

zeripath commented 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

@techknowlogick techknowlogick added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Mar 1, 2021
@delvh
Copy link
Member Author

delvh commented 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)

@noerw noerw added type/enhancement An improvement of existing functionality topic/ui Change the appearance of the Gitea UI kind/usability and removed issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail labels Mar 2, 2021
@NPatch
Copy link

NPatch commented 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.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented 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
Copy link
Contributor

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.

@delvh delvh added topic/ui-interaction Change the process how users use Gitea instead of the visual appearance and removed topic/ui Change the appearance of the Gitea UI kind/usability labels Oct 8, 2023
@wxiaoguang
Copy link
Contributor

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

wxiaoguang added a commit that referenced this issue May 5, 2024
1. "enter" doesn't work (I think it is the last enter support for #14843)
2. if a branch name contains something like `&`, then the branch selector doesn't update
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue May 5, 2024
1. "enter" doesn't work (I think it is the last enter support for go-gitea#14843)
2. if a branch name contains something like `&`, then the branch selector doesn't update
wxiaoguang added a commit that referenced this issue May 5, 2024
Backport #30858 by wxiaoguang

1. "enter" doesn't work (I think it is the last enter support for #14843)
2. if a branch name contains something like `&`, then the branch selector doesn't update

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@wxiaoguang
Copy link
Contributor

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/ui-interaction Change the process how users use Gitea instead of the visual appearance type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

6 participants