Last modified: 2014-09-26 19:34:44 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 T39939, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 37939 - VisualEditor: Make it hard for users to partially-select some unlinked text for linking
VisualEditor: Make it hard for users to partially-select some unlinked text f...
Status: ASSIGNED
Product: VisualEditor
Classification: Unclassified
Editing Tools (Other open bugs)
unspecified
All All
: High enhancement
: ---
Assigned To: Editing team bugs – take if you're interested!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-25 20:01 UTC by James Forrester
Modified: 2014-09-26 19:34 UTC (History)
13 users (show)

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


Attachments

Description James Forrester 2012-06-25 20:01:53 UTC
From bug 33091:

- 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.
Comment 1 Inez Korczyński 2012-06-25 21:19:44 UTC
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).
Comment 2 Liangent 2012-06-26 00:12:18 UTC
(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?
Comment 3 Inez Korczyński 2012-06-26 00:19:13 UTC
(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.
Comment 4 Gregor Hagedorn 2012-12-13 11:09:05 UTC
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.
Comment 5 James Forrester 2012-12-13 21:39:25 UTC
(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.
Comment 6 Gregor Hagedorn 2012-12-13 21:51:00 UTC
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.
Comment 7 Chris McKenna 2013-07-22 19:04:22 UTC
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.
Comment 8 Spinningspark 2013-07-25 17:14:08 UTC
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.
Comment 9 James Forrester 2013-07-25 17:28:08 UTC
(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.
Comment 10 James Forrester 2013-07-25 17:32:53 UTC
(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.
Comment 11 Chris McKenna 2013-07-25 18:21:03 UTC
(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.
Comment 12 Chris McKenna 2013-07-25 18:23:48 UTC
(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
Comment 13 Chris McKenna 2013-07-25 18:25:14 UTC
Sorry, that second link should be bug 48789
Comment 14 James Forrester 2014-06-25 16:01:31 UTC
(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.

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


Navigation
Links