Repository navigation
Description
Some users really like how Graphite lets them customize the dashboard; we might want to support something similar.
At the core, users should be able to define a "categorization function", along the same lines as our existing custom review completion condition but executing on the client. This would take a PR/review data structure as input and output the category it belongs to, or null if the review should be omitted from the dashboard. This essentially puts all category conditions that Graphite has together into one place, which would make it a lot easier to have mutually-exclusive categories rather than having to manually negate another category's criteria. The function could use full JS to test against the data structure (more powerful), or run queries in Reviewable's user-facing query language against it (perhaps easier for simple tests). The category that's returned could include a priority that would determine the order in which the categories are listed on the dashboard. We'd provide sample code that replicates our default categories so you could extend or tweak as you see fit.
I'm not keen on adding a visual builder — I think most developers will be comfortable with writing a bit of code (especially if we provide examples to modify). Graphite's visual builder is pretty but limiting in its "disjunction of conjunctions" structure; some of the predefined categories' definitions are painfully repetitive, and would be a lot easier to read/write in code with nesting, early returns, etc. Code is also easier to check in, share, and so on.
On top of this core, we could add some improvements.
Currently, Reviewable enforces at most one category per review. We could let custom functions return multiple categories for a review so it would show up in all of them at once.
We don't allow sorting at the moment, but the function could also return an optional sort key for the review that would be used when ordering them within a category. This assumes that sort orders are driven by the category and don't need to be adjusted on the fly.
We could also allow folks to define multiple functions and quickly switch between them. This would let you have multiple "views" (each with their own filter, categories, and sorting) to use as needed.
Finally (and independent of the above) we could make some UI tweaks: collapsible sections, counters, etc.
Activity