Ungroup/flatten wiki page tree when ordering by created date

From https://gitlab.com/gitlab-org/gitlab-ce/issues/51433#note_153212257:

With introducing the sorting the following UX problem appears.

It's possible to group wiki pages into directories by creating pages with slashes in names (dir/first, dir/second...). On the index page, they are grouped and displayed in directories:

Screen_Shot_2019-03-22_at_12.58.27_PM

The screenshot is taken from the following page: https://gitlab.com/igor.drozdov/project-with-wikis/wikis/pages

Currently, the pages are sorted by title and then grouped by directories and displayed (pages first, then directories)

But if we're introducing the sorting by created_at, then the displaying of directories should be handled somehow because a directory can contain the oldest and the newest page, so it's arguable which position in the list the directory should have

One of the options that I see is to avoid the tree view and display directory pages as dir/first, dir/second (at least for the case when it's sorted by created_at)

Unfortunately this proposal wasn't implemented in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/25365, which introduced the new sorting control for wiki pages (by title and by created date).

I did a quick guerrilla usability test and people didn't understand the currently implemented behavior. They were not expecting to see the pages inside their “folders”, but as a flat hierarchy.

Currently implemented Expected
image image
Edited by Pedro Moreira da Silva