Page MenuHomePhabricator

The feedback message around the title field validation should disappear after adding a topic name
Closed, ResolvedPublic

Description

Steps to replicate:

  1. Open the New Discussion Tool.
  2. Enter some text in the tool's Description field.
  3. Click the Add Topic button.
  4. At this point you will get the feedback message "Please provide a topic for your comment. If you click "Add topic" again, your comment will be added without a topic."
  5. Type something into the Topic field.

I feel at this point the feedback message should disappear, although I am not sure if it's possible to repaint the page at this point.

Event Timeline

Nice spot, @Ryasmeen and I agree that it would be ideal for the tool to function as you've described in the task description.

Adding @matmarex to help us understand: What is preventing the tool from being able to detect, in real-time, whether the Topic field is empty or not?

What is preventing the tool from being able to detect, in real-time, whether the Topic field is empty or not?

Nothing, we could easily do that.

I was wondering why we didn't do it that way in the first place, and apparently that decision was here: T243248#6514134

I agree that it's better to display (and hide) the warning immediately.

Forms where validation only happens after submitting are also common, but it's usually a technical limitation rather than intentional design (e.g. if the validation is slow and can't be done immediately, or if the form is unimportant and not worth the effort to validate each field separately rather than the whole form at once).

Change 660036 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/DiscussionTools@master] Update warning about missing topic title immediately

https://gerrit.wikimedia.org/r/660036

Providing timely feedback is good UX-wise, but I have two concerns:

  • What if the user writes a very long message and the warning gets out of view (or just doesn’t pay attention to the warning)? As the patch is written, lack of the title doesn’t prevent sending the message, not even once, so it’s quite possible that the topic will be sent without title in this case.
  • What if no blur event is intercepted? As indicated by the if ( title && !this.sectionTitle.getValue() ) line, it’s possible that the user has interacted with the title field before this code runs, which could include just clicking outside of it, so no blur occurs after setting up the event listener. Or am I wrong?

My idea is to keep checking the presence of a title at send time (including the click-twice-to-override behavior) in addition to checking at blurring, and give an extra notification to the user if they actually try to send the topic without a title (e.g. scroll into view and highlight the warning).

Change 660036 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Update warning about missing topic title immediately

https://gerrit.wikimedia.org/r/660036

@Tacsipacsi I think we're assuming that posting without a section title is not a big deal, and the warning is only a helpful reminder. If it is actually a big deal to post without a section title, then we should treat is as an error and not a warning, and not let you do that.

What if no blur event is intercepted? As indicated by the if ( title && !this.sectionTitle.getValue() ) line, it’s possible that the user has interacted with the title field before this code runs, which could include just clicking outside of it, so no blur occurs after setting up the event listener. Or am I wrong?

We focus the title field when opening the new topic widget, so you have to blur it to do anything else.

@Tacsipacsi I think we're assuming that posting without a section title is not a big deal, and the warning is only a helpful reminder. If it is actually a big deal to post without a section title, then we should treat is as an error and not a warning, and not let you do that.

It’s a pretty big deal: if one doesn’t specify a section title, the new section becomes part of the previous section. Power users may use it purposefully and appropriately (e.g. by subst’ing a template in the body that includes a section title), so it has legitimate use, but otherwise it just messes up the page.

We focus the title field when opening the new topic widget, so you have to blur it to do anything else.

Okay, understood.

It’s a pretty big deal: if one doesn’t specify a section title, the new section becomes part of the previous section. Power users may use it purposefully and appropriately (e.g. by subst’ing a template in the body that includes a section title), so it has legitimate use, but otherwise it just messes up the page.

We agree with you in thinking that by implementing soft vs. hard validation, we are increasing the likelihood that people could, unintentionally, publish a topic without a title and for that topic to become a part of the previous section.

If we observe this happening often [i], I think it makes sense to adjust the approach this ticket is implementing, as you've started to describe in T272543#6789217.


i. Here is a ticket for us to investigate how often people, specifically Junior Contributors, are posting topics with the New Discussion Tool without Titles.

After thinking about it some more, I'd like us to solve the problem of missing titles by automatically adding a title if the user leaves the field empty. I think I read that idea first in https://www.mediawiki.org/wiki/Topic:W06ewghi3zrb256z.

I'd like us to solve the problem of missing titles by automatically adding a title if the user leaves the field empty.

I don’t think it’s a good solution. The current solution is good for power users who want to do fancy things like substituting a template that generates the title or using non-<h2> titles (e.g. <h3>). If the tool automatically adds a title, this would result in two titles. In this case, why don’t just make non-empty title a hard requirement and force the user to write a meaningful title on their own? An auto-generated title will never be nearly as useful as a manual one.