Make non-breaking spaces (nbsp) visible in VisualEditor
Open, LowPublic8 Story Points

Description

Make non-breaking spaces visible in the editor. This may be a prerequisite to a VE feature for inserting / modifying non-breaking spaces. Entering non-breaking spaces easily, while common on some systems (OS X), only exists in full-blown word processing applications (Word) on others. It may not be obvious to the user that it is possible to insert non-breaking spaces in VE.

LibreOffice displays them with a grey background, always:

Word displays them only when non-printing characters display is turned on, as ° (normal spaces displayed as ·):

matmarex updated the task description. (Show Details)
matmarex raised the priority of this task from to Needs Triage.
matmarex added a subscriber: matmarex.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 21 2015, 10:44 AM
matmarex renamed this task from Make non-breakable spaces visible in the editor to Make non-breaking spaces (nbsp) visible in VisualEditor.Apr 21 2015, 10:52 AM
matmarex updated the task description. (Show Details)
matmarex set Security to None.

Change 205619 had a related patch set uploaded (by Bartosz Dziewoński):
[POC] Show non-breaking spaces (nbsp)

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

Nnemo added a subscriber: Nnemo.Apr 21 2015, 4:21 PM
Nnemo added a comment.Apr 21 2015, 4:41 PM

For me, making the non-breaking spaces visible is not a prerequisite to being able to insert them.
These are two different things.
In most applications on my Mac, I can perfectly insert non-breaking spaces, yet they are not visible.

Hmm. I still think we should show the user some kind of confirmation that they managed to insert a non-breaking space. Perhaps on Macs this is a common thing to do (according to https://en.wikipedia.org/wiki/Non-breaking_space#Keyboard_entry_methods, Opt+Space is implemented on OS-level, so most applications would support it by default), it is definitely not on Windows (Alt+Numpad0160 is very awkward, even more so in the age of laptops without the number pad; only word processing applications like Word or LibreOffice support Ctrl+Space or Ctrl+Shift+Space). I tested a few applications on my Windows 7 computer and pressing Ctrl+Space or Ctrl+Shift+Space variously did nothing, just inserted a regular space, or executed a weird keyboard shortcut.

matmarex updated the task description. (Show Details)Apr 22 2015, 4:52 PM
Nnemo added a comment.Apr 23 2015, 2:19 PM

Hmm. I still think we should show the user some kind of confirmation that they managed to insert a non-breaking space. Perhaps on Macs this is a common thing to do (according to https://en.wikipedia.org/wiki/Non-breaking_space#Keyboard_entry_methods, Opt+Space is implemented on OS-level, so most applications would support it by default), it is definitely not on Windows (Alt+Numpad0160 is very awkward, even more so in the age of laptops without the number pad; only word processing applications like Word or LibreOffice support Ctrl+Space or Ctrl+Shift+Space). I tested a few applications on my Windows 7 computer and pressing Ctrl+Space or Ctrl+Shift+Space variously did nothing, just inserted a regular space, or executed a weird keyboard shortcut.

Sure, on Win the native combination for a non-breaking space is a nightmare. What is the combination ? This is not even clear. "Alt+Numpad0160" ? I press Alt 255, with keeping Alt pressed, and pressing the numbers on the num keypad. What for people without num keypad ? :-S

On Mac, the native combination is very nice : Option Space.

But the common point is that these keyboard combinations natively enter a non-breaking space. Applications don't need to do anything to support them.

Then comes the combination added by Word : Ctrl Shift Space. This combination is not native, but it makes inserting non-breaking spaces reasonably possible on non-Mac envs.

Handling Ctrl Shift Space in the visual editor would be a good idea, for the people who are not on Mac.

I suggest this behaviour of the visual editor :

  1. Case 1. When a non-breaking space is entered natively (by keyboard combination, by pasting...), leave it intact.
  2. Case 2. When the user presses Ctrl Shift Space, insert a non-breaking space and, on the first time, inform the user of what s/he just did, in an info bubble, non-modal. How do we define "on the first time" ? User account, cookies..., whatever.

In the case 1., the person knows what s/he is doing.
In the case 2., the person triggers a feature of the visual editor.

See this related issue :

T96701: VE silently alters non-breaking spaces into normal spaces

Nnemo updated the task description. (Show Details)Apr 23 2015, 2:39 PM
Nnemo added a comment.Apr 23 2015, 2:45 PM

@matmarex,

I have edited the task's description a little. On Windows, non-breaking spaces are supported in any app, even Notepad.

But "Word" is not a system you can compare to "OS X"… :-)

Nnemo added a comment.Apr 24 2015, 1:01 PM

But "Word" is not a system you can compare to "OS X"… :-)

You are correct, James. :-) I will slightly edit the description of this task.

Nnemo updated the task description. (Show Details)Apr 24 2015, 1:02 PM

Change 205619 abandoned by Bartosz Dziewoński:
[POC] Show non-breaking spaces (nbsp)

Reason:
Probably needs more thought / design.

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

matmarex triaged this task as Normal priority.May 2 2015, 9:57 PM
matmarex removed a project: Patch-For-Review.
Elitre added a subscriber: Elitre.Jun 18 2015, 6:47 AM

Change 255936 had a related patch set uploaded (by Bartosz Dziewoński):
Show non-breaking spaces in the editor

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

Jdforrester-WMF moved this task from Backlog to TR3: Language support on the VisualEditor board.
Jdforrester-WMF assigned this task to matmarex.
Jdforrester-WMF edited a custom field.
matmarex lowered the priority of this task from Normal to Low.Dec 18 2015, 9:44 PM

Change 255936 abandoned by Bartosz Dziewoński:
Show non-breaking spaces in the editor

Reason:
This doesn't seem to be moving forward.

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

@matmarex Keep going! :)
There is still that need for some languages. What do you need to move forward?

I need the VE team to accept the design I proposed ("  is now displayed with a light grey background and has a tooltip explaining that this is a non-breaking space and not a random grey blotch"), or propose and implement a better one. :)

I'll see what I can do :)

I ask James to add the blocking tasks that need to be fixed before make   visible on wikis. When all this is fixed, you will be able to go forward, @matmarex.

matmarex removed matmarex as the assignee of this task.Jan 24 2016, 3:28 PM

Should the Patch for Review tag be removed then? :/

Jdforrester-WMF changed the point value for this task from 1 to 8.