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

Expose the channel's max text length #9590

Closed
novialriptide opened this issue Dec 4, 2022 · 6 comments · Fixed by #10305
Closed

Expose the channel's max text length #9590

novialriptide opened this issue Dec 4, 2022 · 6 comments · Fixed by #10305

Comments

@novialriptide
Copy link

A follow-up issue from ppy/osu#21330, in order to fix this, we need to expose the channel's max text length to have different max lengths for different chat text boxes as said by @bdach ppy/osu#21397 (comment).

'message_length_limit' => get_int(env('CHAT_MESSAGE_LENGTH_LIMIT')) ?? 100,

@bdach
Copy link
Contributor

bdach commented Dec 4, 2022

The reason why I proposed exposing this is to allow for client-side validation of the message length. Currently it is not possible to know in advance what that max length is, as it depends on the envvar mentioned above, and apparently on the channel itself, too, since as far as I can tell, announce channels are exempt from it anyways.

@peppy
Copy link
Member

peppy commented Dec 5, 2022

Rather than exposing, can we just change osu-web to auto-truncate like what bancho did?

@ghost
Copy link

ghost commented Dec 5, 2022

In my opinion it'd be better UX to have a char limit client-side anyways, so you'd know when your message will be truncated.

And for that, the character limit must be exposed

@novialriptide
Copy link
Author

novialriptide commented Dec 5, 2022

I feel as if auto-truncating would be mean to the user who typed a long message and didn't know about auto-truncating.

@peppy
Copy link
Member

peppy commented Dec 5, 2022

That would not be the case as messages should be resolved by the client with the actual final content.

@nanaya
Copy link
Collaborator

nanaya commented Dec 8, 2022

Adding the limit info in the channel json shouldn't be too difficult...

as a bonus osu-web frontend can use it as well as it's currently limited to 1k for all types to accommodate announce message

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 a pull request may close this issue.

4 participants