Add a character count or visible warning to repo descriptions #6634

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

Originally created by @cooperg2001 on GitHub (Jan 5, 2021).

  • Gitea version (or commit ref): 1.13.1
  • Git version: N/A
  • Operating system: N/A

Description

When entering a description for a repository a user may not know of the 255 character limit until after attempting to save their description. If a description exceeds 255 characters it is cleared when the user attempts to save. A character count should be added (or a visible warning of the limit) to the web interface to avoid having users retype descriptions if they forget or do not know of this limit. Potentially for long descriptions the warning could advise users to put information in the repo README instead.

Screenshots

Example of proposed change on Imgur: https://imgur.com/a/y5NcnGS

Originally created by @cooperg2001 on GitHub (Jan 5, 2021). - Gitea version (or commit ref): 1.13.1 - Git version: N/A - Operating system: N/A ## Description When entering a description for a repository a user may not know of the 255 character limit until after attempting to save their description. If a description exceeds 255 characters it is cleared when the user attempts to save. A character count should be added (or a visible warning of the limit) to the web interface to avoid having users retype descriptions if they forget or do not know of this limit. Potentially for long descriptions the warning could advise users to put information in the repo README instead. ## Screenshots Example of proposed change on Imgur: https://imgur.com/a/y5NcnGS
GiteaMirror added the topic/uitopic/ui-interactiongood first issue labels 2025-11-02 07:01:58 -06:00
Author
Owner

@kins-dev commented on GitHub (May 6, 2021):

While a UI would be nice, I'm curious why there is a limit at all.

Is there a reason that this field is limited, or why the count is so low?

I was able to remove this limit in a test build with no ill effects for SQLite3. I don't think any of the other DB types would care either.

@kins-dev commented on GitHub (May 6, 2021): While a UI would be nice, I'm curious why there is a limit at all. Is there a reason that this field is limited, or why the count is so low? I was able to remove this limit in a test build with no ill effects for SQLite3. I don't think any of the other DB types would care either.
Author
Owner

@schaffman5 commented on GitHub (May 9, 2021):

@kins-dev Agreed since there are cases where repo descriptions slightly longer than 255 are useful. In models/repo.go, repo description is set to TEXT, so the limit seems to be code-only. Could this limit be made a config parameter?

The API descriptions could be more clear as well since they don't reference the char limit:

  • /orgs/{org}/repos [POST]: description -- string: Description of the repository to create
  • /repos/{owner}/{repo} [PATCH]: description -- string: a short description of the repository.
@schaffman5 commented on GitHub (May 9, 2021): @kins-dev Agreed since there are cases where repo descriptions slightly longer than 255 are useful. In models/repo.go, repo description is set to TEXT, so the limit seems to be code-only. Could this limit be made a config parameter? The API descriptions could be more clear as well since they don't reference the char limit: - /orgs/{org}/repos [POST]: description -- string: Description of the repository to create - /repos/{owner}/{repo} [PATCH]: description -- string: a short description of the repository.
Author
Owner

@kins-dev commented on GitHub (May 9, 2021):

I removed all the limits from my test instance and it has been great. Given Jenkins pulls the repo description over automatically, (pipelines based on an organization) it gives me one version of the truth over multiple systems.

I don't mind if this is configurable as long as no limit is an option.

@kins-dev commented on GitHub (May 9, 2021): I removed all the limits from my test instance and it has been great. Given Jenkins pulls the repo description over automatically, (pipelines based on an organization) it gives me one version of the truth over multiple systems. I don't mind if this is configurable as long as no limit is an option.
Author
Owner

@fnetX commented on GitHub (Jun 15, 2021):

Just reported on Codeberg

I just confirmed on try.gitea.io this also affects other input boxes (e.g. name), so an improvement should take care of all the input boxes there.

Also, I noticed that spellcheck is disabled, does anyone know why this is explicitly set?

@fnetX commented on GitHub (Jun 15, 2021): Just reported on [Codeberg](https://codeberg.org/Codeberg/Community/issues/470) I just confirmed on try.gitea.io this also affects other input boxes (e.g. name), so an improvement should take care of all the input boxes there. Also, I noticed that spellcheck is disabled, does anyone know why this is explicitly set?
Author
Owner

@fnetX commented on GitHub (Jun 15, 2021):

Does anyone know a place in the Gitea Codebase where such a limit is already in place so that this could be copied / adapted? I just tried to adapt the checker on the repo tag code, but didn't get it to work. I'm also not really a frontend guy, but if pointed to some good resources I might be able to pick this up.

@fnetX commented on GitHub (Jun 15, 2021): Does anyone know a place in the Gitea Codebase where such a limit is already in place so that this could be copied / adapted? I just tried to adapt the checker on the repo tag code, but didn't get it to work. I'm also not really a frontend guy, but if pointed to some good resources I might be able to pick this up.
Author
Owner

@CypherpunkSamurai commented on GitHub (Sep 19, 2022):

Searching the Repository for MaxSize reveals that there's a handful of cases.

Are we planning to replace the UI with JS validation for all these cases, or just the repository setting related UI?

@CypherpunkSamurai commented on GitHub (Sep 19, 2022): Searching the Repository for [MaxSize](https://github.com/go-gitea/gitea/search?q=%3BMaxSize) reveals that there's a handful of cases. Are we planning to replace the UI with JS validation for all these cases, or just the repository setting related UI?
Author
Owner

@delvh commented on GitHub (Sep 19, 2022):

  1. See #21119 and the subsequent #21194
  2. Isn't that issue now implemented by using the browser native restriction?
    (Of course without a fancy <x> characters left display, but I have also nothing against the natively supported validation)
@delvh commented on GitHub (Sep 19, 2022): 1. See #21119 and the subsequent #21194 2. Isn't that issue now implemented by using the browser native restriction? (Of course without a fancy `<x> characters left` display, but I have also nothing against the natively supported validation)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6634