Page MenuHomePhabricator

Make "Show Context" persist rendering, whitespace, encoding, etc
ClosedPublic

Authored by epriestley on Mar 5 2015, 3:13 PM.
Tags
None
Referenced Files
F14041555: D11977.diff
Mon, Nov 11, 7:37 PM
F14020792: D11977.diff
Wed, Nov 6, 2:38 AM
F14012806: D11977.id28864.diff
Fri, Nov 1, 7:33 PM
F14001810: D11977.id28830.diff
Fri, Oct 25, 12:11 PM
F14001640: D11977.id28828.diff
Fri, Oct 25, 10:34 AM
F13984439: D11977.id.diff
Sun, Oct 20, 1:24 PM
F13969600: D11977.id28864.diff
Oct 17 2024, 3:20 AM
Unknown Object (File)
Oct 2 2024, 7:23 AM
Subscribers

Details

Summary

Ref T2009. Currently, we do not persist view parameters when making context rendering requests.

The big one is the renderer (1up vs 2up). This makes context on unified diffs come in with too many columns.

However, it impacts other parameters too. For example, at HEAD, if you change highlighting to "rainbow" and then load more context, the context uses the original highlighter instead of the rainbow highlighter.

This moves context loads into ChangesetViewManager, which maintains view parameters and can provide them correctly.

  • This removes "ref"; it is no longer required, as the ChangesetViewManager tracks it.
  • This removes URI management from behavior-show-more; it is no longer required, since the ChangesetViewManager knows how to render.
  • This removes "whitespace" since this is handled properly by the view manager.
Test Plan
  • Used "Show Top" / "Show All" / "Show Bottom" in 1-up and 2-up views.
  • Changed file highlighting to rainbow, loaded stuff, saw rainbow stick.
  • Used "Show Entire File" in 1-up and 2-up views.
    • Saw loading chrome.
    • No loading chrome normally.
  • Made inlines, verified copyRows() code runs.
  • Poked around Diffusion -- it is missing some parameter handling, but works OK.

Diff Detail

Repository
rP Phabricator
Branch
uni6
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 4756
Build 4772: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to Make "Show Context" persist rendering, whitespace, encoding, etc.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.

This breaks Phriction, which is doing its own thing.

  • Fix Phriction and standalone diff views.
  • There are still some limitations in Diffusion/Phriction, but I believe this makes nothing worse than it was before.
btrahan edited edge metadata.

Nothing important in the inlines.

webroot/rsrc/js/application/differential/ChangesetViewManager.js
221–224

I'm surprised these aren't null, but I'm guessing some JS abstraction makes '' the right value? (JX.Workflow.newFromForm(form, params) maybe?)

webroot/rsrc/js/application/differential/behavior-show-more.js
1

This file looks v. nice on the right hand side

This revision is now accepted and ready to land.Mar 5 2015, 8:54 PM
webroot/rsrc/js/application/differential/ChangesetViewManager.js
221–224

They get used as URL parameters later, and null turns into literal "null" and undefined turns into literal "undefined" by default in JS, unlike in PHP. That is, in PHP:

echo null."!";

...echoes "!", but in JS:

console.log(null + "!");
console.log(undefined + "!");

..logs "null!" and "undefined!".

Possibly newFromForm() or whatever the underlying abstraction is should interpret null to mean "omit the parameter", but it doesn't currently (or didn't at one point; it's vaguely possible this is no longer necessary), so this avoids PHP trying to apply "null" or "undefined", literally, as highlighting languages, for example.