Page MenuHomePhabricator

Make non-breaking spaces (nbsp) visible in VisualEditor
Closed, ResolvedPublic8 Estimated 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:

pasted_file (49×164 px, 1 KB)

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

pasted_file (108×124 px, 9 KB)

Event Timeline

matmarex raised the priority of this task from to Needs Triage.
matmarex updated the task description. (Show Details)
matmarex subscribed.
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

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.

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

@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"… :-)

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.

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 Medium priority.May 2 2015, 9:57 PM
matmarex removed a project: Patch-For-Review.

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 edited a custom field.
Jdforrester-WMF moved this task from Freezer to TR3: Language support on the VisualEditor board.
Jdforrester-WMF edited a custom field.
matmarex lowered the priority of this task from Medium 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 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.

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

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

Change 255936 restored by Esanders:
[mediawiki/extensions/VisualEditor@master] Show non-breaking spaces in the editor

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

Change 255936 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Show non-breaking spaces in the editor

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

Cool, I wrote this in 2015 ;)

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. :)

Better late than never!