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

Make character limit configurable #5697

Conversation

lambadalambda
Copy link

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.

Copy link
Contributor

@ClearlyClaire ClearlyClaire left a 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.

@@ -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
Copy link
Contributor

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).

Copy link
Author

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

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…

Copy link
Author

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?

Copy link
Contributor

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.

@Gargron
Copy link
Member

Gargron commented Nov 16, 2017

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.

@lambadalambda
Copy link
Author

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.

@ddevault
Copy link
Contributor

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.

👎

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.

@connyduck
Copy link
Contributor

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.
Maybe the limit should not be configurable arbitrarly but only within a sensible limit like 140 -10 000.

@Lertsenem
Copy link

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.

beatrix-bitrot added a commit to glitch-soc/mastodon that referenced this pull request Nov 18, 2017
…e-status-size

Make character limit configurable (from mastodon#5697)
@akihikodaki
Copy link
Contributor

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.

@lambadalambda
Copy link
Author

@Gargron Can you please either merge or close this?

@wxcafe
Copy link
Contributor

wxcafe commented Mar 29, 2018

Up @Gargron

@ghost
Copy link

ghost commented Apr 8, 2018

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.

@Shreewebs
Copy link

I am looking to increase TOOT character count to 600. It seems file .env.production.sample no longer has such options open.
Looking for a tweak!
Thank you

@Grawl
Copy link
Contributor

Grawl commented Jan 31, 2020

just did it in my fork Grawl@3fd85bc

@tyteen4a03
Copy link

Are there any scripts to work around this?

@r3d-f0x
Copy link

r3d-f0x commented Sep 1, 2021

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

As a compromise, how about hard coding that toot with more than 500 chars get automatically wrapped in a CW with an ellipsis?

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.

@itbeard
Copy link

itbeard commented Nov 27, 2022

Hello! @Gargron maybe in 2022 it makes sense to reconsider your decisions about this feature?

Mathspy pushed a commit to Mathspy/mastodon that referenced this pull request Nov 27, 2022
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)
vidister pushed a commit to mystical-garden/mastodon that referenced this pull request Mar 3, 2023
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)
christianp added a commit to christianp/mastodon that referenced this pull request Mar 3, 2023
Using the environment variable MAX_STATUS_CHARS.

Based on mastodon#5697
@rkingett
Copy link

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.

Mathspy pushed a commit to Mathspy/mastodon that referenced this pull request May 30, 2023
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)
Mathspy pushed a commit to Mathspy/mastodon that referenced this pull request Jul 8, 2023
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)
@JiFish
Copy link

JiFish commented Jul 17, 2023

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.

@itbeard
Copy link

itbeard commented Jul 18, 2023

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

christianp added a commit to christianp/mastodon that referenced this pull request Sep 23, 2023
Using the environment variable MAX_STATUS_CHARS.

Based on mastodon#5697
vidister pushed a commit to mystical-garden/mastodon that referenced this pull request Oct 4, 2023
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)
@expertmanofficial
Copy link

I would like to wonder how do people comment here even through the issue is already closed?

@tyteen4a03
Copy link

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.

@yawnbox
Copy link

yawnbox commented Aug 16, 2024

  1. Please give communities freedom to choose how much their profiles can say, without hacks.
  2. Please lower the bar for admins so the diversity of admins increases.

Mathspy pushed a commit to Mathspy/mastodon that referenced this pull request Sep 23, 2024
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.