Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Codidact Meta!

Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.

Post History

75%
+4 −0
Q&A Handling too short comments padded with spaces

When starting a new comment thread, the "Create thread" button is disabled until the content of the "Your comment" text box has at least 15 characters. This character count includes leading and tra...

0 answers  ·  posted 2mo ago by trichoplax‭  ·  edited 2mo ago by trichoplax‭

Question bug user-experience
#2: Post edited by user avatar trichoplax‭ · 2024-03-18T18:22:16Z (2 months ago)
Mention that extra spaces may not always be deliberate
  • When starting a new comment thread, the "Create thread" button is disabled until the content of the "Your comment" text box has at least 15 characters. This character count includes leading and trailing spaces. However, leading and trailing spaces are removed after pressing "Create thread", which can make the comment become too short to be accepted.
  • When this problem occurs when adding a new comment to an existing thread, a red error message is displayed above the thread, so the user can try again:
  • ![Box with red background and message saying "Comment is too short (minimum is 15 characters)"](https://meta.codidact.com/uploads/wc5nzs1uzq13x8658zrjv2ns1qvn)
  • This is helpful, but the original message is removed so rather than typing an extra character, the user has to type out the whole message from scratch.
  • There is a larger problem when creating a new thread (rather than adding a comment to an existing thread). Instead of a helpful red message, there is just a 422 error page and no text box for the user to try again. This gives no indication of what went wrong:
  • ![Large 422 followed by the text "UNPROCESSABLE Your request couldn't be processed"](https://meta.codidact.com/uploads/0nz9x96vpv3f1l5gbjsg4ytl0nwd)
  • I have 2 suggestions to improve the user experience:
  • 1. Introduce the same behaviour for new threads as currently exists for new comments in existing threads: A red message making clear what went wrong ("Content is too short (minimum is 15 characters)" rather than a 422 page), and a text box allowing the user to try again.
  • 2. When the user is given the opportunity to try again, provide the previously entered text so the user does not have to type it all out again.
  • Better still would be to measure the comment length in a consistent way so that the mismatch does not happen. This could be done by deciding whether to enable the button based on the comment text stripped of any leading and trailing whitespace, rather than based on the full comment text. This way any text accepted by the front end (browser) will also be accepted by the back end (server).
  • I would expect this to be easier to implement than the 2 suggestions shown above, and better for the user, but the other 2 suggestions might still need to be implemented for users with JavaScript disabled in their browser.
  • When starting a new comment thread, the "Create thread" button is disabled until the content of the "Your comment" text box has at least 15 characters. This character count includes leading and trailing spaces. However, leading and trailing spaces are removed after pressing "Create thread", which can make the comment become too short to be accepted, not necessarily due to any fault of the user[^1].
  • When this problem occurs when adding a new comment to an existing thread, a red error message is displayed above the thread, so the user can try again:
  • ![Box with red background and message saying "Comment is too short (minimum is 15 characters)"](https://meta.codidact.com/uploads/wc5nzs1uzq13x8658zrjv2ns1qvn)
  • This is helpful, but the original message is removed so rather than typing an extra character, the user has to type out the whole message from scratch.
  • There is a larger problem when creating a new thread (rather than adding a comment to an existing thread). Instead of a helpful red message, there is just a 422 error page and no text box for the user to try again. This gives no indication of what went wrong:
  • ![Large 422 followed by the text "UNPROCESSABLE Your request couldn't be processed"](https://meta.codidact.com/uploads/0nz9x96vpv3f1l5gbjsg4ytl0nwd)
  • I have 2 suggestions to improve the user experience:
  • 1. Introduce the same behaviour for new threads as currently exists for new comments in existing threads: A red message making clear what went wrong ("Content is too short (minimum is 15 characters)" rather than a 422 page), and a text box allowing the user to try again.
  • 2. When the user is given the opportunity to try again, provide the previously entered text so the user does not have to type it all out again.
  • Better still would be to measure the comment length in a consistent way so that the mismatch does not happen. This could be done by deciding whether to enable the button based on the comment text stripped of any leading and trailing whitespace, rather than based on the full comment text. This way any text accepted by the front end (browser) will also be accepted by the back end (server).
  • I would expect this to be easier to implement than the 2 suggestions shown above, and better for the user, but the other 2 suggestions might still need to be implemented for users with JavaScript disabled in their browser.
  • [^1]: In some cases this will be due to a user deliberately adding spaces to try to get around the 15 character minimum. However, this can also happen accidentally, particularly on mobile where the on screen keyboard adds a space after each word. A user may not always realise that their 14 character message has an automatically added space at the end bringing it up to 15 characters.
#1: Initial revision by user avatar trichoplax‭ · 2024-03-18T18:17:16Z (2 months ago)
Handling too short comments padded with spaces
When starting a new comment thread, the "Create thread" button is disabled until the content of the "Your comment" text box has at least 15 characters. This character count includes leading and trailing spaces. However, leading and trailing spaces are removed after pressing "Create thread", which can make the comment become too short to be accepted.

When this problem occurs when adding a new comment to an existing thread, a red error message is displayed above the thread, so the user can try again:

![Box with red background and message saying "Comment is too short (minimum is 15 characters)"](https://meta.codidact.com/uploads/wc5nzs1uzq13x8658zrjv2ns1qvn)

This is helpful, but the original message is removed so rather than typing an extra character, the user has to type out the whole message from scratch.

There is a larger problem when creating a new thread (rather than adding a comment to an existing thread). Instead of a helpful red message, there is just a 422 error page and no text box for the user to try again. This gives no indication of what went wrong:

![Large 422 followed by the text "UNPROCESSABLE Your request couldn't be processed"](https://meta.codidact.com/uploads/0nz9x96vpv3f1l5gbjsg4ytl0nwd)

I have 2 suggestions to improve the user experience:
1. Introduce the same behaviour for new threads as currently exists for new comments in existing threads: A red message making clear what went wrong ("Content is too short (minimum is 15 characters)" rather than a 422 page), and a text box allowing the user to try again.
2. When the user is given the opportunity to try again, provide the previously entered text so the user does not have to type it all out again.

Better still would be to measure the comment length in a consistent way so that the mismatch does not happen. This could be done by deciding whether to enable the button based on the comment text stripped of any leading and trailing whitespace, rather than based on the full comment text. This way any text accepted by the front end (browser) will also be accepted by the back end (server).

I would expect this to be easier to implement than the 2 suggestions shown above, and better for the user, but the other 2 suggestions might still need to be implemented for users with JavaScript disabled in their browser.