Page MenuHomePhabricator

VisualEditor: Reference & cite tooltips should show content snippets, instead of generic labels
Closed, ResolvedPublic8 Story Points

Description

For citation template references we may also want to specify a subset of parameters to show first.
Links and citation mocks:

Version: unspecified
Severity: enhancement

Details

Reference
bz69474

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:43 AM
bzimport set Reference to bz69474.
Esanders created this task.Aug 13 2014, 2:26 PM
  • Bug 69744 has been marked as a duplicate of this bug. ***

We could list template values in order until we run out of room, but this may not lead to desirable results, for example the first parameter in {{Cite web}} is URL.

A more complex solution would be to come up with a format for defining how to generate the summary of a template and store it in template data, either as a value on the column (summary order):

Field Desc Summary order
url ... null
publisher ... 2
title ... 1
date ... 3
month ... null

A simplified version of this would just flag one field as being used in the summary.

etc.

Or as a string concatenation message somewhere:

"{{{title}}}, {{{publisher}}} - {{{date}}}"

I think we'd much rather keep the current model of showing the name of something shown, or the value of something not shown (like for HTML comments)…

Any attempt to "parse" the template parameters is going to become very complex or fail to address the needs of wikis other than the English Wikipedia. How about just displaying the parsed content of the reference, stripped of links and any block markup, and limited to some length?

matmarex added a comment.EditedSep 17 2014, 1:50 PM

I played with it and the following sort of works for all reference node types. There must be a better way to do it, but I can't find one. (It also doesn't update the tooltip after reference contents are changed, probably because that is done deferred or something.)

ve.ce.MWReferenceNode.static.getDescription = function ( model ) {
  var refModel = ve.dm.MWReferenceModel.static.newFromReferenceNode( model );
  var surface = ve.init.target.createSurface( refModel.getDocument() );
  var text = $( surface.getView().$element ).text();
  surface.destroy();
  return text;
};

(I tried messing around with ve.dm.Converter too, but it seems impossible to render the contents of templated references without involving the surface, probably because they're magically generated in ve.ce.)

(In reply to Bartosz Dziewoński from comment #6)

(I tried messing around with ve.dm.Converter too, but it seems impossible to
render the contents of templated references without involving the surface,
probably because they're magically generated in ve.ce.)

Yeah, this needs CE. I think we may have to rethink how we do descriptions a little.

This comment was removed by KHammerstein.
KHammerstein added a project: Design.
KHammerstein set Security to None.
Jdforrester-WMF lowered the priority of this task from High to Normal.Jan 15 2015, 12:49 AM
This comment was removed by Ricordisamoa.
Mvolz added a subscriber: Mvolz.Feb 16 2015, 3:47 PM
Restricted Application added a project: User-Ryasmeen. · View Herald TranscriptJun 23 2017, 8:50 AM