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



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.

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

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

"Invalid input field 1"

 * 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"

 * 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"
The state after you have entered an external link.

"Search selected"
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"
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"

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

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