Local use case:
users search, find some awesome app, and click add-to-home to add it to their layout. Which in MyUW is implemented as a single tab.
Where should the item add? As the first or last item on that tab?
Well, so far MyUW has used a naive user preferences update call that specifies the target tab as the parent but doesn't specify which child element to place the new portlet subscription in front of. So it gets the default behavior of
adding it to the end.
UX feedback suggests that instead we should be adding these items to the top. Which makes some sense -- prioritize the thing with the most novelty, it's probably most immediately interesting to the user and top-adding it will probably help them notice that it's successfully added whenever they leave the search results and re-view their home screen. Fair enough.
So I think I have
the local patch that will implement this change. I changed the default behavior locally.
Another approach might be to simply make the front end interrogate the layout to determine the ID if any of a first child node and then call the preferences update specifying to place the new item before that, but I'm trying to avoid making the front end more dependent upon implementation details of the back-end. From the front end's perspective this is just "Add nsse-survey to the layout" or so, it's a back-end implementation detail that this involves digging around in DOMs looking at child Nodes.
Yet another approach might have been to introduce a new web service with the simplicity I'm looking for that in its implementation does the layout inspection and nuancing the call to the user layout manager. That way the back-end implementation details wouldn't seep into the front end, and yet I wouldn't have to hack the default down in DLM and could instead front this in yet another Controller or so. Could.
Went with the approach I did, first stab at least, because it seems like at least in MyUW we really do want to change the default. It's not that we want to default to adding to the top for this one edge case. It's that, no, really, whenever the user adds something and we don't know where to put it, default to putting it first. So hacking the default seems most expressive of that insight and so simplest.
Question: whether and what ought to be done in upstream with this patch? Anyone dependent upon the add-as-last default behavior? On reflection most other adopters would prefer it add-as-first instead too? Ought this default behavior to be configurable per uPortal implementation, perhaps? No one else wants this changed?
I'm not thrilled about yet another local tweak further forking MyUW from upstream. I also figure if top-adding turns out to be a better user experience hereabouts in MyUW it's probably a better experience in other uPortals too. So if changing the default behavior seems like a good call to anyone else, I'd be inclined to offer that changeset for uPortal 5....
-Andrew