Page MenuHomePhabricator

Consider a way to turn off live preview in DiscussionTools' wikitext source mode
Open, Needs TriagePublic

Description

Some people find the live preview uncomfortable.[1].

It also might not be entirely useful if you are on a slow connection. For this reason Realtime Preview automatically disables itself if it detects a slow connection. See https://github.com/wikimedia/mediawiki-extensions-WikiEditor/blob/master/modules/realtimepreview/RealtimePreview.js#L291

Additionally, there are some accessibility concerns. It could be argued that automatic updating preview is not, but should be, respecting prefers reduced motion settings:

window.matchMedia('(prefers-reduced-motion: reduce)').matches === true

See also: T314787

Event Timeline

Could it be turned off or hidden via a CSS user script?

It can be hidden with

.ext-discussiontools-ui-replyWidget-preview {
	display: none;
}

(it’s called replyWidget in the New Topic Tool as well)—but then you don’t have preview at all, since there’s no separate manual preview. The only way to preview the content is switching to visual mode; Flow does this when you click the “preview” link, but I don’t consider it a real preview due to the sometimes lossy nature of the wikitext→HTML→conversion and because it’s sometimes not even possible to switch to visual mode in the reply tool (e.g. when a template is present).

Just a note that one user specifically requested this for prefers-reduced-motion accessibility reasons.

window.matchMedia('(prefers-reduced-motion: reduce)').matches === true
HLHJ subscribed.

A way to turn off live preview, say by a radio button next to the word "Preview", should probably also allow discrete previews on request, maybe by clicking on the word "Preview" itself, as with the current button for markdown editing.