See Unified Review Banner for an overview of the entire project.

In this project, you will be creating the base shell for the Unified Review Banner. This won't handle any of the actual draft-related operations just yet. Rather, this will be the base shell of a banner that can track draft state, put itself into different modes, and register widgets to display on the banner.

Specifically, you must make sure the banner:

  1. Docks right below the Review Board navigation bar when in view.
  2. Floats at the top of the screen when the navigation bar is out of view (see the review banners for an example of this behavior -- this logic is consolidated in RB.FloatingBannerView)
  3. Can be in draft (green) or non-draft (light brown) mode, with different presentation depending on mode.
  4. Can have dropdowns, buttons, and other Backbone Views registered on it, each tied to the draft mode (and particular draft objects).

The initial banner will not replace any existing draft banner, or really do much of anything beyond provide this basic shell. In the next steps of the project, its content will be fleshed out and will begin to operate on drafts.

Basic Implementation

This banner will be implemented through a new Backbone View called RB.UnifiedReviewBannerView. This will be backed by a new RB.UnifiedReviewBannerState, which will contain attributes for the list of drafts/current draft, current review, etc., along with any utility methods needed to manage state.

The current review can be found in the existing RB.ReviewablePage model in the pendingReview attribute, which every reviewable page has (review request page, diff viewer, file attachments, etc.). This influences what the banner is currently showing.

The view will provide methods for registering those widgets and where they'll appear. There are four sections that should be made available: