Page MenuHomePhabricator

DataValues shown in diffs should use some kind of "raw" format
Closed, ResolvedPublic


Some DataValue sublcasses use "hidden" or "secondary" values to augment the primary value, e.g. the globe URI in GlobeCoordinates or the upper- and lower bound in QuantityValues. Some of these may not be shown by the default formatter for that kind of data value.

However, in diffs, we need to see *all* data that may have changed. So, there should be a flag like "RAW_FORMAT" or some such passed via FormatterOptions causing the formatters to generate a more detailed output (in some cases, it may even be sensible to have a separate formatter class for this purpose).

Version: unspecified
Severity: major



Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:13 AM
bzimport set Reference to bz56684.
bzimport added a subscriber: Unknown Object (MLST).

Summary of team discussion:

  • Use HTML renderer in diffs, to have more control over output.
    • Possibly, at some point, highlight the bits of the value that actually changed
  • Simple types (string, url, commonsMedia) are unproblematic and stay as they are.
  • Complex values (e.g. time, coordinates, and quantities) are shown as itemized lists of their parts.
  • Item (reference) values are "expanded" to:
    • show at least the referenced item ID
    • if possible a label in the user's language (fallback applies).
    • the value is linked to the target item.
    • we may want to show the target item's description, also.
  • Numbers are localized (wrt the decimal separator, etc)
  • Numbers are not rounded (and no unit conversion is applied)
  • A TimeValue's timestamp is shown in full precision.
    • we may use raw ISO format for now
    • localized time values would be nice
    • applying user preferences for time formatting would cause caching issues
  • A TimeValue's precision should be translated from the numeric form to a localized form ("hour", "day", "millennium", etc).
  • A TimeValue's before/after parts should include the precision name (e.g. "before: 3 years".

Suggested breakdown:

  • Inject a ValueFormatterFactory into the DiffView, so we can provide specialized formatters for use in diffs.
  • Implement a diff formatter for WikibaseItem
  • Implement a diff formatter for TimeValue
  • Implement a diff formatter for GlobeCoordinateValue
  • Implement a diff formatter for QuantityValue

Change 98110 had a related patch set uploaded by Daniel Kinzler:
(bug 56684) Use HTML formatters in diffs.

Change 98124 had a related patch set uploaded by Daniel Kinzler:
(bug 56684) Show Quantity details in diff.

Change 98110 merged by jenkins-bot:
(bug 56684) Use HTML formatters in diffs.

Change 98124 merged by jenkins-bot:
(bug 56684) Show Quantity details in diff.

Status update: Quantities now show with all details in diffs, but we still need to do the same for the Time and Geo types. Now that this infrastructure is in place, this should be quite simple.