Page MenuHomePhabricator

Warn people before they discard a new topic
Closed, ResolvedPublic

Description

This task is about showing people a warning dialog before closing/discarding the Topic they've drafted.

Behavior

  1. Visit: https://patchdemo.wmflabs.org/wikis/f6c284e009aa861712491b41d84fe464/w/index.php/Talk:Main_Page
  2. Open the New Discussion Tool by clicking the Add topic button
  3. Enter some text into the Topic field; do NOT enter any text into the Description field
  4. Press or click the red Cancel button/link within the tool

Actual

  1. ❗️Notice the New Discussion Tool closes, and the topic you started drafted in "Step 3." is lost, without warning

Expected

  1. ✅Notice the following warning appears: Are you sure? Are you sure you want to discard the topic you are writing?

Done

  • "Expected" behavior is implemented

Event Timeline

Done in patchset 15 of https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/623117 (it's easier for me to keep these in one change)

New demo wiki: https://patchdemo.wmflabs.org/wikis/6307a9de3d522c12e7daaa1bb7904435/w/index.php/Talk:Main_Page

(Also, fixed the topic field so that Enter and Escape keys work in it as expected)

This seems to be working for me:

Note: the dialog copy needs to be changed. This work will happen in: T264220.

(Also, fixed the topic field so that Enter and Escape keys work in it as expected)

  • @matmarex: can you share more details about what you consider to be "expected" in this context?

(Also, fixed the topic field so that Enter and Escape keys work in it as expected)

  • @matmarex: can you share more details about what you consider to be "expected" in this context?

Enter attempts to submit the message, and Escape attempts to discard the message. This is the same as the behavior of the comment summary field.

The copy in the dialog message does not seem to be showing as expected:

Actual

  1. ❗️ Are you sure you want to discard the comment you are writing?

Expected

  1. Are you sure? Are you sure you want to discard the topic you are writing?

Oops, I think I missed that at first, and then you said (T269190#6667258) that this will be done in a separate task. But it's probably better to do it now.

Change 656959 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/DiscussionTools@master] Separate dialog for abandoning a new topic

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

Change 656959 merged by jenkins-bot:
[mediawiki/extensions/DiscussionTools@master] Separate dialog for abandoning a new topic

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

Oops, I think I missed that at first, and then you said (T269190#6667258) that this will be done in a separate task.

You're right. I'm sorry for that confusion.

Either way, the copy looks good. [i]