reddit-moderator-toolbox icon indicating copy to clipboard operation
reddit-moderator-toolbox copied to clipboard

Add ban_reason to modbutton

Open dequeued0 opened this issue 5 years ago • 12 comments

The ban_reason field is limited to 100 characters because it's only intended for a rule name or similar short reason.

The ban_note reason is intended for notes such as URLs, quoted text, etc. has a longer limit of 300 characters.

Please use the ban_note field instead of the ban_reason field so more information can be placed into the private note space.

I'd consider adding a pulldown menu for the ban_reason field similar to about/banned, but I'd request that it default to being completely blank so it wouldn't be required. It's faster to just type "r1", "r2", or whatever into the note field.

dequeued0 avatar Mar 10 '20 22:03 dequeued0

This is a good request. Adding a second text box and sending its contents to the API should be easy enough. We also have a helper function for fetching a subreddit's rules, so we could add a <datalist> to the existing text box to allow for autocompletion of sub rules.

eritbh avatar Mar 10 '20 22:03 eritbh

Thanks.

After further consideration and given that space is at such a premium, there may be more value in simply allowing the ban_reason space to be used as a text field which seems to be supported by the API (both parameters are simply joined with : between them and returned in later listings as a single note field). I don't think there are many moderators that prefer a reason like Self-promotional advertising or soliciting over a more succinct spam or r2 note.

Basically, just let moderators put what they want into both fields.

It may also help to limit the ban_reason and ban_note text input fields to 100 and 300 characters, respectively.

dequeued0 avatar Mar 11 '20 00:03 dequeued0

Yeah, I was planning on implementing the ban_reason field as a text field with autocompletes for the sub rules, but that would accept free-form content as well. Client-side character limits are a good idea.

Do you think it would be best to default ban_reason to a blank field or "Other"? The latter seems to be the default behavior in both old and new Reddit.

eritbh avatar Mar 11 '20 00:03 eritbh

I'd personally prefer a blank field. "Other" is just a waste of space and adds a step to remove or replace it.

The autocomplete would only happen if you hit the tab key?

I'd also consider changing the hint in the field to be a bit clearer for new moderators like (ban note for moderators) and similar for the ban_reason.

dequeued0 avatar Mar 11 '20 00:03 dequeued0

I guess it's less of an "autocomplete" and more of a suggestion, it'd work the same way as suggestions in the "subreddit" search field on profiles. It wouldn't complete anything for you, but it'd show the subreddit rules as suggestions when typing into the text field.

We'll definitely reword the input labels to be more consistent whenever we handle the rest of this.

eritbh avatar Mar 11 '20 00:03 eritbh

Practical question, which field shows in modmail?

creesch avatar Mar 11 '20 04:03 creesch

Both. Old reddit has the same behavior.

image image

eritbh avatar Mar 11 '20 04:03 eritbh

Alright, makes sense then to implement this. Wondering why we haven't done so earlier, probably because nobody really noticed as historically speaking there was only one field and they basically quietly added the second one.

I agree with the suggested implementation of two text fields with the suggested input.

One more consideration, should the ban "macro"* switch fields or be expanded to also allow for both fields to be prefilled?

*(we really should either make it a macro or just rename it to template)

creesch avatar Mar 11 '20 14:03 creesch

Wait what.... we already use the note field (which has the 300 character limit) and do nothing with the reason field.

So this is isn't about adding note field but about adding the ban_reason field?

Which makes the implementation slightly simpler as no things need to be switched around, but also means you get 100 additional characters instead of 300.

creesch avatar Mar 11 '20 14:03 creesch

Looking at the Toolbox code it looks like the trimmedBanReason (which is perhaps not the best variable name considering it's subsequently used for the ban_note and not the ban_reason) is being truncated to 99 characters which is what led me to believe it was due to Reddit's 100 character limit on the ban_reason.

To summarize what appears to be the current state: it looks like the longer field with the 300 character limit is being used already (with a confusing variable name), but Toolbox is truncating the input into that field to 99 characters for some unknown reason.

dequeued0 avatar Mar 11 '20 20:03 dequeued0

Ah I see what is happening, that is probably because it historically had that limit. Okay that clears up what is happening there. I'll edit the title to reflect this.

creesch avatar Mar 11 '20 21:03 creesch

Got another request today to implement this though the request here specifically asks about the option to select the site wide rules.

creesch avatar Dec 02 '20 15:12 creesch