Last modified: 2014-03-28 19:07:01 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T39901, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37901 - VisualEditor: Links are not shown as redlinks when their target is blank (or as 'stub-alternate-colour' if appropriate)
VisualEditor: Links are not shown as redlinks when their target is blank (or ...
Status: RESOLVED FIXED
Product: VisualEditor
Classification: Unclassified
ContentEditable (Other open bugs)
unspecified
All All
: High enhancement
: VE-deploy-2014-03-20
Assigned To: Roan Kattouw
:
: 49475 50020 50974 52173 56442 (view as bug list)
Depends on:
Blocks: 50497 62803 48984
  Show dependency treegraph
 
Reported: 2012-06-24 19:22 UTC by James Forrester
Modified: 2014-03-28 19:07 UTC (History)
30 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description James Forrester 2012-06-24 19:22:16 UTC
To show red links (and stub links) correctly, Parsoid will need to hint on each link as to the status of its target. Also some work in CE and UI. ;-)
Comment 1 Gabriel Wicke 2012-06-24 20:07:50 UTC
So far my idea is to keep link existence checks out of Parsoid, and add the colors from JS or CSS instead. This should avoid some parser cache invalidations and makes the parser output less dependent on user preferences.

To do this, a data structure with the status of all outgoing links in a page would need to be fetched separately. This could be a JSON structure, or a CSS file that directly matches some target-hash-based classes on links.

Doing the same for media or images would be harder, and is not something we plan to do right now. We'll instead render them normally, and perform the existence check in the parser while retrieving the image dimensions.
Comment 2 matanya 2013-04-25 21:12:24 UTC
It is actually shown as blue links which are considered to be existing pages. This is confusing.  I understand the parsoid isn't doing existence checks at all, so better use a natural color for all links.
Comment 3 James Forrester 2013-06-12 14:56:56 UTC
*** Bug 49475 has been marked as a duplicate of this bug. ***
Comment 4 Bartosz Dziewoński 2013-06-22 14:40:53 UTC
*** Bug 50020 has been marked as a duplicate of this bug. ***
Comment 5 This, that and the other (TTO) 2013-07-09 07:12:09 UTC
*** Bug 50974 has been marked as a duplicate of this bug. ***
Comment 6 Gabriel Wicke 2013-07-09 16:08:22 UTC
This can be implemented with a generated CSS file containing attribute selectors matching red link targets like this:

a[href="./Foo"],
a[href="./Bar"] { color: red }

Alternatively a JSON file containing the redlink targets could be fetched and a redlink class set on each of them. CSS seems to be the more elegant solution without a need for JS and DOM changes though.

In the longer term this is something we should implement for core too.
Comment 7 Inez Korczyński 2013-07-11 15:18:30 UTC
Normally, in article view mode, redlinks have CSS class "new" and I'm suggesting doing it in the same way for the sake of consistency.
Comment 8 Gabriel Wicke 2013-07-11 15:20:54 UTC
We don't want to encode this information in the DOM to avoid cache updates for the page content. There is really no need to do so since CSS selectors work well these days, and purging / regenerating CSS is much cheaper than updating page content.
Comment 9 Francisco 2013-07-26 10:55:01 UTC
Would it be possible also to make other kinds of pages to appear in different colours, by changing CSS pages on the local wikis? I know that some wikis have different colours for redirects (green), others make links to disambiguation pages appear highlighted in yellow.
Comment 10 Chris McKenna 2013-07-31 20:39:10 UTC
There has just been another editor on en.wp requesting this functionality. 

(In reply to comment #9)
> Would it be possible also to make other kinds of pages to appear in different
> colours, by changing CSS pages on the local wikis? I know that some wikis
> have
> different colours for redirects (green), others make links to disambiguation
> pages appear highlighted in yellow.

That is bug 52173. Although there was some discussion about whether that was a duplicate of this the consensus seemed to be that it wasn't.
Comment 11 James Forrester 2013-07-31 20:46:12 UTC
*** Bug 52173 has been marked as a duplicate of this bug. ***
Comment 12 James Forrester 2013-07-31 20:48:33 UTC
(In reply to comment #10)
> There has just been another editor on en.wp requesting this functionality. 
> 
> (In reply to comment #9)
> > Would it be possible also to make other kinds of pages to appear in different
> > colours, by changing CSS pages on the local wikis? I know that some wikis
> > have
> > different colours for redirects (green), others make links to disambiguation
> > pages appear highlighted in yellow.
> 
> That is bug 52173. Although there was some discussion about whether that was
> a duplicate of this the consensus seemed to be that it wasn't.

That bug was asking for the same problem to be fixed, but was suggesting a different technical solution (and one which is a WONTFIX from the Parsoid team, as it makes the cached pages get invalidated by other pages getting created/deleted/expanded out of the stub threshold/made into/out of a redirect/made into/out of a disambiguation page). Sorry for the confusion.
Comment 13 vssun 2013-08-18 03:35:00 UTC
Right now the linking problems detected only after saving the page. So please raise the importance of this bug and fix it on priority.
Comment 14 John Broughton 2013-08-31 02:57:00 UTC
This is an 80/20 issue - 80% of the value comes from fixing just the coloring of internal wikilinks. Coloring of external links isn't critical. (There can be significant time-delay in getting 404 or similar error codes for page non-existence, as well as false negatives when a website is temporarily down.) And of the internal wikilinks, most of the value is redlinks, some of the value is disambiguation pages, and little of the value is stubs (which, again, are subject to false positives, since article assessments aren't automated).

In short, the priority ought to be to code internal wikilinks that go to non-existent pages (as red), and internal wikilinks that go to disambiguation pages (as yellow, I think), and not to worry all that much about anything else.
Comment 15 Quiddity 2013-08-31 06:18:26 UTC
(In reply to comment #14)
> This is an 80/20 issue - 80% of the value comes from fixing just the coloring
> of internal wikilinks. Coloring of external links isn't critical.


I don't think anyone suggested (or has ever implemented?) coloring of external links. They only change color based on your browser settings, for clicked/unclicked links (essentially).


> And of the internal wikilinks, most of the value is redlinks, some of the
> value
> is disambiguation pages, and little of the value is stubs (which, again, are
> subject to false positives, since article assessments aren't automated).


Stubs are colored based on byte-count, not whether they're tagged-as-a-stub. You can change the byte-count in your [[special:preferences]], under "Appearance->Threshold for stub link formatting (bytes):[dropdownmenu]"


> In short, the priority ought to be to code internal wikilinks that go to
> non-existent pages (as red), and internal wikilinks that go to disambiguation
> pages (as yellow, I think), and not to worry all that much about anything
> else.


Agreed that only redlinks are crucial. 

For disambig links, possibly the new Property system can help?
https://en.wikipedia.org/wiki/Special:PagesWithProp?propname=disambiguation&propname-other=

For anything more complex than that, Anomie's Linkclassifier code might be useful/insightful. 300+ users have it installed. I recommend the "run on demand" version. https://en.wikipedia.org/wiki/User:Anomie/linkclassifier
code at https://en.wikipedia.org/wiki/User:Anomie/linkclassifier.js
Comment 16 James Forrester 2013-08-31 14:36:16 UTC
(In reply to comment #14)
> This is an 80/20 issue - 80% of the value comes from fixing just the coloring
> of internal wikilinks. Coloring of external links isn't critical. (There can
> be
> significant time-delay in getting 404 or similar error codes for page
> non-existence, as well as false negatives when a website is temporarily
> down.)
> And of the internal wikilinks, most of the value is redlinks, some of the
> value
> is disambiguation pages, and little of the value is stubs (which, again, are
> subject to false positives, since article assessments aren't automated).
> 
> In short, the priority ought to be to code internal wikilinks that go to
> non-existent pages (as red), and internal wikilinks that go to disambiguation
> pages (as yellow, I think), and not to worry all that much about anything
> else.

The solution we're considering is a service that, given an array of links, returns a set of CSS selectors that VE applies to the page, to give the appropriate hinting on links.

To be very specific, we are talking about:

* Internal links
** If the page does not exist, colour it red
** If the page does exist but is a disambiguation page, colour it yellow
** If the page does exist but is under (arbitrary) stub threshold, colour it purple
** Elsewise, colour it dark blue

* External links
** If the link is to a wiki that is "internal" (i.e., an interwiki), colour it mid-blue
** Elsewise, colour it mid-blue with an "external link" icon.

It is a mistake to think that doing this but only for internal link state and only for existence/non-existence is 20% of the work for 80% of the gain; it's much more like 90% of the work for 80% of the gain. :-) Building the service itself is definitely the hard part of this.
Comment 17 pamdavies7 2013-09-01 22:13:30 UTC
(In reply to comment #16)

> * Internal links
> ** If the page does not exist, colour it red
> ** If the page does exist but is a disambiguation page, colour it yellow
> ** If the page does exist but is under (arbitrary) stub threshold, colour it
> purple
> ** Elsewise, colour it dark blue

If the link is a redirect, will the system pick up the properties of the target page or just code it as a stub because it's short? (Target could be a dab page, stub, or normal page).
Comment 18 Jonathan Haas 2013-09-02 06:33:49 UTC
(In reply to comment #16)
> * Internal links
> ** If the page does not exist, colour it red
> ** If the page does exist but is a disambiguation page, colour it yellow
> ** If the page does exist but is under (arbitrary) stub threshold, colour it
> purple
> ** Elsewise, colour it dark blue

Don't forget about redirection pages. In some Wikipedia's it is probably bad practice to link them. In german Wikipedia, it's okay to link them, but only if the link target makes more sense than the main page title. So in any case it's nice to see that the link target is a redirect. A bonus would be a tooltip which shows the page the redirect redirects to.

(In reply to comment #6)
> This can be implemented with a generated CSS file containing attribute
> selectors matching red link targets like this:
> 
> a[href="./Foo"],
> a[href="./Bar"] { color: red }

This is a really horrible idea. About 5% of the population are color blind, you really don't want to hardcode colors like this in any way. If embedding this information in the page source is technically impossible for whatever reason, then load a list of external pages using JS and add css classes or other attributes on the fly.
Comment 19 James Forrester 2013-11-01 03:44:22 UTC
*** Bug 56442 has been marked as a duplicate of this bug. ***
Comment 20 Amir E. Aharoni 2013-11-25 08:43:58 UTC
Changing importance to "Normal". Even though it's not a regression compared to the source editor, common sense says that it should be a basic feature of VE and not an "Enhancement".
Comment 21 James Forrester 2013-11-25 08:47:18 UTC
Revert. Lots of "basic" features are enhancements. Bugs are "this should already be working and its lack of presence is a code failure". Noting however that this is high priority.
Comment 22 Gerrit Notification Bot 2014-03-11 01:22:30 UTC
Change 118045 had a related patch set uploaded by Jforrester:
[WIP] Red link support

https://gerrit.wikimedia.org/r/118045
Comment 23 Gerrit Notification Bot 2014-03-18 21:45:40 UTC
Change 118045 had a related patch set uploaded by Jforrester:
[WIP] Red link support

https://gerrit.wikimedia.org/r/118045
Comment 24 Gerrit Notification Bot 2014-03-20 02:44:24 UTC
Change 118045 merged by jenkins-bot:
Display links to nonexistent pages as red

https://gerrit.wikimedia.org/r/118045
Comment 25 pamdavies7 2014-03-20 16:42:59 UTC
It doesn't seem to be resolved. I found https://en.wikipedia.org/wiki/Demented_Are_Go#Studio_albums by hitting "Random article" until I found a redlink, tried to edit it in VE, and the red link ("Welcome back to Insanity Hall ") looked blue. Am I missing something?

In case it was any of my settings, I tried again using my (declared) alternative account which has default settings for everything: went to preferences to enable VE, tried editing that article, still a blue link.
Comment 26 James Forrester 2014-03-20 16:44:36 UTC
(In reply to pamdavies7 from comment #25)
> It doesn't seem to be resolved. I found
> https://en.wikipedia.org/wiki/Demented_Are_Go#Studio_albums by hitting
> "Random article" until I found a redlink, tried to edit it in VE, and the
> red link ("Welcome back to Insanity Hall ") looked blue. Am I missing
> something?
> 
> In case it was any of my settings, I tried again using my (declared)
> alternative account which has default settings for everything: went to
> preferences to enable VE, tried editing that article, still a blue link.

The code is not yet deployed to the English Wikipedia. It will be deployed today to MediaWiki.org (hence the date in the "milestone"), and to the English Wikipedia in a week, following the regular schedule.
Comment 27 Ricordisamoa 2014-03-28 19:07:01 UTC
Verified, working fine on the English and Italian Wikipedias.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links