Page MenuHomePhabricator

Colorize lines in blame under DocumentEngine, to show relative age of changes
ClosedPublic

Authored by epriestley on Apr 9 2018, 1:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 10:45 PM
Unknown Object (File)
Tue, Nov 5, 7:22 PM
Unknown Object (File)
Thu, Oct 31, 8:27 PM
Unknown Object (File)
Thu, Oct 24, 2:13 PM
Unknown Object (File)
Oct 16 2024, 8:18 AM
Unknown Object (File)
Oct 15 2024, 5:50 AM
Unknown Object (File)
Oct 6 2024, 11:01 PM
Unknown Object (File)
Sep 28 2024, 12:30 AM
Subscribers

Details

Summary

Depends on D19313. Ref T13105. Fixes T13015. We lost the coloration for ages in the switch to Document Engine.

Restore it, and use a wider range of colors to make the information more clear.

Test Plan

Viewed some blame, saw a nice explosion of bright colors. This is a cornerstone of good design.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Apr 9 2018, 1:10 PM
epriestley requested review of this revision.
This revision was automatically updated to reflect the committed changes.

Its probably completely personal preference but I found the variations of colors a little "in my face".. It didn't seem obvious to my brain which color was old and which was new (normally it was a mixture of green, cyan, oranges and purples!)

I changed the code slightly in my instance to use just a linear scaling of a single color (in this case green), the darker the green the older the commit. (adjusted slightly to keep it away from being bright green)

  var v_min = 0.0;
  var v_max = 1.00;
  var v = v_min + ((v_max - v_min) * epoch_value);
  row.info.style.background = getLinearGreen(v);
}

function getLinearGreen(v) {
  var r, g, b;

  r = Math.round(v*240);
  g = 240;
  b = Math.round(v*240);

  return 'rgb(' + r + ', ' + g + ', ' + b + ')';
}

I'm not a graphic artist and not gifted with artist talents! so feel free to ignore me..

image.png (459×229 px, 32 KB)