Page MenuHomePhabricator

Specialize rendering of self-URIs in the form "/X123"
ClosedPublic

Authored by epriestley on May 9 2019, 8:34 PM.

Details

Summary

Depends on D20510. Ref T5378. When remarkup includes a hyperlink to the current install in the form "/X123" (which is common), load the corresponding object and specialize the rendering.

This doesn't cover everything (notably, no handling for Diffusion paths yet), but does cover a lot of the most common cases.

The "uri" form preserves the URI as written, but adds an icon, tag, and hovercard.

The "{uri}" form is more similar to {T123} and shows the object name.

Test Plan

Diff Detail

Repository
rP Phabricator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.May 9 2019, 8:34 PM

Slightly more complete test case:

Harbormaster returned this revision to the author for changes because remote builds failed.May 9 2019, 8:35 PM
Harbormaster failed remote builds in B22778: Diff 48905!
epriestley requested review of this revision.May 9 2019, 8:40 PM

(Test failures are because of D20511 not being landed yet.)

joshuaspence accepted this revision.May 14 2019, 12:36 AM
joshuaspence added a subscriber: joshuaspence.
joshuaspence added inline comments.
src/applications/meta/engineextension/PhabricatorSelfHyperlinkEngineExtension.php
31–42

A minor point, but this will match /robots.txt... should the regex be tightened so as to only allow monograms?

45–47

I guess it doesn't really matter since you are looking up the objects anyway.

This revision is now accepted and ready to land.May 14 2019, 12:36 AM
epriestley added inline comments.May 16 2019, 6:25 PM
src/applications/meta/engineextension/PhabricatorSelfHyperlinkEngineExtension.php
45–47

Yeah, we'll match various x.y.com/thing patterns, and /D99999999999999, but I expect these to be pretty rare and the behavior will still be correct, we'll just do a little extra work (discarding thing as a possible object name, or querying for D99999999999 and failing to load it).

This revision was landed with ongoing or failed builds.May 16 2019, 7:16 PM
This revision was automatically updated to reflect the committed changes.