FIX: Ensure slow mode duration is correctly edited and displayed. (PR #10945)

This commit fixes a bug where you were forced to set hours, minutes, and seconds or you won’t be able to set the slow mode. Also, the duration was not displayed correctly due to the seconds not being truncated.

Additionally, we’ll always display the hours, minutes, and seconds inputs for clarity and remove the blue banner.

GitHub

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/post-rate-limit-trigger-for-a-topic-thats-heating-up/98294/66

Showing that input fields all the time feels weird to me. Why would I want to see or edit any of those fields when I just selected “1 week”? I’d prefer if it’s only visible when the custom option is selected.

I was thinking of something like this:

image

  • Uses labels instead of placeholders
  • Input fields only visible when custom option selected
  • Also, “Custom Duration” makes more sense to me than “Pick Duration”

The other fixes look fine to me.

My bad. I misunderstood your feedback.

No worries. My request probably was too confusing.

Small nitpick: The colon should be in the locale file instead of the template as it needs to be translatable as well.