The "file tree" is currently rendered mostly on the server, and has a preference to enable or disable it. I think the preference was originally motivated by performance concerns.
In modern Phabricator, the performance cost of the file tree is likely no longer very significant compared to all the other things the page is doing. This preference can probably be removed. Note that the file tree can still be expensive on large changes (PHI485 has a profile where it took 3s to render on a 3,500 file change, and likely provides little or no value) and should degrade.
Right now, the file tree has a significant server-side component. This probably makes sense to move to the client.
- See T6410. See PHI356. Folders should support a disclosure triangle.
- See T13455. At the file level, "collapsed" should be shown in the tree UI. The "disclosure triangle" for a given file could be a toggle for the collapse option.
- See PHI1551. Keyboard navigation allows you to "select" a file, which is a different concept from "currently visible file" in the file tree. This isn't communicated clearly. The banner "selection" state may also differ from the filetree "selection" state. They should always select the same file. "Collapse File" should have the same targeting rules as "Open in Editor".
- See PHI1257. Putting page navigation anchors (Comment, Table of Contents) into the file tree might be helpful.
- Update PHI356 after the various pieces happen.
See also PHI485, which would like to sort "files affecting packages I own" to the top. We //could// let you sort (and even drag) files using the file tree, although this feels highly ambitious.
---
**Errata**
- When a `FormationView` resizes the content pane below desktop size, we could reasonably put //part// of the document into device mode. This requires some changes to how responsive views work, but they're likely minor.
- Fixed flank panels don't know to adjust their height when DarkConsole is open.
- If you toggle flank visibility with an active diff selection, the reticle does not redraw properly.
- Celerity package definitions should be updated.
- When you jump to a file via clicking or "N/P", we should history-push the page URI.
- The formation column should be hidden on mobile.
- `PhutilPathTree`, or whatever it was, should be removed it it has no remaining callers.
---
//Done//
- Previously, see T13110.
- After the "buoyant header" is painted, the formation view should repaint.
- See PHI595, which would like better accessibility hints in the filetree.
- See PHI356. When a change affects `a/b/c/d.txt` but no other files under `a/`, a single directory entity `a/b/c` can be rendered.
- See PHI356. Package authority could reasonably be shown in the filetree.
- See also T7467 ("render deleted files more prominently").