Page MenuHomePhabricator

VisualEditor: Add non-breaking space (nbsp) to the "special character" dialog
Closed, ResolvedPublic

Description

Author: misc2006

Description:
The most obvious way to add a non-breaking space (other than typing it, see T53045) would be the Insert -> Special Characters dialog.


Alternative: T53045: VisualEditor: Ctrl+Shift+Space/Opt+Space to insert a non-breaking space (NBSP)

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:42 AM
bzimport set Reference to bz68429.

Adding 68425 or users will have no idea what it is.

A hopefully clearer rationale for this request, from User:Gnom:

Our typography rules call for a non-breaking space when discussing units and abbreviations ("a marathon is run over a distance of 42.195 km" calls for 42.195 km ; "water boils at 100 °C" requires 100 °C ; "Mary Shelley created the character of Dr. Frankenstein" includes Dr. Frankenstein ). I frequently use it in every law-related article in relation to the "§" sign, an example for this would be the article on Mietvertrag (Deutschland).

(Notice the several occurrences of the NBSP in https://de.wikipedia.org/wiki/Mietvertrag_(Deutschland).)

Aklapper renamed this task from VisualEditor: Add non-breaking space to the "special character" dialog to VisualEditor: Add non-breaking space (nbsp) to the "special character" dialog.Mar 19 2015, 11:09 AM
Aklapper set Security to None.

Or you could somehow annotate the whole word as nowrap. Arguably <nowrap>100 °C</nowrap> would be clearer than 100&nbsp;°C

We already have the ability to use different label on the button than the character that will be inserted (we use it for more meaningful labels for combining characters, and in fact for invisible ones like zero-width non-joiner and joiner). We should probably make the label say "NBSP" if we do this.

Due to various implementation details this is more difficult than it looks (it's not just a matter of adding an entry to the list of available characters). If we implement T53045: VisualEditor: Ctrl+Shift+Space/Opt+Space to insert a non-breaking space (NBSP), I'm not sure if this one will be worth it.

Given that https://phabricator.wikimedia.org/T53045#1947804 happened, I guess that the special character option is still more difficult to implement than the other one, even if just as a temporary workaround?

Change 659374 had a related patch set uploaded (by Esanders; owner: Esanders):
[VisualEditor/VisualEditor@master] Allow HTML entities in the special character list

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

Change 659376 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] Implement mwPlatform#decodeEntities

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

Change 659378 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/core@master] Add &nbsp; to the special character list

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

Change 659374 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Allow HTML entities in the special character list

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

Change 659408 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (fe9082b21)

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

Change 659408 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (fe9082b21)

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

Change 659376 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Implement mwPlatform#decodeEntities

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

Change 659378 merged by jenkins-bot:
[mediawiki/core@master] Add &nbsp; to the special character list

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

Tech/News/2021/05 suggests that this feature can currently be used. If so, how exactly can users of the 2010, 2017, and visual editors insert this character? I've tried various wikis (even test.wikipedia) and couldn't find it.

@Bdijkstra It's in this week's train, so it'll start working today, tomorrow or on Thursday, depending on which wiki.

For reference, it can be found here in the menus:

Visual editorWikitext editor
image.png (2×3 px, 877 KB)
image.png (2×3 px, 706 KB)

This is admittedly very hidden. We have a follow-up task to add a keyboard shortcut for it: T53045.

Tech/News/2021/05 suggests that this feature can currently be used. If so, how exactly can users of the 2010, 2017, and visual editors insert this character? I've tried various wikis (even test.wikipedia) and couldn't find it.

It's not available on the production Wikimedia wikis yet due to a delay of the deployment train, but you can test it on https://en.wikipedia.beta.wmflabs.org/.

For reference, it can be found here in the menus:

The position within the list could be changed for increased prominence (there is also an "Often used" section at the top that it could go in).

Is nbsp understood across wikis? If not then do we need a visual representation via an icon?

How common is this affordance? Does it actually need to be more discoverable via the menu? (I would really prefer if we had a search menu under the omega menu but that would be a much larger task).

ppelberg subscribed.

For reference, it can be found here in the menus:

The position within the list could be changed for increased prominence (there is also an "Often used" section at the top that it could go in).

@Esanders: what currently determines the symbols that appear within the "Often used" section?

Note: the comment you posted above leads me to wonder whether the list is hard-coded while the name of the section – "Often used" – leads me to think the section's contents could be determined by the symbols editors at a particular project use most.

Is nbsp understood across wikis? If not then do we need a visual representation via an icon?

Good question and I'm not aware of us having an answer to it.

How common is this affordance?

If it would be accurate for me to understand the above as asking how often people use the NBSP affordance in VE, then we should be able to answer this question thanks to T264146.

...@matmarex: can you please confirm whether or not we would be able to leverage the instrumentation that was implemented in T264146 to determine how often people use the NBSP affordance within the special characters toolbar?

Does it actually need to be more discoverable via the menu?

Perhaps? Tho, I think we can wait on prioritizing making that work assuming people will be more likely to find the NBSPfunctionality via an explicit affordance vs. a keyboard shortcut as people would have to have done previously.

@Esanders: what currently determines the symbols that appear within the "Often used" section?

//Note: the comment you posted above leads me to wonder whether the list is hard-coded while the name of the section – "Often used" – leads me to think the section's contents could be determined by the symbols editors at a particular project use most./

It is hard coded. The intention is that it can configured per wiki, but I don't know how often that actually happens.

Is nbsp understood across wikis? If not then do we need a visual representation via an icon?

Good question and I'm not aware of us having an answer to it.

The letters nbsp are probably understood in all languages because of the html sequence &nbsp; used to enter them in wikitext. People are only going to be looking in the special character inserter for this if the already know what it is. If you were just trying to fix a word wrapping issue and didn't know about NBSPs you probably wouldn't be looking for a special character.

How common is this affordance?

If it would be accurate for me to understand the above as asking how often people use the NBSP affordance in VE, then we should be able to answer this question thanks to T264146.

...@matmarex: can you please confirm whether or not we would be able to leverage the instrumentation that was implemented in T264146 to determine how often people use the NBSP affordance within the special characters toolbar.

No, the logging only records which group is used.

@Esanders: what currently determines the symbols that appear within the "Often used" section?

//Note: the comment you posted above leads me to wonder whether the list is hard-coded while the name of the section – "Often used" – leads me to think the section's contents could be determined by the symbols editors at a particular project use most./

It is hard coded. The intention is that it can configured per wiki, but I don't know how often that actually happens.

Understood. I've filed T278915 as a reminder.

Is nbsp understood across wikis? If not then do we need a visual representation via an icon?

Good question and I'm not aware of us having an answer to it.

The letters nbsp are probably understood in all languages because of the html sequence &nbsp; used to enter them in wikitext. People are only going to be looking in the special character inserter for this if the already know what it is. If you were just trying to fix a word wrapping issue and didn't know about NBSPs you probably wouldn't be looking for a special character.

How common is this affordance?

If it would be accurate for me to understand the above as asking how often people use the NBSP affordance in VE, then we should be able to answer this question thanks to T264146.

...@matmarex: can you please confirm whether or not we would be able to leverage the instrumentation that was implemented in T264146 to determine how often people use the NBSP affordance within the special characters toolbar.

No, the logging only records which group is used.

Understood.

I am going to resolve this task considering:

  • I do not think anything here requires further action at this time.
  • The patch that introduced this behavior landed in production via MW-1.36-notes (1.36.0-wmf.29; 2021-02-02)