Text reactions is a proposed software feature or gadget that enables the editor to react to what the user enters in the editing area. It was initially suggested as part of Wikipedia:Making editing easier 2021. Comments and suggestions are much welcome on the talk page.

Capabilities edit

A work-in-progress prototype is available at User:SD0001/text-reactions.js.

Text reactions are configured as a list of checks which are triggered in different ways:

Triggers edit

  • Time interval: Invoked every N seconds unconditionally.
  • Keypress: Every time a given key is pressed (powered by JS keyup event).
  • Word entry: Every time a given word is entered. This is an extension of the keypress trigger – equivalent to keypress of a word-delimiting character such as a space, period, comma, semi-colon, question mark or exclamation mark.
  • Reference insertion: Insertion of a reference via WP:RefToolbar or manual typing (the prototype currently covers only RefToolbar insertion).
  • Paste: Insertion of text via either copy-pasting or drag-and-drop (powered by JS paste and drop events).

On each trigger, the checks configured for that trigger are run, and any concerns are reported to the user in form of a small panel just above the textarea.

Usecases edit

This is a tentative list of what text reactions could be used for.

Some uses could be undesirable in the long-term. For example, alerting paid editors of the use of peacock language may lead them to avoid it – which may make it harder for editors to detect paid work. Each usecase should be individually discussed before actually being made live.

Deployment model edit

This feature is naturally implemented client-side using JavaScript rather than on the server side to avoid excessive data transfer.

The JavaScript could either be delivered via a MediaWiki extension or as a gadget. The list of text reactions should be fully configurable on-wiki, as policies and guidelines are different across wikis. This makes it suitable to exist as a gadget rather than as an extension, because extensions that require functional JS configurations are frowned upon. Since the feature is targeted at new editors, the gadget should be enabled by default, but needs to be available on just actions=edit.

Supported editors edit

  • 2010 wikitext editor (the "default" editor) – with or without syntax highlightening.
  • 2017 wikitext editor (Not currently supported in prototype implementation)
  • Mobile editor (source mode) (Not currently supported in prototype implementation)

VisualEditor support needs investigation, but is likely not feasible as it isn't text-based.

See also edit