Page MenuHomePhabricator

Lint tooltips in CodeMirror sometimes make it complicated to edit
Open, Needs TriagePublic

Description

Linting in CodeMirror was introduced in T381577 and T407153.

Sometimes, when a code block contains too many errors, it becomes painful to edit that code block because of the many tooltips showing up when hovering.
See for example the video below:

Details

Event Timeline

Do you have any suggestions? How about limiting the number of displayed tooltips?

Yes, it could be helpful to limit the number of displayed tooltips and, if possible, to merge all 17 identical messages into a single one, indicating “×17”.
I think here there is also an issue with the positioning of tooltips in cases where a lint error originates from a template. This problem would persist even with a single tooltip. It would be preferable for tooltips to appear below the cursor—or in another location that does not obscure either the cursor or the content the user is trying to edit.

Yes, it could be helpful to limit the number of displayed tooltips and, if possible, to merge all 17 identical messages into a single one, indicating “×17”.

I did not realize that these many tooltips have identical ranges. Could you provide the link to this page so that we can further inspect it?

It would be preferable for tooltips to appear below the cursor—or in another location that does not obscure either the cursor or the content the user is trying to edit.

Unfortunately, we cannot control the tooltip positions when there are too many (ref).

The page in the video is https://fr.wikipedia.org/w/index.php?title=Saint-Lucien_%28Québec%29&section=10&action=submit. I did not mention it initially because the faulty template should be corrected soon and these lint errors will disappear.

Change #1203057 had a related patch set uploaded (by Bhsd; author: Bhsd):

[mediawiki/extensions/CodeMirror@master] Parsoid linter: deduplicate errors

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

Change #1203057 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] Parsoid linter: deduplicate errors

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