VisualEditor: Make it hard for users to partially-select some unlinked text for linking
OpenPublic

Description

From bug T35091:

  • The UI of the visual editor should have a change to the user's interaction

with link creation to make it harder to accidentally create things like
<a>foo</a>bar.

I'm not quite sure what the ui change should be. Perhaps something like making
it so that when you try to create a link the selection might be altered to
cover the full word. Something that would require the user to force the editor
to use the selection that would create a <nowiki/> instead of just accepting it
as-is.

Whatever the case, we do not want the user who partially selects a run of text
and turns it into a link to inadvertently create a <nowiki/> when they likely
intended to make a link of the whole thing.

bzimport set Reference to bz37939.
Jdforrester-WMF created this task.Via LegacyJun 25 2012, 8:01 PM
Inez added a comment.Via ConduitJun 25 2012, 9:19 PM

I like the idea of expanding the selection (altering it) to cover the full word, however it still have to be possible to link just a part of the word (not sure how).

liangent added a comment.Via ConduitJun 26 2012, 12:12 AM

(In reply to comment #1)

I like the idea of expanding the selection (altering it) to cover the full
word, however it still have to be possible to link just a part of the word (not
sure how).

Link a whole word then unlink a part?

Inez added a comment.Via ConduitJun 26 2012, 12:19 AM

(In reply to comment #2)

(In reply to comment #1)
> I like the idea of expanding the selection (altering it) to cover the full
> word, however it still have to be possible to link just a part of the word (not
> sure how).

Link a whole word then unlink a part?

It is not very intuitive, but maybe we don't need this particular action to be intuitive.

G.Hagedorn added a comment.Via ConduitDec 13 2012, 11:09 AM

I would warn about automatic changes here. Partially linked words are a standard feature of Wikipedia, especially to link the singular substring of plural words in languages that generally allow that.

A nice-to-have feature may be to provide a dialogue box asking: "you have only marked a part of the word - do you want to link the entire word?".

I consider this a low priority enhancement however.

Jdforrester-WMF added a comment.Via ConduitDec 13 2012, 9:39 PM

(In reply to comment #4)

I would warn about automatic changes here. Partially linked words are a
standard feature of Wikipedia, especially to link the singular substring of
plural words in languages that generally allow that.

A nice-to-have feature may be to provide a dialogue box asking: "you have
only
marked a part of the word - do you want to link the entire word?".

I consider this a low priority enhancement however.

We're talking here about creating links as <a href=Foo>Fooian</a>, and whether or not they convert to "smart" wikitext ([[Foo]]ian) or to the more boring form ([[Foo|Fooian]]). We're not talking about automatic changes - if the link hasn't been edited, it shouldn't be changed.

I don't think that the style of wikitext that people create using the VisualEditor (as opposed to not breaking others' wikitext) is hugely important, but if you want that to be a specific change, you could create a new bug for Parsoid (which is responsible for the HTML->wikitext conversion).

This is specifically about creating a link (to whatever target) on some selection of part of a word, which then on being saved is converted unintentionally. I.e.:

Automobile -> <a href=Automatic>Auto</a>mobile -> [[Automatic|auto]]mobile

… whereas it should end up somehow as [[Automatic|auto]]<nowiki />mobile, or we should stop users for creating it.

G.Hagedorn added a comment.Via ConduitDec 13 2012, 9:51 PM

I really do not understand (my interaction with this bug was due to searching whether another bug was already reported).

I understand that "[[Automatic|auto]]mobile" will create a link on automobile, whereas "[[Automatic|auto]]<nowiki />mobile" creates a link only on auto.

However, the html conversion should work:
<a href=Automatic>Auto</a>mobile -> "[[Automatic|auto]]<nowiki />mobile"
<a href=Automatic>Automobile</a> -> "[[Automatic|automobile]]"
and
<a href=Auto>Automobile</a> -> "[[Auto]]mobile" (checking for true substring).

If the discussion is about whether to preserve
[[Automatic|auto]]mobile
over
[[Automatic|automobile]]
then I believe it should not be preserved, the first is unnecessarily complicated. These are things that are possible to "clean-up", particularly if, as you plan for the future, you clean-up only those parts that have been edited.

Thryduulf added a comment.Via ConduitJul 22 2013, 7:04 PM

What is the status of this bug? Currently it is not possible to link or unlink part of a word, nor to unlink part of a multi-word link.

Spinningspark added a comment.Via ConduitJul 25 2013, 5:14 PM

I fail to see the purpose of nowikiing the remainder of a partially linked word. If I link "LC circuit" in the string "LC circuits" then I expect the UI to create "[[LC circuit]]s", not "[[LC circuit]]</nowiki>s". That latter behaviour is entirely useless in any normal editing scenario I can think of.

The selection should not be expanded automatically. The UI should assume the editor knows what they are doing unless there is evidence to the contrary. When I make a partial selection like this it means I want the UI to offer "LC circuit" as the link target and display "LC circuits" as the link text.

Jdforrester-WMF added a comment.Via ConduitJul 25 2013, 5:28 PM

(In reply to comment #7)

What is the status of this bug? Currently it is not possible to link or
unlink part of a word, nor to unlink part of a multi-word link.

That's a very worrying problem - what browser are you using that makes this impossible? Does it happen on every page? When you say "impossible", do you mean that:

  • the link inspector doesn't open when fired on a partial selection,
  • setting the link on a partial selection doesn't cause a link to be added,
  • on saving the link on the partial selection, it doesn't turn into the expected wikitext, or
  • something else that I've not covered?

I can very much add and remove links to parts of words using the link inspector, and remove parts of existing links using the "clear formatting" button. Hence the issue.

Jdforrester-WMF added a comment.Via ConduitJul 25 2013, 5:32 PM

(In reply to comment #8)

I fail to see the purpose of nowikiing the remainder of a partially linked
word. If I link "LC circuit" in the string "LC circuits" then I expect the
UI
to create "[[LC circuit]]s", not "[[LC circuit]]</nowiki>s". That latter
behaviour is entirely useless in any normal editing scenario I can think of.

The selection should not be expanded automatically. The UI should assume the
editor knows what they are doing unless there is evidence to the contrary.
When I make a partial selection like this it means I want the UI to offer "LC
circuit" as the link target and display "LC circuits" as the link text.

That may be what you expect, with your deep understanding of wikitext, but it's very far from how normal visual editors work and so would be very confusing to users who are not immersed in the fine points of link trails.

More fundamentally, making a change in one place that magically affects another is a bad user experience. Why would this magic happen with links but not, say, adding bold? Why would this happen down-word but not up (except on wikis with linkhead instead of/as well as linktrail)? Etc.

Thryduulf added a comment.Via ConduitJul 25 2013, 6:21 PM

(In reply to comment #9)

(In reply to comment #7)
> What is the status of this bug? Currently it is not possible to link or
> unlink part of a word, nor to unlink part of a multi-word link.

That's a very worrying problem - what browser are you using that makes this
impossible? Does it happen on every page? When you say "impossible", do you
mean that:

  • the link inspector doesn't open when fired on a partial selection,
  • setting the link on a partial selection doesn't cause a link to be added,
  • on saving the link on the partial selection, it doesn't turn into the expected wikitext, or
  • something else that I've not covered?

    I can very much add and remove links to parts of words using the link inspector, and remove parts of existing links using the "clear formatting" button. Hence the issue.

The behaviour has changed since the last depot it seems. Currently when using Firefox 22 on Xubuntu Linux:
*Selecting part of a word and pressing ctrl+k means I can link only the selected part (previously ctrl+k was selecting the whole word and then opening the link dialog). This currently works as it should.
*Unlinking part of a word or multi-word link is not possible with the link tool:
If there is the link [[Background]] and I select "ground" and press ctrl+k the selection is changed to "Background" and then the link dialog opens
If there is the link [[Woolwich Arsenal station]] and I select "station" and press ctrl+k the selection is changed to "Woolwich Arsenal station" and then the link dialog opens. (This has not changed since my previous comment)
*Selecting part of a linked word or phrase and removing the formatting does remove the link only on the selection, but also removes any and all other formatting on that selection. Per Bug 51757 this is not desirable.

Thryduulf added a comment.Via ConduitJul 25 2013, 6:23 PM

(In reply to comment #10 and comment #8)
These issues should be solved by making it easy to explicitly set the link and the display text independently and unambiguously in the link dialog as is asked for in bug 50945 and bug 47879

Thryduulf added a comment.Via ConduitJul 25 2013, 6:25 PM

Sorry, that second link should be bug 48789

Jdforrester-WMF added a comment.Via ConduitJun 25 2014, 4:01 PM

(In reply to Krinkle)

VisualEditor: Make it hard for users to partially-select some text for linking

VisualEditor: Make it easier to select a link in its entirety (instead of part it)

This isn't actually the bug as filed (or the problem). It's already trivially easy to select an existing link in its entirety (you don't even need to select it); this bug is about when you've made a selection of text which doesn't have a link and are making it into one.

Reverting and making a little clearer.

Jdforrester-WMF moved this task to Backlog on the VisualEditor workboard.Via WebNov 24 2014, 1:29 AM
Jdforrester-WMF lowered the priority of this task from "High" to "Normal".Via WebJan 9 2015, 10:55 PM
gpaumier edited the task description. (Show Details)Via WebMar 25 2015, 4:37 PM
gpaumier set Security to None.

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.