Added phriction config option to specify the number of levels of hierarchy to display in the Document Hierarchy. Cleaning up my original pull request at https://github.com/facebook/phabricator/pull/338
No Test Coverage
Oops, you're right! I've now retested -1, 0, 1, 2, & 10. The code for -1 adds an extra almost identical query, so maybe it would be better to not include it & let people set the option to a sufficiently high number (999) instead? Too many levels will break the layout anyway.
I'd prefer a somewhat reasonable/conservative hard set of options (1-10 maybe?) Do you have specific need for more than 10? I am more concerned with people breaking layouts and filing bugs vs opening tasks to add more than 10 levels.
I don't really want to add config for this. There's almost no way it will survive, e.g., some of @chad's ideas around a CMS iteration on Phriction without needing to be reverted. This patch makes document queries more complex, which makes it harder to implement T4029. I think the removal of the // Fill in any missing children. block breaks the case where /x/ exists and /x/y/z/ exists, but /x/y/ does not exist.
Pushing this out of my queue, sounds like we're not going in this direction at this time. Might be worth filing a Task though stating the core issue / reason this is useful and we'll see if there is more interest.