Page MenuHomePhabricator

In ProfileMenu, put more structure between "stored/configured items" and "display items"

Authored by epriestley on Mar 31 2019, 7:05 PM.
Referenced Files
F13318997: D20357.diff
Thu, Jun 13, 11:58 AM
F13300417: D20357.id48575.diff
Fri, Jun 7, 9:11 AM
F13291194: D20357.id48575.diff
Tue, Jun 4, 10:08 PM
F13289274: D20357.id48575.diff
Tue, Jun 4, 11:47 AM
F13263071: D20357.id48608.diff
Mon, May 27, 7:01 AM
F13250762: D20357.id48575.diff
Fri, May 24, 5:13 PM
May 18 2024, 11:34 AM
Unknown Object (File)
May 1 2024, 2:57 AM



Depends on D20356. Ref T13275. See also T12871 and T12949.

Currently, the whole "ProfileMenu" API operates around stored items. However, stored items are allowed to produce zero or more display items, and we sometimes want to highlight display item X but render stored item Y (as is the case with "Link" items pointing at ?filter=xyz on Workboards).

For the most part, this either: doesn't work; or works by chance; or is kind of glued together with hope and prayer (as in D20353).

Put an actual structural layer in place between "stored/configured item" and "display item" that can link them together more clearly. Now:

  • The list of ItemConfiguration objects (stored/configured items) is used to build an ItemViewList.
  • This handles the selection/highlighting/default state, and knows which display items are related to which stored items.
  • When we're all done figuring out what we're going to select and what we're going to highlight, it pops out an actual View which can build the HTML.

This requires API changes which are not included in this change, see next change.

This doesn't really do anything on its own, but builds toward a more satisfying fix for T12871. I'd hoped to avoid doing this for now, but wasn't able to get a patch I felt good about for T12871 built without fixing this first.

Test Plan

See next change.

Diff Detail

rP Phabricator
Lint Not Applicable
Tests Not Applicable