Hidden templates should display as an icon in-page in VisualEditor so they can be interacted with (e.g. a puzzle piece?)
Closed, ResolvedPublic

Description

Hidden templates, like Template:Use British English, are displaying as carriage returns. These are pretty easy to mistakenly identify as typos or errors and delete. We need a better way of displaying those within the VE, or (as a long-term goal) a better way of surfacing metadata, a la the "page settings" page.


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=49603
https://bugzilla.wikimedia.org/show_bug.cgi?id=53659

bzimport set Reference to bz49806.
Ironholds created this task.Via LegacyJun 19 2013, 11:10 AM
bzimport added a comment.Via ConduitJun 20 2013, 7:04 PM

ryan.glasnapp wrote:

Template:Clear is also a good example of this. Although it doesn't even display as a carriage return. You can insert the template, and then it complete disappears.

Ironholds added a comment.Via ConduitJun 21 2013, 4:51 AM

A side-effect of this is that it's impossible to maintain good formatting (keep a blank line between metadata and article text, for example) because the content does not exist from an editor's perspective.

liangent added a comment.Via ConduitJun 28 2013, 5:44 PM

btw What's the standard of "hidden templates". Are templates generating <div style="display:none;">something</div> hidden, or what about <div class="hidden">something</div> when [[MediaWiki:Common.css]] contains .hidden{display:none;} ?

Ironholds added a comment.Via ConduitJun 28 2013, 6:57 PM

I have no idea if there /is/ a standard. A good illustration is https://en.wikipedia.org/w/index.php?title=Template:Persondata&action=edit

TheDJ added a comment.Via ConduitJul 7 2013, 7:28 PM

Even with non-hidden, but floating templates it can be confusing. To quote a user:

http://en.wikipedia.org/w/index.php?title=Peach_Springs_Trading_Post&oldid=563257259

I place the cursor to the left of the line that begins "The Peach Springs Trad....", just after the malformed comment, then press backspace, in the hopes of starting to delete said malformed content, the entire infobox disappears. This is quite startling.

Perhaps a warning is required for the short term ? "Are you sure you want to delete template... ?"

TheDJ added a comment.Via ConduitJul 7 2013, 7:37 PM

How about this: If the cursor is before or straight after a template, pop the 'puzzle' indicator into view.

You could make it float above the current line, with a droplet (as a sort of cursor) downward pointing at the position where there is a template that is invisible or floating. When you click the icon, move the cursor to be on 'template', blue highlighting the template content if it is not hidden (this will help direct the users eye from cursor position to content) and directly open the template editor.

Eloquence added a comment.Via ConduitJul 12 2013, 6:23 AM

Oliver and others watching this bug, what's your sense from reviewing changes how often this (accidental deletion of hidden templates) is currently occurring in practice? Knowing this (even if it's anecdata) would help setting priority for this bug.

Ironholds added a comment.Via ConduitJul 12 2013, 4:33 PM

I've seen it a couple of times so far, but not that often. Having said that, we haven't been actively patrolling recentchanges in a while. I'd personally like some kind of resolution pre-IP rollout, because even if it's relatively rare we're throwing sheer numbers at every bug.

NicoV added a comment.Via ConduitJul 15 2013, 1:41 PM

Why not allowing deletion of a template by keyboard only if the template is selected, not just if the cursor if just before or after the template ?
I don't know if it's difficult to implement, but that would help preventing accidental deletions.

Jdforrester-WMF added a comment.Via ConduitJul 17 2013, 6:38 PM
  • Bug 49633 has been marked as a duplicate of this bug. ***
TheDJ added a comment.Via ConduitJul 19 2013, 7:18 PM

FYI: I count 3 reports in the last 10 posts on WP:VP/T today related to accidental 'hidden' or 'floating' templates deletion.

Thryduulf added a comment.Via ConduitJul 21 2013, 5:26 PM

Whatever solution is here should also apply to templates that normally produce text but have been created empty for whatever reason. For example it is possible to add a {{small}} template with no text to display.

jayvdb added a comment.Via ConduitJul 21 2013, 11:00 PM
  • Bug 51322 has been marked as a duplicate of this bug. ***
jayvdb added a comment.Via ConduitJul 28 2013, 2:20 AM

Regarding the English language variable templates specifically, it would be great if these were handled by pushing it into a meta tag (bug 52166) and incorporate it into page settings.

Regarding top icons, there is a core enhancement for a pre-defined area for these icons (bug 23796), and a VE enhancement request to do the same (bug 51420).

Regarding others, a puzzle piece sounds like a great UI for it. Or a custom icon defined in TemplateData?

Thryduulf added a comment.Via ConduitAug 2 2013, 7:18 PM

PamD at en.wp complains that:
"[When] I add invisible matter to an article (eg {{coord missing}}), it's too easy to delete it later in the same edit while "tidying up" blank lines etc."

Suggestions have been made above about how to deal with this in advance of working out how to display hidden templates, e.g. in comment 9.

Alternatively invisible templates could just be declared not deletable in VE (i.e. just treat them like nowikis). It will occasionally leave unnecessary templates in but that is going to be far rarer than deleting them without meaning or even knowledge as happens now.

A work around for this allowing you to add and not delete stuff you've added would be to make their removal undoable. Not ideal but better than nothing.

PamD added a comment.Via ConduitAug 2 2013, 7:36 PM

A work around for this allowing you to add and not delete stuff you've added
would be to make their removal undoable. Not ideal but better than nothing.

Though the problem is that you don't know you've removed them until you realise on saving the page that something you thought you'd added isn't there! A message like "removing invisible template: are you sure?" would be helpful.

Jdforrester-WMF added a comment.Via ConduitAug 15 2013, 11:39 PM
  • Bug 52658 has been marked as a duplicate of this bug. ***
Thryduulf added a comment.Via ConduitAug 16 2013, 8:42 AM

> A work around for this allowing you to add and not delete stuff you've added
> would be to make their removal undoable. Not ideal but better than nothing.

Though the problem is that you don't know you've removed them until you
realise
on saving the page that something you thought you'd added isn't there! A
message like "removing invisible template: are you sure?" would be helpful.

Yes. Although reading comment 15 again I meant to say "make their addition undoable." (not removal). Sorry for the confusion.

Jdforrester-WMF added a comment.Via ConduitFeb 24 2014, 7:54 PM
  • Bug 60830 has been marked as a duplicate of this bug. ***
Jdforrester-WMF added a comment.Via ConduitFeb 27 2014, 7:26 PM
  • Bug 52551 has been marked as a duplicate of this bug. ***
AdHuikeshoven added a comment.Via ConduitJul 10 2014, 7:41 PM

On nl.wp a discussion has started to turn on VE. In the process feedback has been collected on VE. Some users commented on "white lines" as a blocking issue for turning VE on as default.
On top of pages like:

as well as on other places on the page "white lines" or carriage returns appear in VE edit mode which do not appear in read mode. On mouse over the white line turns blue.

Some users fear that newcomers others will delete those white lines and carriage returns. However, after deletion of those lines images are accidently deleted from the page.

(Deleting white space at the bottom of a page might also delete accidently categories and other metadata.)

How can I help to resolve this 'bug'?

Jdforrester-WMF added a comment.Via ConduitJul 10 2014, 7:49 PM

(In reply to Ad Huikeshoven from comment #21)

On nl.wp a discussion has started to turn on VE. In the process feedback has
been collected on VE. Some users commented on "white lines" as a blocking
issue for turning VE on as default.
On top of pages like:

This feels like you don't think the resolution to bug 47790 in March was sufficient; I'm not sure that this has anything to do with this bug, however. Take the conversation there?

AdHuikeshoven added a comment.Via ConduitJul 11 2014, 3:01 PM

Ok to take the conversation there. I've read through bug 47790 and the reported issues are more or less the same. Bug 47790 is solved. What is the timeline of deployment?

Jdforrester-WMF added a comment.Via ConduitJul 11 2014, 4:15 PM

(In reply to Ad Huikeshoven from comment #23)

Ok to take the conversation there. I've read through bug 47790 and the
reported issues are more or less the same. Bug 47790 is solved. What is the
timeline of deployment?

It's already deployed.

It was deployed to MediaWiki.org on 6 March 2014 (see the "Milestone" field), so it would have reached the Dutch Wikipedia a week later, on 13 March 2014.

That's what I meant by "This feels like you don't think the resolution to bug 47790 in March was sufficient". :-)

AdHuikeshoven added a comment.Via ConduitJul 11 2014, 9:26 PM

Hi James. Thanks for the explanation. Today I learned the word "slugs". To me they are sufficiently clear that those aren't white space but something different. Some vocal users on nl.wp portray slugs as "ugly white rows" and fear accidental deletion, the examples provided that would be images. I will continue discussion on bug 47790 and bug 55336 about accidental deletion of FocusableNodes. I've seen a live case in which slugs cannot be deleted. However the cases mentioned above can be.

Jdforrester-WMF added a comment.Via ConduitAug 11 2014, 10:48 AM

As an additional item (from bug 51978 comment 6):

Using the {{כ}} template works correctly while editing articles, and the
original test page https://he.wikipedia.org/wiki/User:Amire80/ve-rlm shows
everything correctly.

That said, there are issues with handling this template after it's inserted:

  • The bubble that shows its name appears in a wrong location.

This is related to this bug – the context seems to find the nearest thing that actually displays and attaches to that. When we display a place for the context to show, it will presumably show there. :-)

Jdforrester-WMF added a comment.Via ConduitNov 4 2014, 7:23 PM
  • Bug 72963 has been marked as a duplicate of this bug. ***
Jdforrester-WMF moved this task to Backlog on the VisualEditor workboard.Via WebNov 24 2014, 1:29 AM
Ironholds removed a subscriber: Ironholds.Via WebDec 5 2014, 3:18 PM
Jdforrester-WMF lowered the priority of this task from "High" to "Normal".Via WebJan 15 2015, 12:21 AM
Jdforrester-WMF set Security to None.
Sunpriat removed a subscriber: Sunpriat.Via WebFeb 27 2015, 10:06 PM
gerritbot added a subscriber: gerritbot.Via ConduitMar 2 2015, 10:37 PM

Change 193975 had a related patch set uploaded (by Mooeypoo):
Add an icon to hidden templates

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

gerritbot added a project: Patch-For-Review.Via ConduitMar 2 2015, 10:37 PM
Jaredzimmerman-WMF added a subscriber: violetto.Via WebMar 2 2015, 10:46 PM

We have a general "template" icon, adding @violetto to point to the right asset.

Mooeypoo claimed this task.Via WebMar 2 2015, 11:02 PM
Jdforrester-WMF changed the title from "VisualEditor: Hidden templates should display as an icon in-page so they can be interacted with (e.g. a puzzle piece?)" to "Hidden templates should display as an icon in-page in VisualEditor so they can be interacted with (e.g. a puzzle piece?)".Via WebMar 2 2015, 11:40 PM
Jdforrester-WMF set Story Points to 8.
Jdforrester-WMF moved this task to Polish on the VisualEditor 2014/15 Q3 blockers workboard.Via WebMar 4 2015, 4:21 PM
Jdforrester-WMF closed this task as "Resolved".Via WebMar 5 2015, 10:37 PM
gerritbot added a comment.Via ConduitMar 5 2015, 10:38 PM

Change 193975 merged by jenkins-bot:
Add an icon to hidden templates

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

Jdforrester-WMF moved this task to Done on the VisualEditor 2014/15 Q3 blockers workboard.Via WebMar 5 2015, 10:59 PM
Etonkovidova added a subscriber: Etonkovidova.Via WebMar 11 2015, 4:58 PM

After a page is Saved, and then switch to Edit mode - the icon for Hidden template is not displayed. Saw it in Chrome.

gpaumier added a project: user-notice.Via WebMar 12 2015, 7:39 PM
gpaumier moved this task to Announce in next Tech/News on the user-notice workboard.
gpaumier moved this task to In current Tech News draft on the user-notice workboard.
Etonkovidova added a comment.Via WebMar 12 2015, 9:08 PM

There is a curious case of the template: https://test2.wikipedia.org/wiki/Template:No_spam {{@}}.
Inserting {{@}} will display the icon, just as for the hidden template: 'Use British English'.

Is it intentional?

gpaumier moved this task to Recently announced in Tech/News on the user-notice workboard.Via WebMar 13 2015, 10:15 PM
gpaumier moved this task to Archive on the user-notice workboard.Via WebMar 19 2015, 5:47 PM

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.