Improve the structure and presentation of the Dashboard sidebar.

Review Request #5407 — Created Feb. 5, 2014 and submitted — Latest diff uploaded

Information

Review Board
master

Reviewers

Improve the structure and presentation of the Dashboard sidebar.

The Dashboard sidebar was pretty old, and is extensibility was not very
good. This change throws out all the old code, replacing it with a
nicer architecture and design.

DashboardDatagrid now has an instance of Sidebar, which works as a
container for BaseSidebarItem subclasses. Each item added will be
rendered when rendering the sidebar.

We provide two built-in subclasses: SidebarSection, and SidebarNavItem.
These are used to create the sectioned lists of links we use, along with
the counts.

Extensions can provide their own subclasses, which can override the
template and render custom data if needed. There aren't yet hooks for
this, but that will come in another change.

The design and organization has also changed. Instead of
"Starred Reviews," "Outgoing Reviews," "Incoming Reviews, "Watched
Groups," and "All My Requests," there's now only two sections:
"Outgoing" and "Incoming".

"Outgoing" has nav items for "All" and "Open," replacing "Outgoing" and
"All My Requests."

"Incoming" has "Open" (replacing the former link on "Incoming" itself),
"To Me", "Starred" (if there are any starred review requests), the list
of subscribed groups, and the list of watched groups.

The display is a bit nicer. The section labels are little larger and
don't have "Reviews" or "Requests" in the names. The counts are now
little bubbles showing the counts instead of free-floating text. The
current Dashboard view is also shown on the side, by making the
appropriate nav item appear selected.

There's also a couple CSS fixes for handling scrolling when there are
more items than screen space.

Tested every type of link on the sidebar, to make sure they went to the
right view and showed as highlighted.

Resized the screen small and saw that the scrollbar appeared and functioned.

Added a long group name, and saw it wrap without breaking everything.

Went to the default Dashboard link, and saw that "Incoming -> Open" was
highlighted.

Checked that the other data grids, including the user page, were unaffected.
(The user page will soon make use of this architecture, though, replacing
the current poor extensibility.)