User:DWalden (WMF)/WikiEditor/Insert link/State model

From mediawiki.org

A state diagram representing some of the states of the WikiEditor's "Insert link" dialog, and how you can transition from one state to the next.[1]

States[edit]

"Internal link - empty"[edit]

The "default" view, when you first open the dialog in an edit session.

"External link - empty"[edit]

After selecting the radio button "To an external web page", but before you have entered anything in the input.

"Invalid input field 1"[edit]

  • Validation is performed on your input and, if it is invalid, the dialog will show a validation message.
  • Validation should only be done when you have the "To a wiki page" radio selected - i.e. you are entering an internal link.

"Internal link - Field 1 filled"[edit]

  • The state after you have entered a valid page name.
  • At this point, it performs a search for that page name on the wiki, and will show a dropdown of results.
    • There is a short intermediate state while the dialog is waiting for results.

"External link - Field 1 filled"[edit]

The state after you have entered an external link.

"Search selected"[edit]

When you type in a page, it does a search for that page on the wiki. When you select one of the results, it might tell you something like "this link is a disambiguation page" or "this link does not exist on this wiki".

"Looks like internal"[edit]

If you enter an external link that is the full URL of the current wiki (e.g. https://www.mediawiki.org/wiki/Page) and submit, it will open another dialog which will allow you to convert it into an internal link.

"Link not inserted"[edit]

  • If you close the dialog without inserting a link.
  • This saves the state of the dialog.

"Link inserted"[edit]

When you submit the dialog and it actually inserts the wikitext into the editor.

Notes[edit]

  • There are at least two "broken" states which I have chosen not to represent in this diagram, just because they would make it much more complicated. These states have bugs associated with them: phab:T298549, phab:T297371.

References[edit]

  1. For more on using state diagrams in testing, see Hendrickson, Elisabeth (2013). Explore It! Reduce Risk and Increase Confidence with Exploratory Testing. The Pragmatic Bookshelf. Chapter 8.