-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Make character limit configurable #5697
Make character limit configurable #5697
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, except for the minor config naming issue.
.env.production.sample
Outdated
| @@ -134,3 +134,6 @@ STREAMING_CLUSTER_NUM=1 | |||
| # If you use Docker, you may want to assign UID/GID manually. | |||
| # UID=1000 | |||
| # GID=1000 | |||
|
|
|||
| # Maximum allowed character count | |||
| # MAX_CHARS=500 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest MAX_TOOT_CHARS or something similar, as one may want custom maximum length for other things (such as bios).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, i made that change.
| @@ -134,3 +134,6 @@ STREAMING_CLUSTER_NUM=1 | |||
| # If you use Docker, you may want to assign UID/GID manually. | |||
| # UID=1000 | |||
| # GID=1000 | |||
|
|
|||
| # Maximum allowed character count | |||
| # MAX_TOOT_CHARS=500 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
afaik, toots are called statuses in code…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You think it's worth to rename it again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm personally fine either ways. MAX_STATUS_CHARS would be more consistent with the source code, but the configuration option is intended for admins, not for developers.
|
I have denied such patches in the past. If somebody wants to hack it in, they may do so, but I don't want to encourage it. I feel like the UX is designed, visually and behaviourally, around a certain number of characters, and deviations have a negative impact on it. For example, I want people to pick their Mastodon based on, for example, the policies, or the theme, but I want the base level of functionality to be the same so it doesn't go into the choice. The same thing as here is with the file size limits. Some people want to make them bigger. Well, great, but if your users make use of those higher limits their attachments/avatars will not show up on other instances which have to cache that stuff. You can do that, but I'm not going to make that an Official Thing. |
|
I can understand that, but many instances already change their character counts. Some do it for jokes (e.g. the 512 characters for a tech-oriented instance), some do it for real reasons (the 10.000 characters on an instance for writers). If it's easily changeable in the main codebase or not isn't really important to me, but I'd like to have some API to get the character count of the instance, so apps can work correctly with modified servers. |
👎 In my opinion, this isn't your place to decide - it's for the instances to decide. Don't make them hack it. And they are hacking it - I've seen a good handful of toots in my timeline that are rather long, and because Mastodon isn't intelligent about alternative character limits it can make for a very annoying UX to have to scroll past ridiculously long toots. Mastodon should support arbitrary lengths (but default to 500 is totally fine, opinionated default settings are better than opinionated hardcoded values), and also have a configurable maximum length at which the rest of the toot will be hidden behind a "read more" button. We already have such a UX for content warnings, this isn't breaking new ground design-wise. Mastodon is good because it gives users that freedom they don't have on Twitter. You should embrace that. |
|
For App-Developers like me it is really important to have an API to get the character limit of the currently connected instance. Please give us an API so we can adapt our clients to the already modified mastodon-servers and provide our users the best experience. |
|
As a compromise, how about hard coding that toot with more than 500 chars get automatically wrapped in a CW with an ellipsis? That's already kind of an informal etiquette anyway, and leaves the web UI intact for the most part. |
…e-status-size Make character limit configurable (from mastodon#5697)
|
I wonder if there is any chance for this pull request to be merged. If so, we can have more discussions and improvements. If not, and this issue gets closed, others who like this change can decide to maintain it by themselves or abandon. |
|
@Gargron Can you please either merge or close this? |
|
Up @Gargron |
|
can we revisit this? if we can have a billion custom emojo, can we please please please get a 500 character limit bio as the default? the average mastodon user doesn't fit neatly into twitter-sized boxes. it's time to give people more space to describe who they are. |
|
I am looking to increase TOOT character count to 600. It seems file .env.production.sample no longer has such options open. |
|
just did it in my fork Grawl@3fd85bc |
|
Are there any scripts to work around this? |
The best thing to do in this situation would be to make it easy to configure the limit and build in a way of expanding long toots. Users are already modifying the limit and without modifications it's going to break the UX anyway. Plus with no built-in way of handling long toots it raises the chances of admins simply banning all instances that increase the limit.
I would not want this done. Would love to see long toots past the default 500 characters be limited to the first 500 up to the complete word and then expandable by the user, but using "CW" will devalue the use of CW. I run a right leaning site an intend to use CW as a way of moderating toots that could be problematic without outright deleting them. Doing anything that would get people into the habit of clicking to see CW without thinking about it would make it a lot more challenging to deal with problematic posts. |
|
Hello! @Gargron maybe in 2022 it makes sense to reconsider your decisions about this feature? |
Make character limit configurable. Return character limit in API and initial state. Handle character limit in initial state in frontend. Code style fixes. Rename MAX_CHARS to MAX_TOOT_CHARS to be more specific. Fix StatusLengthValidator tests This fixes the StatusLengthValidator tests to use StatusLengthValidator::MAX_CHARS to derive the length of the strings tested, and so makes them resilient to changes in MAX_CHARS (such as the one that made these tests fail, with it being changed from 500 to 512). This seems a bit odd for some types of tests, but appears to make sense here, where the testing goes beyond `status.length > MAX_CHARS`. Fix CharacterCount in vanilla UI (mastodon#1883)
Make character limit configurable. Return character limit in API and initial state. Handle character limit in initial state in frontend. Code style fixes. Rename MAX_CHARS to MAX_TOOT_CHARS to be more specific. Fix StatusLengthValidator tests This fixes the StatusLengthValidator tests to use StatusLengthValidator::MAX_CHARS to derive the length of the strings tested, and so makes them resilient to changes in MAX_CHARS (such as the one that made these tests fail, with it being changed from 500 to 512). This seems a bit odd for some types of tests, but appears to make sense here, where the testing goes beyond `status.length > MAX_CHARS`. Fix CharacterCount in vanilla UI (mastodon#1883)
Using the environment variable MAX_STATUS_CHARS. Based on mastodon#5697
|
I said this in another issue but I have no problem saying it here. Many Blind instance administrators want this, especially because it is easier to read one lengthy post than 60 posts broken up into a thread and Blind instance admins want to cultivate a space dedicated to their users needs. |
Make character limit configurable. Return character limit in API and initial state. Handle character limit in initial state in frontend. Code style fixes. Rename MAX_CHARS to MAX_TOOT_CHARS to be more specific. Fix StatusLengthValidator tests This fixes the StatusLengthValidator tests to use StatusLengthValidator::MAX_CHARS to derive the length of the strings tested, and so makes them resilient to changes in MAX_CHARS (such as the one that made these tests fail, with it being changed from 500 to 512). This seems a bit odd for some types of tests, but appears to make sense here, where the testing goes beyond `status.length > MAX_CHARS`. Fix CharacterCount in vanilla UI (mastodon#1883)
Make character limit configurable. Return character limit in API and initial state. Handle character limit in initial state in frontend. Code style fixes. Rename MAX_CHARS to MAX_TOOT_CHARS to be more specific. Fix StatusLengthValidator tests This fixes the StatusLengthValidator tests to use StatusLengthValidator::MAX_CHARS to derive the length of the strings tested, and so makes them resilient to changes in MAX_CHARS (such as the one that made these tests fail, with it being changed from 500 to 512). This seems a bit odd for some types of tests, but appears to make sense here, where the testing goes beyond `status.length > MAX_CHARS`. Fix CharacterCount in vanilla UI (mastodon#1883)
|
I wanted to add another reason for this that I don't think has been mentioned yet: I'm using managed Mastodon hosting for my instance. In this situation, I can't reasonably expect my host to apply a hack for just me. |
I have the same situation. It's a shame that PR was shut down, it could have been really useful for dozens of admins who use managed hosting for their instances |
Using the environment variable MAX_STATUS_CHARS. Based on mastodon#5697
Make character limit configurable. Return character limit in API and initial state. Handle character limit in initial state in frontend. Code style fixes. Rename MAX_CHARS to MAX_TOOT_CHARS to be more specific. Fix StatusLengthValidator tests This fixes the StatusLengthValidator tests to use StatusLengthValidator::MAX_CHARS to derive the length of the strings tested, and so makes them resilient to changes in MAX_CHARS (such as the one that made these tests fail, with it being changed from 500 to 512). This seems a bit odd for some types of tests, but appears to make sense here, where the testing goes beyond `status.length > MAX_CHARS`. Fix CharacterCount in vanilla UI (mastodon#1883)
|
I would like to wonder how do people comment here even through the issue is already closed? |
Closed issues only mean the issue is considered closed. Maintainers can choose to lock an issue which is another thing. |
|
Make character limit configurable. Return character limit in API and initial state. Handle character limit in initial state in frontend. Code style fixes. Rename MAX_CHARS to MAX_TOOT_CHARS to be more specific. Fix StatusLengthValidator tests This fixes the StatusLengthValidator tests to use StatusLengthValidator::MAX_CHARS to derive the length of the strings tested, and so makes them resilient to changes in MAX_CHARS (such as the one that made these tests fail, with it being changed from 500 to 512). This seems a bit odd for some types of tests, but appears to make sense here, where the testing goes beyond `status.length > MAX_CHARS`. Fix CharacterCount in vanilla UI (mastodon#1883)
This adds a character limit configurable by setting and environment variable. It also adds the character limit to the initial state and instance endpoint, so clients can use it to set the correct limit.
Default is still 500 characters if no other value is set.
This relates to #5693 and #4915.