[go: up one dir, main page]

Page MenuHomePhabricator

Linter: Display lint errors for a single page
Closed, ResolvedPublic

Description

  • Need a special page view that just shows a specific page
  • A special edit link that highlights all the lint errors (I'm imagining something like CodeEditor's warning/error system)

Event Timeline

We also need to expose this via the API, probably as a prop module so it can be combined with prop=revisions, so you can get the article content and lint errors in the same request.

I would like the functionality described in the second bullet, that is,

A special edit link that highlights all the lint errors (I'm imagining something like CodeEditor's warning/error system)

Whether that's in the form of a special page, or "collapsing" the links on the tables to one page linking to every error, or a new column in the output with a "all errors on page" link + rowspan, is not a big deal.

I think this has been implemented via LintHint, if I understand the feature request.

I think this has been implemented via LintHint, if I understand the feature request.

I'd like it native because I use WTE2017, which I do not believe LintHint supports.

The list=linterrors API already allows for this although a prop API would certainly be convenient. But neither is really user-friendly so the ability to filter on page name on Special:LintErrors would be quite useful.

Change 725155 had a related patch set uploaded (by Sbailey; author: Sbailey):

[mediawiki/extensions/Linter@master] WIP Linter: Display lint errors for a single page

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

Change 725155 merged by jenkins-bot:

[mediawiki/extensions/Linter@master] Linter: Display lint errors for a single page

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

Change 752702 had a related patch set uploaded (by Sbailey; author: Sbailey):

[mediawiki/extensions/Linter@master] All lint errors for a single page missing error detail label

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

Change 752727 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/extensions/Linter@master] Add a title for single page view

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

Change 752702 merged by jenkins-bot:

[mediawiki/extensions/Linter@master] All lint errors for a single page was missing error detail label

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

Change 752727 merged by jenkins-bot:

[mediawiki/extensions/Linter@master] Add a title for single page view

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

Could we have a link to this new feature in the action=info section that lists the number and categories and counts? As far as I see, it’s currently not linked from anywhere, which is not very good for discoverability…

The list might be overwhelming.

However, if there is any entry in action=info that should link to Special:LintErrors?pagename= as soon as the new feature is productive and stable.

action=info is actually showing a brief summary, which is fine for the purpose of that page.

I also asked for a link. Yes, hundreds of lint errors on action=info would be overwhelming, but a link wouldn’t hurt, and I think it should be part of this task, otherwise users won’t ever find this feature. (It’s okay to upload it as a WIP patch or put it behind a feature flag if you’re not comfortable showing it to users right now, but it should not get forgotten.)

Is the newish "Show all linter errors for a specific page" feature helping and providing most of what this ticket was requesting?
Other selection features are in the works (waiting on new fields being added to the linter table) such as namespace and template and tag allowing further narrowing of search results.

Where is the documentation showing how to use this feature, and comparing it to the existing LintHint script?

Having an easily accessed list for all the errors on a page is good, and one of the things asked for in the original task.

There was a second item which I agreed with, which was an edit link I can click that shows every lint error on the page so I can snag as many as I can at once. This is what Jonesey references (since that's what Linthint does). There may be some edit screen UI and/or CodeEditor massaging necessary for that.

Jonesey95 and Izno,
Thanks for your care and comments. The new all lints for a single page is located at the bottom of the special lints page and takes a page titles such as "User:Delta40" and returns all lints for that page in a list which allows you to use the edit button to take you to the highlighted area of the page wikitext source. To edit a bunch of errors on a single page, I suggest editing the last error first so that any insertion or deletion of characters happens below where other errors are still present, before Parsoid regenerates the linter error list (due to caching and timeouts, etc.). This feature was added so we have a native implementation that is similar to LintHint, but requires no special efforts on the editors part to setup and use LintHint. LintHint can also add more features that we arn't able to add for various reasons.
I'll look at where in the doc I should add some info about this new feature.

I added a brief description of the new feature "Show all linter errors for a specific page" in the help page for linter. Due to this page being translated, the guidance is to keep changes brief, but hopefully I have covered its use, caveat of syntax highlighting interfering with its highlighting, and how to work from bottom up to avoid changing character offsets.
If you feel I need to add something more, let me know.
Again thanks for your care and comments.

Jonesey95 and Izno,
I suggest editing the last error first so that any insertion or deletion of characters happens below where other errors are still present, before Parsoid regenerates the linter error list (due to caching and timeouts, etc.).

That... doesn't relate to wanting to remove all errors at the same time.

This feature was added so we have a native implementation that is similar to LintHint, but requires no special efforts on the editors part to setup and use LintHint. LintHint can also add more features that we arn't able to add for various reasons.

What features of LintHint can not be done and why? Particularly, some highlighting or indication of all on the page?

This feature was added so we have a native implementation that is similar to LintHint, but requires no special efforts on the editors part to setup and use LintHint. LintHint can also add more features that we arn't able to add for various reasons.

What features of LintHint can not be done and why? Particularly, some highlighting or indication of all on the page?

As inventor of lintHint I guess:

  • Cleaning a pile of errors within a single source edit.
    • That is what has been mentioned above: On multiple problems clear the last one first, then going upwards to start of text.
  • Automatic messaging if there is a problem within a visited page, even if not viewed for lint processing (option for frequent cleaners).
  • Re-analyse intermediate states of a source editing area, e.g. after removing a bunch of errors and check whether all gone.
  • Linter analysis after large regular edits before saving, to ensure that no new errors have been caused.
    • I terminate editing usually with lintHint as last action before saving when I made larger modifications.

There may be more tasks supported, but those are the most common ones.

I researched what it would take for a "stock" wikimedia install to provide a subset of the features of LintHint (all lint errors on a single page highlighted, possibly with mouse roll over category display in a popup bubble. The default editor in OOUI would need significant enhancements outside the scope of the project to provide a display of all lints for a single page like LintHint can already do. I looked into the VE wikitext editor and the alternative syntax highlighting editor available as a Beta feature when VE is installed. My goals recently are better search narrowing functionality and not to replace LintHint, or to provide all lint errors on a single page as highlighted regions. All lints for a single page is what LintHint provides with a very attractive UI, as a list of all errors in one pane as clickable links that jump to a highlighted text region. My goals have been to offer better stock search capabilities and the next patch in this group is a search box from the special lint page bottom that allows the editor to specify a title prefix and get all pages with any category lint error that matches the partial title prefix. This allows editors that have created a directory tree structure for all their pages in the title, can search for only those pages. For editors that want a more advanced all lints on a single page, LintHint is not too hard to enable for wikis with VE enabled.

Search for a specific page implemented in:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Linter/+/769772
Ability to display all lint errors in a single page provided by LintHint.