Add a sort functionality to the sidebar items.
Sort subitems correctly.