selectViewTemplate behavior - why does it append "/view"?

I've experienced this behavior in 5.0.5 and 5.1.5, untested on 5.2.

  1. Change default layout of root (or folder) to some template. You will be redirected to ${site_url}/view because of https://github.com/plone/plone.app.content/blob/master/plone/app/content/browser/selection.py#L33
  2. Change default page to some page. Note that the behavior here is different if you use the modal than if you open in a new tab. If you use a new tab, it will redirect to ${site_url} which is correct. But the modal is the more typical use case and will maintain ${site_url}/view as your destination.

Not that ${site_url}/view and ${site_url} are not the same, and the behavior looks to be the same for folders. ${site_url}/view will always send you to self.getLayout() and not consider a default page. If you navigate to the site root by other means you will lose that /view stickiness, but to the end user it looks like their default page change did not work.

It is not clear to me if there's a reason to append that '/view' here https://github.com/plone/plone.app.content/blob/master/plone/app/content/browser/selection.py#L33. Admittedly the behavior described above is not common.