Page MenuHomePhabricator

Clarify what happens to drafts when switching between New Discussion Tool and legacy
Closed, ResolvedPublic

Description

T293962 implements a "hint" that enables people to switch between the New Discussion Tool and the existing section=new experience.

This task involves the work with clarifying how – if at all – drafted text in either experience will be saved when switching back and forth between the two.

Behavior

  1. Open the New Discussion Tool for the first time on a wiki where it's just been made available by default
  2. Type some text into the Title or Description field
  3. Click the switch back to the legacy experience link that appears in the "hint" above the Title text field
  4. Notice the browser presents a dialog that asks: Leave site? Changes you made may not be saved.
  5. Click Leave
  6. Arrive in the legacy section=new experience
  7. Type some text into the Subject: or description fields
  8. Click the return to the new experience link that appears in the "hint" above the Subject: text field

Actual

  1. ❗️ Arrive back in the New Discussion Tool and notice the text you typed in "Step 2." reappears
  2. Click the switch back to the legacy experience link that appears in the "hint" above the Title text field because you realize that you actually do want to use that experience instead of the New Discussion Tool
  3. ❗️Notice the form appears empty. Said another way: the text you entered in "Step 7." does NOT appear

...it is the inconsistency in "Step 9." and "Step 11.", and the confusion/unmet expectations we anticipate it will cause people, that's leading us to document this issue.

Desired

  1. ✅ Arrive back in the New Discussion Tool and notice the text you typed in "Step 2." does NOT appear
  2. Click the switch back to the legacy experience link that appears in the "hint" above the Title text field because you realize that you actually do want to use that experience instead of the New Discussion Tool
  3. ✅Notice the form appears empty. Said another way: the text you entered in "Step 7." does NOT appear
NOTE: the above should only be implemented within the New Discussion Tool hint experience (T293962). Other New Discussion Tool contexts should NOT be impacted.

Approaches

Below are the approaches we considered for setting a clear expectation that the changes people make within the New Discussion Tool or legacy section=new experience will NOT be saved when switching back and forth between the two.

Approach #1: OOUI Dialog

  • Show the Are you sure? OOUI dialog [i] AND explicitly discard the changes people will have made in "Step 2." and/or "Step 7."

Approach #2: *Modified* OOUI Dialog

  • Show a = version of the Are you sure? OOUI dialog adapted to this context AND explicitly discard the changes people will have made in "Step 2." and/or "Step 7."
    • By "adapted" I mean changing the copy that appears within the dialog so people know they are discarding the topic they've written *in order to* switch to the legacy experience. The existing dialog's copy makes no reference to switching interfaces.

Approach #3. Browser Dialog

  • Continue showing the browser's Are you sure? dialog AND explicitly discard the changes people will have made in "Step 2." and/or "Step 7."

Note: that in implementing one of the approaches above we are creating the potential for people to wonder why the New Discussion Tool saved changes they've made when navigating away from the New Discussion Tool in subsequent uses despite it not doing so the first time they used it. We are okay with this potential because we think: 1) most people would be pleased to learn the tool recovered changes they thought were lost and 2) in this "first use" case, the tool will have informed people the changes they made will NOT be saved.

Done

  • "Desired" behavior is implemented

i.

Screen Shot 2022-01-14 at 6.44.04 PM.png (1×1 px, 158 KB)

ii.
Screen Shot 2022-01-14 at 6.50.48 PM.png (516×614 px, 170 KB)

Event Timeline

@iamjessklein: what – if any – concerns do you have about moving forward with the "Desired" behavior described in the task description as a first step?

cc @DLynch @matmarex

It'd be a little simpler to keep it constant -- always throw away the autosave when someone confirms they want to leave. That said, it's still entirely doable either way.

Approach #3 is the most practical -- the browser dialog is useful because it can interrupt a user attempting to navigate away. The OOUI dialog isn't blocking, and so can't step into the middle of navigation.

It'd be a little simpler to keep it constant -- always throw away the autosave when someone confirms they want to leave. That said, it's still entirely doable either way.

Excellent. To start, let's limit the "Desired" behavior described in the task description to the New Discussion Tool "hint" experience (T293962).

I've added a note communicating as much to the ===Requirements section to make this explicit.

...the browser dialog is useful because it can interrupt a user attempting to navigate away. The OOUI dialog isn't blocking, and so can't step into the middle of navigation.

Good call. I attempted to translate "Approach #3" into requirements in the task description's ===Requirements section. Please let me know if it brings any new questions to mind.

Next steps
In the meantime, I'm assigning this task over to @iamjessklein to review the UX the task description's ===Requirements section is proposing we implement.

This looks good.
I assume when you say ===Requirements you mean to say ===Approaches @ppelberg?

+1 to moving forward with the desired behavior. @DLynch please ping me when there's something to review.

This looks good.

To be doubly sure, would it be accurate for me to think when you say "this" you are referring to the "Desired" behavior in description's ===Behavior section?

I assume when you say ===Requirements you mean to say ===Approaches @ppelberg?

Argh, I meant to say ===Behavior.

Change 757694 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/DiscussionTools@master] Clear autosave when following links from the legacy hint

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

Note there's a side-effect to this which I hadn't considered until implementing it: if you follow the link to legacy and then go back, the new-topic widget won't reopen. This is because the thing that triggers it reopening when you navigate to the page is the presence of the autosaved data.

Note: That's specific to navigating-back via browser navigation. If you follow the link from the old editor it'll reopen, because that link includes the section=new parameter in the URL.

Note there's a side-effect to this which I hadn't considered until implementing it: if you follow the link to legacy and then go back, the new-topic widget won't reopen. This is because the thing that triggers it reopening when you navigate to the page is the presence of the autosaved data.

Note: That's specific to navigating-back via browser navigation. If you follow the link from the old editor it'll reopen, because that link includes the section=new parameter in the URL.

As discussed offline during today's team meeting, we will not be addressing the case @DLynch identified above, for now. If/when this behavior proves to be problematic, we will prioritize work to design a better experience for it.

For future reference, Bartosz described some of the issues we might have to think about if we want to update the URL via history APIs when we open the topic tool here: https://phabricator.wikimedia.org/T282204#7243340

Change 757694 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Clear autosave when following links from the legacy hint

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

matmarex renamed this task from Clarify what happens to drafts when switching b/w New Discussion Tool and legacy to Clarify what happens to drafts when switching between New Discussion Tool and legacy.Jan 31 2022, 8:35 PM

It's not clear why I have been added to this task.