Page MenuHomePhabricator

Add a link in VE: disable the editor
Closed, ResolvedPublic

Description

We want to only allow the user to manipulate link suggestions; we don't want to allow them to make any other changes. For that reason we'll have to disable the editor and remove the toolbar (except for the controls that the design calls for).

A disabled surface presumably wouldn't allow the selection to be changed by clicking in it, which might cause more selection management problems when dealing with the context (see also T267706: Add a link in VE: Use a permanent context instead of VE's built-in context). We would probably also need explicit code to make clicking on text annotated with a link suggestion navigate to that suggestion (right now this happens automatically because of the selection change it causes).

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

It looks like putting the surface in read-only mode works quite well for this. The only drawbacks I've found so far is that we have to toggle read-only mode when we want to change the acceptance status of a recommendation (but to avoid a flash in the UI, we can toggle only the DM surface), and that context items show a "View" button instead of an "Edit" button (but we can work around that for the link recommendation context item, and it's appropriate for the link context item).

Change 649590 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/GrowthExperiments@master] AddLink: Make the editor read-only

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

Change 649590 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] AddLink: Make the editor read-only

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

Etonkovidova claimed this task.
Etonkovidova subscribed.

Checked on testwiki (wmf.34). The following was checked

  • keyboard shortcuts
  • Page settings (etc) options
  • switching to the source editor and back