Move functionality from FileAttachmentReviewUI into base ReviewUI.

Review Request #13525 — Created Feb. 6, 2024 and submitted — Latest diff uploaded


Review Board


In order to make Review UI classes more flexible, we're going to
consolidate all the functionality down into the base class. We currently
had the ReviewUI class which has an opaque obj member, and the
FileAttachmentReviewUI class which assumes that self.obj is a
FileAttachment. This change takes the functionality from
FileAttachmentReviewUI and moves it into the base class,
conditionalizing it based on the type of self.obj. This will allow us
to add additional conditions for other types of objects, such as
allowing it to be a FileDiff.

This also adds a new flag to the ReviewUI classes for whether they
support operating on a FileAttachment. This is used when selecting the
best ReviewUI for a given object.

  • Ran unit tests.
  • Tested to make sure Review UIs for common file types (images,
    markdown) still worked correctly.